Bug 5661 Fix a problem when doing an authority search with no sort order
authorFrédérick Capovilla <frederick.capovilla@sys-tech.net>
Wed, 2 Feb 2011 21:17:21 +0000 (16:17 -0500)
committerChris Cormack <chrisc@catalyst.net.nz>
Wed, 2 Feb 2011 21:32:40 +0000 (10:32 +1300)
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
C4/AuthoritiesMarc.pm

index 0abd506..e5808b0 100644 (file)
@@ -266,8 +266,9 @@ sub SearchAuthorities {
                             '@attr 7=2 @attr 1=Heading 0'
                            :''
                         );            
-        $query=($query?"\@or $orderstring $query":"\@or \@attr 1=_ALLRECORDS \@attr 2=103 '' $orderstring ");
-        
+        $query=($query?$query:"\@attr 1=_ALLRECORDS \@attr 2=103 ''");
+        $query="\@or $orderstring $query" if $orderstring;
+
         $offset=0 unless $offset;
         my $counter = $offset;
         $length=10 unless $length;