Bug 25851

Summary: 19.11 upgrade creates holdallowed rule with empty value
Product: Koha Reporter: Andrew Fuerste-Henry <andrewfh>
Component: CirculationAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: critical    
Priority: P5 - low CC: aleisha, bwsdonna, dcook, gmcharlt, jonathan.druart, kelly, kyle.m.hall, lucas, martin.renvoize, nick
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25859
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25860
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.02
Bug Depends on: 18928    
Bug Blocks:    
Attachments: Bug 25851: (bug 18928 follow-up) Remove holdallowed rule is value is an empty string
Bug 25851: (bug 18928 follow-up) Remove holdallowed rule is value is an empty string
Bug 25851: (bug 18928 follow-up) Remove holdallowed rule is value is an empty string

Description Andrew Fuerste-Henry 2020-06-23 14:13:52 UTC
As part of bug 18928, we moved rules from default_circ_rules to circulation_rules. In that move, where default_circ_rules.holdallowed was NULL, we created an entry in circulation_rules where rule_name is holdallowed and rule_value is an empty string. This results in holds being blocked because Koha treats an empty string differently than it treats an undefined rule.
Comment 1 Jonathan Druart 2020-06-24 06:47:33 UTC
Created attachment 106218 [details] [review]
Bug 25851: (bug 18928 follow-up) Remove holdallowed rule is value is an empty string

On the interface, if "Hold policy" is "Not set", the rule does not exist
in the table. We should reflect that during the update DB process.

Test plan:
1. Set "Hold policy" to "Not set"
2. Confirm that you can place holds
3. Confirm that the rule does not exist in the DB table
4. Set the value to an empty string (manually)
5. Confirm that you cannot longer place holds
6. Go to the circulation rules page and confirm that the value of "Hold
policy" is "Not set"
7. Execute the update DB entry
8. Confirm that you can place holds
9. Confirm that the rule does not exist in the DB table
Comment 2 Martin Renvoize 2020-06-26 09:52:02 UTC
Created attachment 106324 [details] [review]
Bug 25851: (bug 18928 follow-up) Remove holdallowed rule is value is an empty string

On the interface, if "Hold policy" is "Not set", the rule does not exist
in the table. We should reflect that during the update DB process.

Test plan:
1. Set "Hold policy" to "Not set"
2. Confirm that you can place holds
3. Confirm that the rule does not exist in the DB table
4. Set the value to an empty string (manually)
5. Confirm that you cannot longer place holds
6. Go to the circulation rules page and confirm that the value of "Hold
policy" is "Not set"
7. Execute the update DB entry
8. Confirm that you can place holds
9. Confirm that the rule does not exist in the DB table

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2020-06-26 09:55:00 UTC
Signing off as it works as expected..

However.. should the retrospective correction not bit in the 19.06.00.010 (for bug 18928) as opposed to 19.12.00.018 (which is bug 18936).. or am I missing something here.. I believe Andrew meant updates to 19.11.x break as opposed to upgrades from 19.11.x?

Cheers
Comment 4 Kyle M Hall 2020-06-30 11:44:06 UTC
Created attachment 106431 [details] [review]
Bug 25851: (bug 18928 follow-up) Remove holdallowed rule is value is an empty string

On the interface, if "Hold policy" is "Not set", the rule does not exist
in the table. We should reflect that during the update DB process.

Test plan:
1. Set "Hold policy" to "Not set"
2. Confirm that you can place holds
3. Confirm that the rule does not exist in the DB table
4. Set the value to an empty string (manually)
5. Confirm that you cannot longer place holds
6. Go to the circulation rules page and confirm that the value of "Hold
policy" is "Not set"
7. Execute the update DB entry
8. Confirm that you can place holds
9. Confirm that the rule does not exist in the DB table

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Jonathan Druart 2020-07-09 10:06:06 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 6 Martin Renvoize 2020-07-15 12:13:58 UTC
Looks like the atomicupdate here got left in master.. was that intentional for backports or something Jonathan?
Comment 7 Martin Renvoize 2020-07-16 14:21:33 UTC Comment hidden (obsolete)
Comment 8 Lucas Gass 2020-07-17 19:58:54 UTC
backported to 20.05.x for 20.05.02
Comment 9 Aleisha Amohia 2020-07-19 23:55:49 UTC
This does not apply cleanly to 19.11.x, please fix if needed.