Bug 29073

Summary: Hold expiration added to new holds when DefaultHoldExpirationdate turned off
Product: Koha Reporter: Andrew Fuerste-Henry <andrewfh>
Component: Hold requestsAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: fridolin.somers, gmcharlt, kyle, martin.renvoize
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:
21.11.00,21.05.05
Bug Depends on: 26498    
Bug Blocks:    
Attachments: Bug 29073: Use 0 and 1 as values for DefaultHoldExpirationdate
Bug 29073: Use 0 and 1 as values for DefaultHoldExpirationdate
Bug 29073: Use 0 and 1 as values for DefaultHoldExpirationdate

Description Andrew Fuerste-Henry 2021-09-21 15:15:16 UTC
to recreate:
- turn on DefaultHoldExpirationdate, place a hold, confirm it has an expiration date
- turn off DefaultHoldExpirationdate, place a hold, confirm it still has an expirtion date

we're saving "no" rather than 0, which is breaking checks further along.
Comment 1 Nick Clemens 2021-09-21 15:28:15 UTC
Created attachment 125111 [details] [review]
Bug 29073: Use 0 and 1 as values for DefaultHoldExpirationdate

DefaultHldexpirationDate is set in the pref screen to 'yes/no'

The code checks if the preference is 'true', 'no' is true

We should instead use 1/0

To test:
0 - Have a fresh devbox
1 - With syspref disabled, place a hold
2 - Note no expiration date set
3 - Enable the preference
4 - Place a hold and note the expiration date is set, good
5 - Disable the pref
6 - Place a hold and note the expiration date is set, bad
7 - Apply patch
8 - Update database
9 - Repeat 1-8, date not set when pref disabled
Comment 2 Andrew Fuerste-Henry 2021-09-21 15:34:52 UTC
Created attachment 125113 [details] [review]
Bug 29073: Use 0 and 1 as values for DefaultHoldExpirationdate

DefaultHldexpirationDate is set in the pref screen to 'yes/no'

The code checks if the preference is 'true', 'no' is true

We should instead use 1/0

To test:
0 - Have a fresh devbox
1 - With syspref disabled, place a hold
2 - Note no expiration date set
3 - Enable the preference
4 - Place a hold and note the expiration date is set, good
5 - Disable the pref
6 - Place a hold and note the expiration date is set, bad
7 - Apply patch
8 - Update database
9 - Repeat 1-8, date not set when pref disabled

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 3 Martin Renvoize 2021-09-24 15:16:28 UTC
Created attachment 125264 [details] [review]
Bug 29073: Use 0 and 1 as values for DefaultHoldExpirationdate

DefaultHldexpirationDate is set in the pref screen to 'yes/no'

The code checks if the preference is 'true', 'no' is true

We should instead use 1/0

To test:
0 - Have a fresh devbox
1 - With syspref disabled, place a hold
2 - Note no expiration date set
3 - Enable the preference
4 - Place a hold and note the expiration date is set, good
5 - Disable the pref
6 - Place a hold and note the expiration date is set, bad
7 - Apply patch
8 - Update database
9 - Repeat 1-8, date not set when pref disabled

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2021-09-24 15:16:58 UTC
Doh!

Well spotted, Passing QA
Comment 5 Jonathan Druart 2021-09-28 13:40:06 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 6 Kyle M Hall 2021-10-01 18:41:11 UTC
Pushed to 21.05.x for 21.05.05
Comment 7 Fridolin Somers 2021-10-09 02:16:41 UTC
Depends on Bug 26498 not in 20.11.x