Bugzilla – Attachment 2957 Details for
Bug 4309
Authorities : Multiple values search leads to Error 500
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Revised patch
0001-Bug-4309-Do-not-throw-error-on-auth-search-of-multip.patch (text/plain), 1.60 KB, created by
Colin Campbell
on 2011-01-06 17:42:23 UTC
(
hide
)
Description:
Revised patch
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2011-01-06 17:42:23 UTC
Size:
1.60 KB
patch
obsolete
>From 26dad4f0f99f1fed452a7acf9d4a350b91105349 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Thu, 6 Jan 2011 17:31:54 +0000 >Subject: [PATCH] Bug 4309 Do not throw error on auth search of multiple fields >Content-Type: text/plain; charset="utf-8" > >Ensures the multiple search does not throw a 500 error but >allows a single search to be used as well >--- > C4/AuthoritiesMarc.pm | 12 +++++++----- > 1 files changed, 7 insertions(+), 5 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 9421be9..0abd506 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -220,6 +220,7 @@ sub SearchAuthorities { > my $dosearch; > my $and=" \@and " ; > my $q2; >+ my $attr_cnt = 0; > for(my $i = 0 ; $i <= $#{$value} ; $i++) > { > if (@$value[$i]){ >@@ -246,15 +247,16 @@ sub SearchAuthorities { > } > $attr =$attr."\"".@$value[$i]."\""; > $q2 .=$attr; >- $dosearch=1; >+ $dosearch=1; >+ ++$attr_cnt; > }#if value > } > ##Add how many queries generated >- if ($query=~/\S+/){ >- $query= $and.$query.$q2 >+ if ($query=~/\S+/){ >+ $query= $and x $attr_cnt . $query . $q2; > } else { >- $query=$q2; >- } >+ $query= $q2; >+ } > ## Adding order > #$query=' @or @attr 7=2 @attr 1=Heading 0 @or @attr 7=1 @attr 1=Heading 1'.$query if ($sortby eq "HeadingDsc"); > my $orderstring= ($sortby eq "HeadingAsc"? >-- >1.7.3.4 >
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 4309
:
2000
| 2957