Bugzilla – Attachment 135339 Details for
Bug 30744
Use RecordProcessor in get_marc_notes to ensure non-public notes do not leak
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30744: Use RecordProcessor in get_marc_notes
Bug-30744-Use-RecordProcessor-in-getmarcnotes.patch (text/plain), 2.29 KB, created by
Martin Renvoize (ashimema)
on 2022-05-25 14:57:08 UTC
(
hide
)
Description:
Bug 30744: Use RecordProcessor in get_marc_notes
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-05-25 14:57:08 UTC
Size:
2.29 KB
patch
obsolete
>From 2560f8f3e8beaab6402e0848119605ce8c96a88b Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 25 May 2022 15:51:41 +0100 >Subject: [PATCH] Bug 30744: Use RecordProcessor in get_marc_notes > >This patch utilises RecordProcessor to filter the MARC::Record for the >right interface prior to constructing the marc notes array. We also >remove the use of C4::XSLT for replacing AV values in the MARC fields in >preference to using the RecordProcessor filter. >--- > Koha/Biblio.pm | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index b7431f5c26..969e0c8247 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -24,7 +24,6 @@ use URI; > use URI::Escape qw( uri_escape_utf8 ); > > use C4::Koha qw( GetNormalizedISBN ); >-use C4::XSLT qw( transformMARCXML4XSLT ); > > use Koha::Database; > use Koha::DateUtils qw( dt_from_string ); >@@ -42,6 +41,7 @@ use Koha::Items; > use Koha::Libraries; > use Koha::Old::Checkouts; > use Koha::Recalls; >+use Koha::RecordProcessor; > use Koha::Suggestions; > use Koha::Subscriptions; > use Koha::SearchEngine; >@@ -927,9 +927,19 @@ sub get_marc_notes { > my $marcflavour = C4::Context->preference('marcflavour'); > my $opac = $params->{opac}; > >- my $scope = $marcflavour eq "UNIMARC"? '3..': '5..'; >- my @marcnotes; >+ my $record = $self->metadata->record; >+ my $record_processor = Koha::RecordProcessor->new( >+ { >+ filters => ( 'ViewPolicy', 'AuthorizedValues' ), >+ options => { >+ interface => $opac ? 'opac' : 'intranet' , >+ frameworkcode => $self->frameworkcode >+ } >+ } >+ ); >+ $record_processor->process($record); > >+ my $scope = $marcflavour eq "UNIMARC"? '3..': '5..'; > #MARC21 specs indicate some notes should be private if first indicator 0 > my %maybe_private = ( > 541 => 1, >@@ -941,9 +951,8 @@ sub get_marc_notes { > > my %hiddenlist = map { $_ => 1 } > split( /,/, C4::Context->preference('NotesToHide')); >- my $record = $self->metadata->record; >- $record = transformMARCXML4XSLT( $self->biblionumber, $record, $opac ); > >+ my @marcnotes; > foreach my $field ( $record->field($scope) ) { > my $tag = $field->tag(); > next if $hiddenlist{ $tag }; >-- >2.20.1
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 30744
:
135339
|
135354
|
135365
|
135415
|
135757
|
135758
|
135762
|
136783
|
136793