Bugzilla – Attachment 11891 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]
Bug 8350: warning in logs when searching for nonexistent ISBN
Bug-8350-warning-in-logs-when-searching-for-nonexi.patch (text/plain), 1.49 KB, created by
Jared Camins-Esakov
on 2012-08-30 11:40:47 UTC
(
hide
)
Description:
Bug 8350: warning in logs when searching for nonexistent ISBN
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2012-08-30 11:40:47 UTC
Size:
1.49 KB
patch
obsolete
>From c4812fb57418e42fb92baa98cea627336a5cb28f 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: warning in logs when searching for nonexistent ISBN >Content-Type: text/plain; charset="UTF-8" > >Searching for a 10 or 13 digit numeric string 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. > >Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> >--- > C4/Breeding.pm | 8 ++++---- > 1 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index 19bb7e2..ea3e902 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -179,16 +179,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.2.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