From 0c9015975ac22c0363aba69a96f7b03ba1769bf9 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Thu, 19 Feb 2009 18:21:52 +0100 Subject: [PATCH] Multiple field search would not work any more --- C4/AuthoritiesMarc.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 089ce20903..3c1ad9a969 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -215,7 +215,7 @@ sub SearchAuthorities { my $dosearch; my $and=" \@and " ; - my $q2; + my $q2=""; for(my $i = 0 ; $i <= $#{$value} ; $i++) { if (@$value[$i]){ @@ -237,16 +237,17 @@ sub SearchAuthorities { $attr .=" \@attr 5=1 \@attr 4=6 ";## Word list, right truncated, anywhere } $attr =$attr."\"".@$value[$i]."\""; - $q2 .=$attr; + $q2 =($q2 ne "" ?$and.$q2.$attr:$attr); + warn $q2; $dosearch=1; }#if value } ##Add how many queries generated if ($query=~/\S+/){ - $query= $and.$query.$q2 + $query= $and.$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"? -- 2.39.5