(bug #3950) rebuild pendingreserves and fix reserves and transfert case
[koha.git] / C4 / Heading.pm
index 701cfbf..3f0302d 100644 (file)
@@ -117,9 +117,9 @@ heading.
 
 sub authorities {
     my $self = shift;
-    my $query = "Match-heading,ext='$self->{'search_form'}'";
+    my $query = qq(Match-heading,ext="$self->{'search_form'}");
     $query .= $self->_query_limiters();
-    my $results = SimpleSearch($query, "authorityserver");
+    my ($error, $results, $total_hits) = SimpleSearch( $query, undef, undef, [ "authorityserver" ] );
     return $results;
 }
 
@@ -140,7 +140,7 @@ sub preferred_authorities {
     my $self = shift;
     my $query = "Match-heading-see-from,ext='$self->{'search_form'}'";
     $query .= $self->_query_limiters();
-    my $results = SimpleSearch($query, "authorityserver");
+    my ($error, $results, $total_hits) = SimpleSearch( $query, undef, undef, [ "authorityserver" ] );
     return $results;
 }
 
@@ -152,8 +152,8 @@ sub preferred_authorities {
 
 sub _query_limiters {
     my $self = shift;
-    my $limiters = "";
 
+    my $limiters = " AND at='$self->{'auth_type'}'";
     if ($self->{'subject_added_entry'}) {
         $limiters .= " AND Heading-use-subject-added-entry=a"; # FIXME -- is this properly in C4::Heading::MARC21?
         $limiters .= " AND Subject-heading-thesaurus=$self->{'thesaurus'}";