Bugzilla – Attachment 98533 Details for
Bug 24602
The fallback value for onshelfholds should be 0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24602: Make get_onshelfholds_policy fallback to 0
Bug-24602-Make-getonshelfholdspolicy-fallback-to-0.patch (text/plain), 1.50 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-02-06 14:19:07 UTC
(
hide
)
Description:
Bug 24602: Make get_onshelfholds_policy fallback to 0
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-02-06 14:19:07 UTC
Size:
1.50 KB
patch
obsolete
>From a920eae8479a908a44875e17cda8eda411f80855 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 6 Feb 2020 11:10:39 -0300 >Subject: [PATCH] Bug 24602: Make get_onshelfholds_policy fallback to 0 > >The onshelfholds circulation rules values are more of an ENUM type (as >opposed to other rules with integers like max*qty). In the >quantities cases, it makes sense to have undef mean unlimited. In the >enum type it is clearer to just set a default value (0) as the code >already expects (Note: undef and 0 both eval to false so there's no >behaviour problem, but warnings or we get forced to check for >defined when the rule is used. It seems trivial to just make the >rule fallback to a chosen default value). > >This patch makes it fallback to 0. > >To test: >1. Run: > $ kshell > k$ prove t/db_dependent/Koha/CirculationRules.t \ > t/db_dependent/Reserves.t >=> FAIL: CirculationRules.t fails and Reserves.t prints a warning >2. Apply this patch >3. Repeat (1) >=> SUCCESS: Tests pass! No warning! >4. Sign off :-D >--- > Koha/CirculationRules.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm >index c26f572d12..6c36ba3b40 100644 >--- a/Koha/CirculationRules.pm >+++ b/Koha/CirculationRules.pm >@@ -420,7 +420,7 @@ sub get_onshelfholds_policy { > rule_name => 'onshelfholds', > } > ); >- return $rule ? $rule->rule_value : undef; >+ return $rule ? $rule->rule_value : 0; > } > > =head3 article_requestable_rules >-- >2.25.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 24602
:
98532
|
98533
|
98554
|
98555
|
98578
|
98579