From 6dd8a794f7191d6cd5c2aa3403cfde17eee5e369 Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 31 Jan 2013 11:20:13 +1100 Subject: [PATCH] Bug 9516 - Item Availability/Data missing from OPAC tag search Currently, an OPAC search using the "tag" and "q" query strings will have results with no item data. Next to "Availability", it will say "No items available:" (N.B. without reference to why the items are unavailable, like Checked out, In transit, etc.). The reason is that the opac-search.pl script is just pulling the marc blob straight from the database without embedding any item data. I've used the GetMarcBiblio sub with the embed item data option, and then converted the resulting Marc object to us marc using the "as_usmarc" method. Signed-off-by: Kyle M Hall --- opac/opac-search.pl | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 9708176..60e65a5 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -472,8 +472,11 @@ if ($tag) { $query_cgi = "tag=" .$tag . "&" . $query_cgi; my $taglist = get_tags({term=>$tag, approved=>1}); $results_hashref->{biblioserver}->{hits} = scalar (@$taglist); - my @biblist = (map {GetBiblioData($_->{biblionumber})} @$taglist); - my @marclist = (map {$_->{marc}} @biblist ); + my @marclist; + foreach my $record (@$taglist) { + my $marc = GetMarcBiblio($record->{biblionumber}, 1); + push @marclist, $marc->as_usmarc(); + } $DEBUG and printf STDERR "taglist (%s biblionumber)\nmarclist (%s records)\n", scalar(@$taglist), scalar(@marclist); $results_hashref->{biblioserver}->{RECORDS} = \@marclist; # FIXME: tag search and standard search should work together, not exclusively -- 1.7.2.5