Bugzilla – Attachment 11888 Details for
Bug 8350
Searching for a 10 or 13 digit string (with a number in it) that does not exist in one's catalog will fail to affect SQL statement correctly in C4::Breeding
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Prevents incorrect SQL statement generation in C4::Breeding resulting from an error on an undefined string substitution.
0001-Bug-8350-Searching-for-a-10-or-13-digit-string-with-.patch (text/plain), 1.39 KB, created by
Mark Tompsett
on 2012-08-30 10:18:12 UTC
(
hide
)
Description:
Prevents incorrect SQL statement generation in C4::Breeding resulting from an error on an undefined string substitution.
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2012-08-30 10:18:12 UTC
Size:
1.39 KB
patch
obsolete
>From 2cc592f951529f9af0048216f3e64abe96f43ddb Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Thu, 30 Aug 2012 15:06:07 +0800 >Subject: [PATCH] Bug 8350 - Searching for a 10 or 13 digit string (with a > number in it) that does not exist in one's catalog will > fail to affect SQL statement correctly in C4::Breeding > Moved string substitution, which was triggering error when > search was undefined, and fixed if statements accordingly. >Content-Type: text/plain; charset="utf-8" > >--- > C4/Breeding.pm | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index 9003f9a..2746456 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -185,16 +185,16 @@ sub BreedingSearch { > $query .= "z3950random = ?"; > @bind=($z3950random); > } else { >- $search =~ s/(\s+)/\%/g; > @bind=(); >- if ($search) { >+ if (defined($search) && length($search)>0) { >+ $search =~ s/(\s+)/\%/g; > $query .= "title like ? OR author like ?"; > push(@bind,"%$search%", "%$search%"); > } >- if ($search && $isbn) { >+ if ($#bind!=-1 && defined($isbn) && length($isbn)>0) { > $query .= " and "; > } >- if ($isbn) { >+ if (defined($isbn) && length($isbn)>0) { > $query .= "isbn like ?"; > push(@bind,"$isbn%"); > } >-- >1.7.9.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8350
:
10624
|
11888
|
11889
|
11890
|
11891