From 8768c6476ff5f87b51373d06092c699d4eb7fd79 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Thu, 11 Oct 2007 15:52:19 -0500 Subject: [PATCH] Bug fixing 1360 : It was a bug when no authoritytype was defined. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/AuthoritiesMarc.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 71e9c04ee9..878a1e261f 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -203,7 +203,7 @@ sub SearchAuthorities { $n++; } if ($n>1){ - $query= "\@or ".$query; + while ($n>1){$query= "\@or ".$query;$n--;} } my $dosearch; @@ -236,7 +236,11 @@ sub SearchAuthorities { }#if value } ##Add how many queries generated - $query= $and.$query.$q2; + if ($query=~/\S+/){ + $query= $and.$query.$q2 + } else { + $query=$q2; + } ## Adding order $query=' @or @attr 7=1 @attr 1=Heading 0 @or @attr 7=1 @attr 1=Heading-Entity 1'.$query if ($sortby eq "HeadingAsc"); $query=' @or @attr 7=2 @attr 1=Heading 0 @or @attr 7=1 @attr 1=Heading-Entity 1'.$query if ($sortby eq "HeadingDsc"); -- 2.39.5