From: Joshua Ferraro Date: Tue, 8 Jul 2008 20:59:09 +0000 (-0500) Subject: Prior to this patch, XSL and scan indexes conflicted. X-Git-Tag: v3.00.00~281 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;ds=sidebyside;h=1e45b1471447bf6a46fa728e093aa9663ff43193;p=srvgit Prior to this patch, XSL and scan indexes conflicted. This patch resolves the issue by passing $scan to the searchResults function to toggle XSL for scan results --- diff --git a/C4/Search.pm b/C4/Search.pm index d138594ff4..a252e1dcd4 100755 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1179,7 +1179,7 @@ Format results in a form suitable for passing to the template # IMO this subroutine is pretty messy still -- it's responsible for # building the HTML output for the template sub searchResults { - my ( $searchdesc, $hits, $results_per_page, $offset, @marcresults ) = @_; + my ( $searchdesc, $hits, $results_per_page, $offset, $scan, @marcresults ) = @_; my $dbh = C4::Context->dbh; my $even = 1; my @newresults; @@ -1500,7 +1500,7 @@ s/\[(.?.?.?.?)$tagsubf(.*?)]/$1$subfieldvalue$2\[$1$tagsubf$2]/g; } # XSLT processing of some stuff - if (C4::Context->preference("XSLTResultsDisplay") ) { + if (C4::Context->preference("XSLTResultsDisplay") && !$scan) { my $newxmlrecord = XSLTParse4Display($oldbiblio->{biblionumber},C4::Context->config('opachtdocs')."/prog/en/xslt/MARC21slim2OPACResults.xsl"); $oldbiblio->{XSLTResultsRecord} = $newxmlrecord; } diff --git a/catalogue/search.pl b/catalogue/search.pl index 75aab0848a..ad3d6a40c3 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -509,7 +509,7 @@ for (my $i=0;$i<@servers;$i++) { if ($server =~/biblioserver/) { # this is the local bibliographic server $hits = $results_hashref->{$server}->{"hits"}; my $page = $cgi->param('page') || 0; - my @newresults = searchResults( $query_desc,$hits,$results_per_page,$offset,@{$results_hashref->{$server}->{"RECORDS"}}); + my @newresults = searchResults( $query_desc,$hits,$results_per_page,$offset,$scan,@{$results_hashref->{$server}->{"RECORDS"}}); $total = $total + $results_hashref->{$server}->{"hits"}; ## If there's just one result, redirect to the detail page if ($total == 1) { diff --git a/cataloguing/addbooks.pl b/cataloguing/addbooks.pl index 1876133b8d..91d5d6e65c 100755 --- a/cataloguing/addbooks.pl +++ b/cataloguing/addbooks.pl @@ -79,7 +79,7 @@ if ($query) { # format output my $total = scalar @$marcresults; - my @newresults = searchResults( $query, $total, $results_per_page, $page-1, @$marcresults ); + my @newresults = searchResults( $query, $total, $results_per_page, $page-1, 0, @$marcresults ); $template->param( total => $total, query => $query, diff --git a/opac/opac-search.pl b/opac/opac-search.pl index b03554e2ff..3a177aff86 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -411,12 +411,12 @@ for (my $i=0;$i<=@servers;$i++) { # because pazGetRecords handles retieving only the records # we want as specified by $offset and $results_per_page, # we need to set the offset parameter of searchResults to 0 - my @group_results = searchResults( $query_desc, $group->{'group_count'},$results_per_page, 0, + my @group_results = searchResults( $query_desc, $group->{'group_count'},$results_per_page, 0, $scan, @{ $group->{"RECORDS"} }); push @newresults, { group_label => $group->{'group_label'}, GROUP_RESULTS => \@group_results }; } } else { - @newresults = searchResults( $query_desc,$hits,$results_per_page,$offset,@{$results_hashref->{$server}->{"RECORDS"}}); + @newresults = searchResults( $query_desc,$hits,$results_per_page,$offset,$scan,@{$results_hashref->{$server}->{"RECORDS"}}); } my $tag_quantity; if (C4::Context->preference('TagsEnabled') and