Bug 27675 - Default checkout, hold and return policy should indicate when set vs unset and should not set null rules
Summary: Default checkout, hold and return policy should indicate when set vs unset an...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-10 19:13 UTC by Nick Clemens (kidclamp)
Modified: 2025-11-21 13:28 UTC (History)
4 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 '') {
Comment 2 Andrew Fuerste-Henry 2025-11-21 13:28:43 UTC
I've got a suggestion for addressing this. What if we add checkboxes for "Unlimited" to Total Current Checkouts, Total Current On-site Checkouts, and Total Holds?
- Replace the current value placeholder of "Unlimited" with "Not set"
- If a user saves set of rules with no value in one of these fields, no rule is created for that field
- If a user saves a set of rules with the Unlimited box checked for one of these fields, Koha creates a rule with rule_value=''

This maintains current rule storage and enforcement, but makes the display and interface more clear.