Browse Source

bug 1890: fixing calls to C4::Search::SimpleSearch

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
3.0.x
Andrew Moore 16 years ago
committed by Joshua Ferraro
parent
commit
5c51edc653
  1. 2
      C4/AuthoritiesMarc.pm
  2. 4
      C4/Heading.pm
  3. 2
      cataloguing/addbiblio.pl
  4. 5
      opac/opac-rss.pl

2
C4/AuthoritiesMarc.pm

@ -802,7 +802,7 @@ sub FindDuplicateAuthority {
# build a request for SearchAuthorities
my $query='at='.$authtypecode.' ';
map {$query.= " and he=\"".$_->[1]."\"" if ($_->[0]=~/[A-z]/)} $record->field($auth_tag_to_report)->subfields() if $record->field($auth_tag_to_report);
my ($error,$results)=SimpleSearch($query,"authorityserver");
my ($error,$results)=SimpleSearch( $query, 0, 1, [ "authorityserver" ] );
# there is at least 1 result => return the 1st one
if (@$results>0) {
my $marcrecord = MARC::File::USMARC::decode($results->[0]);

4
C4/Heading.pm

@ -119,7 +119,7 @@ sub authorities {
my $self = shift;
my $query = qq(Match-heading,ext="$self->{'search_form'}");
$query .= $self->_query_limiters();
my $results = SimpleSearch($query, "authorityserver");
my $results = 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 $results = SimpleSearch( $query, undef, undef, [ "authorityserver" ] );
return $results;
}

2
cataloguing/addbiblio.pl

@ -678,7 +678,7 @@ AND (authtypecode IS NOT NULL AND authtypecode<>\"\")|);
# Search if there is any authorities to link to.
my $query='at='.$data->{authtypecode}.' ';
map {$query.= ' and he,ext="'.$_->[1].'"' if ($_->[0]=~/[A-z]/)} $field->subfields();
my ($error,$results)=SimpleSearch($query,"authorityserver");
my ($error,$results)=SimpleSearch( $query, undef, undef, [ "authorityserver" ] );
# there is only 1 result
if ( $error ) {
warn "BIBLIOADDSAUTHORITIES: $error";

5
opac/opac-rss.pl

@ -121,11 +121,10 @@ if ($RDF_update_needed) {
},
);
my $total; # the total results for the whole set
my ( $error, $marcresults ) = SimpleSearch($query);
warn "fetching $size results for $query";
my ( $error, $marcresults ) = SimpleSearch( $query, 0, $size );
my $hits = scalar @$marcresults;
$hits = $size if $hits > $size;
my @results;
for ( my $i = 0 ; $i < $hits ; $i++ ) {
my %resultsloop;

Loading…
Cancel
Save