Bugzilla – Attachment 130581 Details for
Bug 30089
Placing holds on OPAC broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30089: Fix placing holds on OPAC after Bug 29844
Bug-30089-Fix-placing-holds-on-OPAC-after-Bug-2984.patch (text/plain), 2.84 KB, created by
Fridolin Somers
on 2022-02-14 21:45:26 UTC
(
hide
)
Description:
Bug 30089: Fix placing holds on OPAC after Bug 29844
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2022-02-14 21:45:26 UTC
Size:
2.84 KB
patch
obsolete
>From 19fea800e558cbefbc6fb48736a1f0c5ae505389 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Mon, 14 Feb 2022 11:37:53 -1000 >Subject: [PATCH] Bug 30089: Fix placing holds on OPAC after Bug 29844 > >When trying to place a hold in the OPAC, either multi hold or a single hold, the page explodes with: >The method Koha::AuthorisedValues->authorised_value is not covered by tests! > >We could fix by adding ->as_list. >This patch fixes by using >Koha::AuthorisedValues->get_description_by_koha_field on each item >instead of Koha::AuthorisedValues->search_by_koha_field list. >Performance should be OK because this method as cache. >This is used a lot in staff interface. > >Test plan : >1) In staff interface find a record with several items available > For example in KTD biblionumer=126 >2) Edit on item and change 'not for loan' to a non-zero value > For example in KTD $7 = Staff Collection >3) Go to OPAC on this record >4) Place hold >5) Click on 'A specific item' >=> Check you see not for loan authorised value description > For example in KTD '(Staff Collection)' >--- > opac/opac-reserve.pl | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index e8810650f7..d01da5fad0 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -460,9 +460,6 @@ 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 }; > > # Only keep the items that are visible in the opac (i.e. those in %visible_items) >@@ -525,10 +522,16 @@ foreach my $biblioNum (@biblionumbers) { > $itemLoopIter->{itemnotforloan} = $itemInfo->{itemnotforloan}; > > # Management of the notforloan document >- if ( $itemLoopIter->{notforloan} || $itemLoopIter->{itemnotforloan}) { >+ if ( $itemLoopIter->{notforloan} || $itemLoopIter->{itemnotforloan} ) { > $itemLoopIter->{backgroundcolor} = 'other'; >- $itemLoopIter->{notforloanvalue} = >- $notforloan_label_of->{ $itemLoopIter->{notforloan} }; >+ my $notforloan_av = Koha::AuthorisedValues->get_description_by_koha_field( >+ { >+ frameworkcode => $frameworkcode, >+ kohafield => 'items.notforloan', >+ authorised_value => $itemLoopIter->{notforloan} >+ } >+ ); >+ $itemLoopIter->{notforloanvalue} = $notforloan_av->{opac_description} // ''; > } > > # Management of lost or long overdue items >-- >2.35.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 30089
:
130581
|
130583
|
130592
|
130659
|
130863