Bugzilla – Attachment 125037 Details for
Bug 28906
Koha::Items->filter_by_visible_in_opac doesn't honour list context
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28906: (26223 follow-up) Remove use of as_list
Bug-28906-26223-follow-up-Remove-use-of-aslist.patch (text/plain), 2.22 KB, created by
David Nind
on 2021-09-19 20:30:05 UTC
(
hide
)
Description:
Bug 28906: (26223 follow-up) Remove use of as_list
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-09-19 20:30:05 UTC
Size:
2.22 KB
patch
obsolete
>From e8be6b8722aa8feff6c067da06131f7545de7f98 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 26 Aug 2021 09:41:48 -0300 >Subject: [PATCH] Bug 28906: (26223 follow-up) Remove use of as_list > >This bug makes Koha::Items->filter_by_visible_in_opac honour list >context, so this explicit call is not needed. > >To test: >1. Pick a biblio in the OPAC >2. Go to the ISBD view >=> SUCCESS: It renders correctly >3. Apply this patch and restart Plack >4. Refresh the ISBD view page >=> SUCCESS: It doesn't break! >5. Check opac-reserve.pl doesn't break either >6. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: David Nind <david@davidnind.com> >--- > opac/opac-ISBDdetail.pl | 2 +- > opac/opac-reserve.pl | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl >index 47fcb5e852..41119b3521 100755 >--- a/opac/opac-ISBDdetail.pl >+++ b/opac/opac-ISBDdetail.pl >@@ -99,7 +99,7 @@ unless ( $patron and $patron->category->override_hidden_items ) { > } > > my $record = $biblio->metadata->record; >-my @items = $biblio->items->filter_by_visible_in_opac({ patron => $patron })->as_list; >+my @items = $biblio->items->filter_by_visible_in_opac({ patron => $patron }); > > my $record_processor = Koha::RecordProcessor->new( > { filters => [ 'EmbedItems', 'ViewPolicy' ], >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index 721981bb2a..11682d76ff 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -461,7 +461,7 @@ foreach my $biblioNum (@biblionumbers) { > my @notforloan_avs = Koha::AuthorisedValues->search_by_koha_field({ kohafield => 'items.notforloan', frameworkcode => $frameworkcode }); > my $notforloan_label_of = { map { $_->authorised_value => $_->opac_description } @notforloan_avs }; > >- my $visible_items = { map { $_->itemnumber => $_ } $biblio->items->filter_by_visible_in_opac( { patron => $patron } )->as_list }; >+ my $visible_items = { map { $_->itemnumber => $_ } $biblio->items->filter_by_visible_in_opac( { patron => $patron } ) }; > > # Only keep the items that are visible in the opac (i.e. those in %visible_items) > # FIXME: We should get rid of itemInfos altogether and use $visible_items >-- >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 28906
:
124112
|
124113
|
124114
|
124115
|
125035
|
125036
|
125037
|
125258
|
125259
|
125260