Bugzilla – Attachment 138771 Details for
Bug 31303
Fatal error when viewing OPAC user account with waiting holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31303: Prevent fatal errors when missing "waiting hold cancellation" rule
Bug-31303-Prevent-fatal-errors-when-missing-waitin.patch (text/plain), 1.84 KB, created by
David Cook
on 2022-08-08 05:09:32 UTC
(
hide
)
Description:
Bug 31303: Prevent fatal errors when missing "waiting hold cancellation" rule
Filename:
MIME Type:
Creator:
David Cook
Created:
2022-08-08 05:09:32 UTC
Size:
1.84 KB
patch
obsolete
>From bf427e11a6bba9c98752c7b2a415341411c8d13a Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 8 Aug 2022 05:07:47 +0000 >Subject: [PATCH] Bug 31303: Prevent fatal errors when missing "waiting hold > cancellation" rule > >This patch removes method chaining which didn't account for the fact that >the "waiting hold cancellation" circulation rule might not exist. > >Test plan: >0. Apply patch and koha-plack --restart kohadev >1. Go to http://localhost:8081/cgi-bin/koha/reserve/request.pl?biblionumber=29 >2. Search for "koha" user >3. Choose the specific item and click "Place hold" >4. Check in "39999000001310" and click "Confirm hold (Y)" >5. Go to http://localhost:8080/cgi-bin/koha/opac-user.pl#opac-user-holds >6. Rejoice in Koha not exploding >7. Go to http://localhost:8081/cgi-bin/koha/admin/smart-rules.pl >8. Go to "Default waiting hold cancellation policy" and change "Cancellation allowed" to "Yes" and click "Add" >9. Go to http://localhost:8080/cgi-bin/koha/opac-user.pl#opac-user-holds >10. Note the "Cancel" button appears >11. Rejoice again that the "Cancel" button appeared >--- > Koha/Hold.pm | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index 63e30970ca..c662a08a6c 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -460,14 +460,15 @@ sub cancellation_requestable_from_opac { > $controlbranch = $item->homebranch; > } > >- return Koha::CirculationRules->get_effective_rule( >+ my $rule = Koha::CirculationRules->get_effective_rule( > { > categorycode => $patron->categorycode, > itemtype => $item->itype, > branchcode => $controlbranch, > rule_name => 'waiting_hold_cancellation', > } >- )->rule_value ? 1 : 0; >+ ); >+ return ( $rule && $rule->rule_value ) ? 1 : 0; > } > > =head3 is_at_destination >-- >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 31303
:
138771
|
138835
|
138836