Bugzilla – Attachment 102081 Details for
Bug 25019
Non standard initialization in ViewPolicy filter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25019: Make the ViewPolicy filter initialization standard
Bug-25019-Make-the-ViewPolicy-filter-initializatio.patch (text/plain), 2.06 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-03-30 12:44:02 UTC
(
hide
)
Description:
Bug 25019: Make the ViewPolicy filter initialization standard
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-03-30 12:44:02 UTC
Size:
2.06 KB
patch
obsolete
>From d8e6ba7cac90755c81efcbbb1a97bf0d642fdadf Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 30 Mar 2020 09:39:13 -0300 >Subject: [PATCH] Bug 25019: Make the ViewPolicy filter initialization standard > >This patch makes the ViewPolicy filter use the 'params' accessor instead >of relying of ->{options} which has no accessor. This will allow >interacting with the filter object be similar through all the filters in >the chain. > >To test, we just need to verify no behaviour change takes place: >1. Run: > $ kshell > k$ prove t/db_dependent/Filter_MARC_ViewPolicy.t >=> SUCCESS: Tests pass >2. Apply this patch >3. Repeat 1 >=> SUCCESS: Tests still pass! >4. Sign off :-D >--- > Koha/Filter/MARC/ViewPolicy.pm | 16 ++++------------ > 1 file changed, 4 insertions(+), 12 deletions(-) > >diff --git a/Koha/Filter/MARC/ViewPolicy.pm b/Koha/Filter/MARC/ViewPolicy.pm >index e69b7303b7..a963e3f129 100644 >--- a/Koha/Filter/MARC/ViewPolicy.pm >+++ b/Koha/Filter/MARC/ViewPolicy.pm >@@ -78,10 +78,12 @@ sub filter { > push @records, $precord; > } > >+ my $params = $self->params; >+ my $interface = $params->{options}->{interface} // 'opac'; >+ my $frameworkcode = $params->{options}->{frameworkcode} // q{}; >+ > foreach my $current_record (@records) { > my $result = $current_record; >- my $interface = $self->{options}->{interface} // 'opac'; >- my $frameworkcode = $self->{options}->{frameworkcode} // q{}; > my $hide = _should_hide_on_interface(); > > my $marcsubfieldstructure = GetMarcStructure( 0, $frameworkcode, { unsafe => 1 } ); >@@ -153,16 +155,6 @@ sub _filter_field { > return; > } > >-sub initialize { >- my $self = shift; >- my $param = shift; >- >- my $options = $param->{options}; >- $self->{options} = $options; >- $self->Koha::RecordProcessor::Base::initialize($param); >- return; >-} >- > # Copied and modified from 3.10.x help file > # marc_subfields_structure.hidden > # allows you to select from 19 possible visibility conditions, 17 of which are implemented. They are the following: >-- >2.26.0
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 25019
:
102081
|
102156
|
102532