From 4039ac5d2af8f4a012296d9432363a4ecba0fa05 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT 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