Bug 36708 - Problems editing circ rules when 'Holds allowed (total)' value is greater than or equal to 0
Summary: Problems editing circ rules when 'Holds allowed (total)' value is greater tha...
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Lucas Gass
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on: 35341
Blocks:
  Show dependency treegraph
 
Reported: 2024-04-26 14:02 UTC by Sara Brown
Modified: 2024-05-23 14:39 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.06,23.05.12


Attachments
Bug 36708: Fix column index for processing No automatic renewal after (1.88 KB, patch)
2024-04-29 15:20 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 36708: Fix column index for processing No automatic renewal after (1.94 KB, patch)
2024-05-06 15:06 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 36708: Fix column index for processing No automatic renewal after (2.00 KB, patch)
2024-05-13 10:15 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Sara Brown 2024-04-26 14:02:30 UTC
If I edit a circulation rule with a value of 0 or higher in the 'Holds allowed (total)' column, Koha is populating the 'No automatic renewal after (hard limit)' with a date when it was/should remain blank for editing. Also, the value in 'Holds allowed (total)' isn't populating in the editing line.

To replicate:
-Find or create a circulation rule with a 'Holds allowed (total)' limit of 3 (or another number) and no value in 'No automatic renewal after (hard limit)'
-Select to edit the rule, and note that 'No automatic renewal after (hard limit)' box in the editing line is now populated with a date
-Note also that 'Holds allowed (total)' is empty in your editing line
-If you save your edits without clearing the new 'No automatic renewal after (hard limit)' date, it will save as part of the rule. Also, 'Holds allowed (total)' will save as Unlimited unless you re-add your numerical value. 

This happened when I tested with multiple numbers including 0.
Comment 1 Catrina Berka 2024-04-26 21:36:36 UTC
I can replicate this on 23.05.10 but not on 23.11.03 so this may have been resolved elsewhere?
Comment 2 Catrina Berka 2024-04-26 21:36:36 UTC
I can replicate this on 23.05.10 but not on 23.11.03 so this may have been resolved elsewhere?
Comment 3 Lucas Gass 2024-04-29 15:15:31 UTC
This is a 23.05.x regression caused by Bug 35341. It is that plus the fact that Bug 8367 ( which added an extra column ) was not backported to 23.05.x that is causing this.
Comment 4 Lucas Gass 2024-04-29 15:20:35 UTC
Created attachment 165749 [details] [review]
Bug 36708: Fix column index for processing No automatic renewal after

To test:
1- Find or create a circulation rule with a 'Holds allowed (total)' limit of 3 (or another number) and no value in 'No automatic renewal after (hard limit)'
2- Select to edit the rule, and note that 'No automatic renewal after (hard limit)' box in the editing line is now populated with a date
3- Note also that 'Holds allowed (total)' is empty in your editing line
4- If you save your edits without clearing the new 'No automatic renewal after (hard limit)' date, it will save as part of the rule. Also, 'Holds allowed (total)' will save as Unlimited unless you re-add your numerical value.
5- APPLY PATCH
6- Try again, the values should save corrected and not erroneously fill the No automatic renewal after (hard limit) column.
Comment 5 Andrew Fuerste-Henry 2024-05-06 15:06:47 UTC
Created attachment 166232 [details] [review]
Bug 36708: Fix column index for processing No automatic renewal after

To test:
1- Find or create a circulation rule with a 'Holds allowed (total)' limit of 3 (or another number) and no value in 'No automatic renewal after (hard limit)'
2- Select to edit the rule, and note that 'No automatic renewal after (hard limit)' box in the editing line is now populated with a date
3- Note also that 'Holds allowed (total)' is empty in your editing line
4- If you save your edits without clearing the new 'No automatic renewal after (hard limit)' date, it will save as part of the rule. Also, 'Holds allowed (total)' will save as Unlimited unless you re-add your numerical value.
5- APPLY PATCH
6- Try again, the values should save corrected and not erroneously fill the No automatic renewal after (hard limit) column.

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Comment 6 Martin Renvoize 2024-05-13 10:15:08 UTC
Created attachment 166622 [details] [review]
Bug 36708: Fix column index for processing No automatic renewal after

To test:
1- Find or create a circulation rule with a 'Holds allowed (total)' limit of 3 (or another number) and no value in 'No automatic renewal after (hard limit)'
2- Select to edit the rule, and note that 'No automatic renewal after (hard limit)' box in the editing line is now populated with a date
3- Note also that 'Holds allowed (total)' is empty in your editing line
4- If you save your edits without clearing the new 'No automatic renewal after (hard limit)' date, it will save as part of the rule. Also, 'Holds allowed (total)' will save as Unlimited unless you re-add your numerical value.
5- APPLY PATCH
6- Try again, the values should save corrected and not erroneously fill the No automatic renewal after (hard limit) column.

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2024-05-13 10:15:26 UTC
Good catch and fix, thanks.

Passing QA
Comment 8 Katrin Fischer 2024-05-14 13:12:39 UTC
I wonder if this will always work - we should not using the index numbers but an identifier. We do now have some columns in this table where the visibility depends on system preferences (like UseRecalls)
Comment 9 Katrin Fischer 2024-05-14 13:35:19 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 10 Fridolin Somers 2024-05-22 12:58:47 UTC
Pushed to 23.11.x for 23.11.06
Comment 11 Lucas Gass 2024-05-23 14:39:51 UTC
Backported to 23.05.x for upcoming 23.05.12