Bugzilla – Attachment 161934 Details for
Bug 31224
Koha::Biblio::Metadata->record should use the EmbedItems filter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31224: Use metadata_record in opac-MARCdetail.pl
Bug-31224-Use-metadatarecord-in-opac-MARCdetailpl.patch (text/plain), 2.51 KB, created by
Martin Renvoize (ashimema)
on 2024-02-08 16:53:32 UTC
(
hide
)
Description:
Bug 31224: Use metadata_record in opac-MARCdetail.pl
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-02-08 16:53:32 UTC
Size:
2.51 KB
patch
obsolete
>From a29949ac161fe3286b3be0415f89bb82eda4c5b7 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 22 Jul 2022 17:59:34 -0300 >Subject: [PATCH] Bug 31224: Use metadata_record in opac-MARCdetail.pl > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > opac/opac-MARCdetail.pl | 31 ++++++++++++++----------------- > 1 file changed, 14 insertions(+), 17 deletions(-) > >diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl >index 0829341d731..d7d34db9884 100755 >--- a/opac/opac-MARCdetail.pl >+++ b/opac/opac-MARCdetail.pl >@@ -92,9 +92,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > > my $patron = Koha::Patrons->find($loggedinuser); > my $biblio = Koha::Biblios->find($biblionumber); >- >-my $record = $biblio ? $biblio->metadata->record : undef; >-if ( ! $record ) { >+if ( !$biblio ) { > print $query->redirect("/cgi-bin/koha/errors/404.pl"); > exit; > } >@@ -108,19 +106,17 @@ 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 => [ 'EmbedItems', 'ViewPolicy' ], >- options => { >- interface => 'opac', >- frameworkcode => $framework, >- items => [ $items->as_list ], >+my $record = $biblio ? $biblio->metadata_record( >+ { >+ embed_items => 1, >+ opac => 1, >+ patron => $patron, > } >-}); >-$record_processor->process($record); >+) : undef; >+if ( ! $record ) { >+ print $query->redirect("/cgi-bin/koha/errors/404.pl"); >+ exit; >+} > > # get biblionumbers stored in the cart > if(my $cart_list = $query->cookie("bib_list")){ >@@ -130,6 +126,8 @@ if(my $cart_list = $query->cookie("bib_list")){ > } > } > >+my $framework = $biblio ? $biblio->frameworkcode : q{}; >+my $tagslib = &GetMarcStructure( 0, $framework ); > my ($bt_tag,$bt_subtag) = GetMarcFromKohaField( 'biblio.title' ); > $template->param( > bibliotitle => $biblio->title, >@@ -137,8 +135,7 @@ $template->param( > $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8; # except -8; > > my $can_item_be_reserved = 0; >-$items->reset; >- >+my $items = $biblio->items->filter_by_visible_in_opac({ patron => $patron }); > while ( my $item = $items->next ) { > $can_item_be_reserved = $can_item_be_reserved || $patron && IsAvailableForItemLevelRequest( $item, $patron, undef ); > } >-- >2.43.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 31224
:
138060
|
138061
|
138062
|
138063
|
138064
|
142137
|
142138
|
142139
|
142140
|
142141
|
142142
|
142143
|
161933
|
161934
|
161935
|
161936
|
161937
|
161938
|
161939
|
161940
|
161941
|
161942
|
161943
|
161944
|
173530
|
173531
|
173532
|
173533
|
173534
|
173535
|
173588
|
173597
|
173598
|
173636
|
173637
|
173638
|
173639
|
173640
|
173641
|
173642
|
173643
|
173644
|
174262
|
174263