Bugzilla – Attachment 104708 Details for
Bug 24458
Search results don't use Koha::Filter::MARC::ViewPolicy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24458: Use the ViewPolicy filter on search results
Bug-24458-Use-the-ViewPolicy-filter-on-search-resu.patch (text/plain), 2.29 KB, created by
Victor Grousset/tuxayo
on 2020-05-11 16:39:02 UTC
(
hide
)
Description:
Bug 24458: Use the ViewPolicy filter on search results
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2020-05-11 16:39:02 UTC
Size:
2.29 KB
patch
obsolete
>From 7bbbb8c8303b35080486f1ee7361edfd0f69e85f Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 11 May 2020 10:10:39 -0300 >Subject: [PATCH] Bug 24458: Use the ViewPolicy filter on search results > >This patch implements the use of the ViewPolicy record processor filter >inside C4::Search::searchResults. The idea is that the $record_processor >is instantiated once and reused inside the loop. This leaves options for >further optimizations I will do on a follow-up bug. > >The filter is applied to the MARC data before it is passed to the XSLT >processor. > >To test: >1. Apply the regression tests patch >2. Run: > $ kshell > k$ prove t/db_dependent/Search.t >=> FAIL: This is not implemented, tests fail >3. Apply this patch >4. Repeat 2 >5. Feel the joy in your body from a long standing bug being solved >6. Sign off :-D > >https://bugs.koha-community.org/show_bug.cgi?id=25416 > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > C4/Search.pm | 11 +++++++++++ > 1 file changed, 11 insertions(+) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 0ab24a5ff8..cd9b8923bd 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -33,6 +33,7 @@ use Koha::AuthorisedValues; > use Koha::ItemTypes; > use Koha::Libraries; > use Koha::Patrons; >+use Koha::RecordProcessor; > use YAML; > use URI::Escape; > use Business::ISBN; >@@ -1690,6 +1691,10 @@ sub searchResults { > $is_opac = 1; > } > >+ my $record_processor = Koha::RecordProcessor->new({ >+ filters => 'ViewPolicy' >+ }); >+ > #Build branchnames hash > my %branches = map { $_->branchcode => $_->branchname } Koha::Libraries->search({}, { order_by => 'branchname' }); > >@@ -2087,6 +2092,12 @@ sub searchResults { > # XSLT processing of some stuff > # we fetched the sysprefs already before the loop through all retrieved record! > if (!$scan && $xslfile) { >+ $record_processor->options({ >+ frameworkcode => $fw, >+ interface => $search_context->{'interface'} >+ }); >+ >+ $record_processor->process($marcrecord); > $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $xslsyspref, 1, \@hiddenitems, $sysxml, $xslfile, $lang, $xslt_variables); > } > >-- >2.26.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24458
:
104696
|
104697
|
104707
|
104708
|
104765
|
104766