Bugzilla – Attachment 135758 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: Optionally allow passing record to prevent refetch
Bug-30744-Optionally-allow-passing-record-to-preve.patch (text/plain), 1.80 KB, created by
Martin Renvoize (ashimema)
on 2022-06-07 12:18:49 UTC
(
hide
)
Description:
Bug 30744: Optionally allow passing record to prevent refetch
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-06-07 12:18:49 UTC
Size:
1.80 KB
patch
obsolete
>From f5e0d6a1f28754ca832be7895881b6708185e753 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 7 Jun 2022 13:17:04 +0100 >Subject: [PATCH] Bug 30744: Optionally allow passing record to prevent refetch > >This patch adds the option to pass the marcrecord into the call to >prevent the extra DB fetch of the record. >--- > Koha/Biblio.pm | 4 ++-- > opac/opac-detail.pl | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 1c387c4487..cd59f28c41 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -913,7 +913,7 @@ sub cover_images { > > =head3 get_marc_notes > >- $marcnotesarray = $biblio->get_marc_notes({ opac => 1 }); >+ $marcnotesarray = $biblio->get_marc_notes({ opac => 1, [ record => $marc ] }); > > Get all notes from the MARC record and returns them in an array. > The notes are stored in different fields depending on MARC flavour. >@@ -928,7 +928,7 @@ sub get_marc_notes { > my $opac = $params->{opac} // '0'; > my $interface = $params->{opac} ? 'opac' : 'intranet'; > >- my $record = $self->metadata->record; >+ my $record = $params->{record} // $self->metadata->record; > my $record_processor = Koha::RecordProcessor->new( > { > filters => [ 'ViewPolicy', 'ExpandCodedFields' ], >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index f6b713542d..8957f55567 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -796,7 +796,7 @@ if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { > } > } > >-my $marcnotesarray = $biblio->get_marc_notes({ opac => 1 }); >+my $marcnotesarray = $biblio->get_marc_notes({ opac => 1, record => $record }); > > if( C4::Context->preference('ArticleRequests') ) { > my $patron = $borrowernumber ? Koha::Patrons->find($borrowernumber) : undef; >-- >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