Bugzilla – Attachment 146813 Details for
Bug 23247
Use EmbedItems in opac-MARCdetail.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23247: Use EmbedItems in opac-MARCdetail.pl
Bug-23247-Use-EmbedItems-in-opac-MARCdetailpl.patch (text/plain), 2.54 KB, created by
Marcel de Rooy
on 2023-02-17 10:33:25 UTC
(
hide
)
Description:
Bug 23247: Use EmbedItems in opac-MARCdetail.pl
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-02-17 10:33:25 UTC
Size:
2.54 KB
patch
obsolete
>From 14914b2e79ed4e48b7fc3fca96c4480b8279b9a4 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 22 Jul 2022 16:46:51 -0300 >Subject: [PATCH] Bug 23247: Use EmbedItems in opac-MARCdetail.pl >Content-Type: text/plain; charset=utf-8 > >This patch uses the EmbedItems processor to add the items to the MARC >record. > >To test: >- Find a known record, go to the OPAC MARC page of it. >- Play with several options in OpacHiddenItems, refreshing it >- Play with OpacHiddenItemsExceptions as well >=> SUCCESS: Things work as expected >- Apply this patch >- Repeate the tests above >=> SUCCESS: Things work as expected! >- Sign off :-D > >Seems to work as advertised. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: LMSCloudPaulD <paul.derscheid@lmscloud.de> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > opac/opac-MARCdetail.pl | 19 ++++++++----------- > 1 file changed, 8 insertions(+), 11 deletions(-) > >diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl >index c902f849c4..f55d6bf5ef 100755 >--- a/opac/opac-MARCdetail.pl >+++ b/opac/opac-MARCdetail.pl >@@ -92,13 +92,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > > my $patron = Koha::Patrons->find($loggedinuser); > my $biblio = Koha::Biblios->find($biblionumber); >-my $record = $biblio->metadata->record( >- { >- embed_items => 1, >- opac => 1, >- patron => $patron, >- } >-); >+my $record = $biblio->metadata->record; >+ > if ( ! $record ) { > print $query->redirect("/cgi-bin/koha/errors/404.pl"); > exit; >@@ -113,14 +108,16 @@ unless ( $patron and $patron->category->override_hidden_items ) { > } > } > >+my $items = $biblio->items->filter_by_visible_in_opac({ patron => $patron }); > my $framework = $biblio ? $biblio->frameworkcode : q{}; > my $tagslib = &GetMarcStructure( 0, $framework ); > > my $record_processor = Koha::RecordProcessor->new({ >- filters => 'ViewPolicy', >+ filters => [ 'EmbedItems', 'ViewPolicy' ], > options => { >- interface => 'opac', >- frameworkcode => $framework >+ interface => 'opac', >+ frameworkcode => $framework, >+ items => [ $items->as_list ], > } > }); > $record_processor->process($record); >@@ -140,7 +137,7 @@ $template->param( > $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8; # except -8; > > my $allow_onshelf_holds; >-my $items = $biblio->items; >+$items->reset; > > while ( my $item = $items->next ) { > $allow_onshelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } ) >-- >2.30.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 23247
:
91158
|
91253
|
93528
|
102094
|
102095
|
138059
|
144689
| 146813