Bug 11986: fix searching by tags in OPAC when DOM mode is in use
authorJacek Ablewicz <abl@biblos.pk.edu.pl>
Sun, 23 Mar 2014 20:24:48 +0000 (21:24 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 28 Apr 2014 16:17:07 +0000 (16:17 +0000)
This patch fixes the following issue: in installations that are using
zebra DOM indexing for bibliographic records, tag searching in OPAC
doesn't work properly (clicking on any tag in OPAC leads to "404 error").

To test: ensure that with patch applied:
1) problems with tag searching get resolved for [some] test
configuration with biblio DOM indexing enabled,
2) there are no apparent tag-searching-related regressions in OPAC,
in some yet another test installation configured with legacy
(grs1) indexing mode for biblios.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
opac/opac-search.pl

index 83f16d8..e2236c2 100755 (executable)
@@ -501,7 +501,7 @@ if ($tag) {
     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 = (map { (C4::Context->config('zebra_bib_index_mode') eq 'dom')? $_->{marcxml}: $_->{marc}; } @biblist);
     $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