Bugzilla – Attachment 2000 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]
patch proposed
0001-MT3094-Error-500-Authorities-search.patch (text/plain), 1.99 KB, created by
Chris Cormack
on 2010-03-09 10:22:00 UTC
(
hide
)
Description:
patch proposed
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2010-03-09 10:22:00 UTC
Size:
1.99 KB
patch
obsolete
>From 4039ac5d2af8f4a012296d9432363a4ecba0fa05 Mon Sep 17 00:00:00 2001 >From: Henri-Damien LAURENT <henridamien.laurent@biblibre.com> >Date: Tue, 9 Mar 2010 11:09:45 +0100 >Subject: [PATCH] MT3094 : Error 500 Authorities search > >Search For multiple values ( Heading strict, Heading main and anywhere) >produced an ill formed z3950 query. >Fixing that >--- > C4/AuthoritiesMarc.pm | 22 +++++++++++++++------- > 1 files changed, 15 insertions(+), 7 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 1a38450..a00bcb1 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -218,9 +218,10 @@ sub SearchAuthorities { > > my $dosearch; > my $and=" \@and " ; >- my $q2; >+ my @q2; > for(my $i = 0 ; $i <= $#{$value} ; $i++) > { >+ my $querypart; > if (@$value[$i]){ > ##If mainentry search $a tag > if (@$tags[$i] eq "mainmainentry") { >@@ -244,16 +245,23 @@ sub SearchAuthorities { > $attr .=" \@attr 5=1 \@attr 4=6 ";## Word list, right truncated, anywhere > } > $attr =$attr."\"".@$value[$i]."\""; >- $q2 .=$attr; >+ $querypart .=$attr; > $dosearch=1; > }#if value >+ push @q2, $querypart; > } > ##Add how many queries generated >- if ($query=~/\S+/){ >- $query= $and.$query.$q2 >- } else { >- $query=$q2; >- } >+ my $count=0; >+ for my $querypart (@q2){ >+ if ($query=~/\S+/){ >+ $query= (($count<scalar(@q2)-1)?$and:"").$query.$querypart; >+ } >+ else { >+ $query= $querypart; >+ } >+ $count++; >+ } >+ > ## 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.6.3.3 >
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