Bugzilla – Attachment 48815 Details for
Bug 15870
Add Filter for MARC to respect visibility settings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF]Bug 15870: potential follow up to comment #8
SIGNED-OFFBug-15870-potential-follow-up-to-comment.patch (text/plain), 2.19 KB, created by
Héctor Eduardo Castro Avalos
on 2016-03-08 19:46:46 UTC
(
hide
)
Description:
[SIGNED-OFF]Bug 15870: potential follow up to comment #8
Filename:
MIME Type:
Creator:
Héctor Eduardo Castro Avalos
Created:
2016-03-08 19:46:46 UTC
Size:
2.19 KB
patch
obsolete
>From fe535320ea0d572b545241c0d0917ebaf3c6b926 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Mon, 7 Mar 2016 21:34:45 -0500 >Subject: [PATCH] [SIGNED-OFF]Bug 15870: potential follow up to comment #8 > >This patch: >- makes the Koha::RecordProcessor code more clear > by removing the unnecessary newrecord variable. >- revises the filter to be more clear about the > expectation that operations are done directly on > the record parameter. > >TEST PLAN >--------- >prove t/RecordProcessor.t >prove t/db_dependent/Filter_MARC_ViewPolicy.t >run koha qa test tools > >Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> >Works as advertised. NO koha-qa errors >--- > Koha/Filter/MARC/ViewPolicy.pm | 12 ++---------- > Koha/RecordProcessor.pm | 6 ++---- > 2 files changed, 4 insertions(+), 14 deletions(-) > >diff --git a/Koha/Filter/MARC/ViewPolicy.pm b/Koha/Filter/MARC/ViewPolicy.pm >index 14df201..98df72d 100644 >--- a/Koha/Filter/MARC/ViewPolicy.pm >+++ b/Koha/Filter/MARC/ViewPolicy.pm >@@ -78,9 +78,8 @@ sub filter { > push @records, $precord; > } > >- my @results; > foreach my $current_record (@records) { >- my $result = $current_record->clone(); >+ my $result = $current_record; > my $interface = $self->{options}->{interface} // 'opac'; > my $frameworkcode = $self->{options}->{frameworkcode} // q{}; > my $hide = _should_hide_on_interface(); >@@ -103,15 +102,8 @@ sub filter { > } > ); > } >- push @results, $result; >- } >- >- if ( scalar @results == 1 ) { >- return $results[0]; >- } >- else { >- return \@results; > } >+ return; > } > > sub _filter_field { >diff --git a/Koha/RecordProcessor.pm b/Koha/RecordProcessor.pm >index b9d2918..1f93571 100644 >--- a/Koha/RecordProcessor.pm >+++ b/Koha/RecordProcessor.pm >@@ -152,14 +152,12 @@ sub process { > > return unless defined $record; > >- my $newrecord = $record; >- > foreach my $filterobj (@{$self->filters}) { > next unless $filterobj; >- $newrecord = $filterobj->filter($newrecord); >+ $filterobj->filter($record); > } > >- return $newrecord; >+ return $record; > } > > sub DESTROY { >-- >1.7.10.4
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 15870
:
48260
|
48261
|
48346
|
48628
|
48766
|
48767
|
48768
|
48769
|
48812
|
48813
|
48814
|
48815
|
49013
|
49035
|
49534
|
49535
|
49536
|
49537
|
49538