From 78d930d438a89ac82fddb1b26f1795c4d831deab Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 26 May 2020 10:10:52 +0200 Subject: [PATCH] Bug 25601: (bug 18928 follow-up) Fix "Unset" for "return policy for $branch" returnbranch has to pass an itemtype key when setting the rule (here setting it to unlimited for any item types) Test plan: 1. Go the "Circulation and fine rules" admin page 2. Set a rule for "Default checkout, hold and return policy" 3. Unset it 4. Select a library 5. Set a rule for "Default checkout, hold and return policy" 6. Unset it Display should be consistent with what you selected Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart (cherry picked from commit f1cc9d6b599ae423d8024fb11f3f601d57ab9963) Signed-off-by: Aleisha Amohia --- admin/smart-rules.pl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index 403f425e54..30d8fca24b 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -124,16 +124,23 @@ elsif ($op eq 'delete-branch-cat') { } elsif ($categorycode eq "*") { Koha::CirculationRules->set_rules( { + branchcode => $branch, categorycode => undef, + rules => { + max_holds => undef, + patron_maxissueqty => undef, + patron_maxonsiteissueqty => undef, + } + } + ); + Koha::CirculationRules->set_rules( + { branchcode => $branch, itemtype => undef, rules => { - patron_maxissueqty => undef, - patron_maxonsiteissueqty => undef, holdallowed => undef, hold_fulfillment_policy => undef, returnbranch => undef, - max_holds => undef, } } ); -- 2.39.5