Bug 40205 - "Default checkout, hold and return policy" cannot be unset
Summary: "Default checkout, hold and return policy" cannot be unset
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Lucas Gass (lukeg)
QA Contact: Testopia
URL:
Keywords:
Depends on: 36447
Blocks:
  Show dependency treegraph
 
Reported: 2025-06-20 12:32 UTC by Katrin Fischer
Modified: 2025-11-21 17:41 UTC (History)
9 users (show)

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


Attachments
Bug 40205: data-categorycode should always be set to ALL (1.81 KB, patch)
2025-11-21 14:40 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 40205: data-categorycode should always be set to ALL (1.87 KB, patch)
2025-11-21 15:37 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2025-06-20 12:32:59 UTC
Rules in the "Default checkout, hold and return policy" section of the circulation rules can no longer be deleted/unset.

To test:
- Go to administration > circulation rules
- Enter a value in one of the fields of the 
  "Default checkout, hold and return policy" section
- Save
- Verify the value you entered was stored and is shown on the page
- Click on the button "unset"
- Confirm the confirmation question
- Verify the value still shows, the rule was left unchanged

The expected behavior is that the rule would be deleted and in the first column of the table it should say "Not set" as for a new installation.

This was confirmed to be working correctly in 22.11.
Broken in 24.11
Working correctly in main.
Comment 1 Christopher Brannon 2025-07-03 14:51:37 UTC
I can confirm this is not working.  I had to change the rule to not set and save that to get around this.
Comment 2 Christopher Brannon 2025-11-05 15:59:57 UTC
Still valid for 25.05
Comment 3 Christopher Brannon 2025-11-05 16:06:36 UTC
I'm thinking that because this section can't be unset, you always have to set something, even to not set.

When we did our migration, we had to limit holds to within groups.  We set the default rule, but because there was a rule that could not be unset in each branch, we had to set the same rule in every branch for the group holds to work.

It seems that if this rule were unset, it should adhere to the default rule.

Am I wrong?

If not, then this is causing us to maintain more rules than necessary.
Comment 4 Andrew Fuerste-Henry 2025-11-21 13:02:39 UTC
I'm kicking this up to major importance as the ability to adjust circulation rules is pretty integral to most libraries.
Can confirm it's an issue in 25.05.05 but not in main.
Comment 5 trevor.diamond 2025-11-21 14:16:22 UTC
When I ran into this in August, I found that this could not be unset until I deleted everything defined in the sections 

Checkout, hold policy by patron category 
Holds policies by item type

So this might be a bug, but potentially there's a workaround for people until it gets fixed?
Comment 6 Lucas Gass (lukeg) 2025-11-21 14:21:11 UTC
This still exists in main, to recreate:

1. Add at least one rule to the default-circulation-rules table that contains a patron category.
2. Now add a "Default checkout, hold and return policy" rule. 
3. Inspect the "Unset" button:

<a href="#" class="delete-branch-cat btn btn-default btn-xs" data-categorycode="T" data-branch="*"><i class="fa fa-undo"></i> Unset</a>

It is erroneously passing in categorycode from the default-circulation-rules, it needs to be set as *.
Comment 7 Andrew Fuerste-Henry 2025-11-21 14:38:24 UTC
(In reply to Lucas Gass (lukeg) from comment #6)
> This still exists in main, to recreate:
> 
> 1. Add at least one rule to the default-circulation-rules table that
> contains a patron category.
> 2. Now add a "Default checkout, hold and return policy" rule. 
> 3. Inspect the "Unset" button:
> 
> <a href="#" class="delete-branch-cat btn btn-default btn-xs"
> data-categorycode="T" data-branch="*"><i class="fa fa-undo"></i> Unset</a>
> 
> It is erroneously passing in categorycode from the
> default-circulation-rules, it needs to be set as *.

As a workaround until this is patched, manually changing that categorycode to * in the inspector will allow the Unset button to work.
Comment 8 Lucas Gass (lukeg) 2025-11-21 14:40:34 UTC
Created attachment 189852 [details] [review]
Bug 40205: data-categorycode should always be set to ALL

To test:
1. Add at least one rule to the default-circulation-rules table that contains a patron category.
2. Now add a "Default checkout, hold and return policy" rule.
3. Inspect the "Unset" button:

<a href="#" class="delete-branch-cat btn btn-default btn-xs" data-categorycode="T" data-branch="*"><i class="fa fa-undo"></i> Unset</a>

4. APPLY PATCH and clear browser cache
5. Try again, this time you should be able to delete the rule.
Comment 9 Lucas Gass (lukeg) 2025-11-21 14:41:16 UTC
For this particular rule I don't think the categorycode should ever be anything besides all/*
Comment 10 Andrew Fuerste-Henry 2025-11-21 15:37:45 UTC
Created attachment 189860 [details] [review]
Bug 40205: data-categorycode should always be set to ALL

To test:
1. Add at least one rule to the default-circulation-rules table that contains a patron category.
2. Now add a "Default checkout, hold and return policy" rule.
3. Inspect the "Unset" button:

<a href="#" class="delete-branch-cat btn btn-default btn-xs" data-categorycode="T" data-branch="*"><i class="fa fa-undo"></i> Unset</a>

4. APPLY PATCH and clear browser cache
5. Try again, this time you should be able to delete the rule.

Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Comment 11 holly 2025-11-21 17:41:14 UTC
Workaround until patch is pushed for those who don't want to deal with the inspector:
- Click unset, confirm in dialog box
- Note that the text on the left of the default policies still reads "defaults"
- Click unset again, confirm again
- Ok, now it works

(Looks like the first unset clears the errant patron category, allowing the second unset to actually unset.)