Bug 27675

Summary: Default checkout, hold and return policy should indicate when set vs unset and should not set null rules
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: CirculationAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: andrew, gmcharlt, jonathan.druart, kyle.m.hall
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Nick Clemens (kidclamp) 2021-02-10 19:13:28 UTC
These policies can be set to blank, this affects the holds queue and presumably other areas. There needs to be a visual indication of the rule not being set vs the rule being set to blank - or the rule should not save when dropdown is set to 'Not set'

To recreate:
1 - Go to Admin->Circulation rules and pick a branch with no rules set
2 - Under "Default checkout, hold and return policy" leave all fields blank and hit save
3 - Check the DB, five rules have been set:
    SELECT * FROM circulation_rules WHERE branchcode="BRANCH";
4 - In the staff client, click 'Unset'
5 - There is a warning, but no visible change
6 - Check the DB, the rules are gone
Comment 1 Jonathan Druart 2021-02-12 12:26:54 UTC
IMO it should not modify the behaviour, that's where the issue is.

For instance with patron_maxissueqty we are comparing with ''

 539     if (defined($branch_borrower_circ_rule->{patron_maxissueqty}) and $branch_borrower_circ_rule->{patron_maxissueqty} ne '') {