Bug 29073 - Hold expiration added to new holds when DefaultHoldExpirationdate turned off
Summary: Hold expiration added to new holds when DefaultHoldExpirationdate turned off
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on: 26498
Blocks:
  Show dependency treegraph
 
Reported: 2021-09-21 15:15 UTC by Andrew Fuerste-Henry
Modified: 2021-10-09 02:16 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05


Attachments
Bug 29073: Use 0 and 1 as values for DefaultHoldExpirationdate (2.49 KB, patch)
2021-09-21 15:28 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 29073: Use 0 and 1 as values for DefaultHoldExpirationdate (2.55 KB, patch)
2021-09-21 15:34 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 29073: Use 0 and 1 as values for DefaultHoldExpirationdate (2.62 KB, patch)
2021-09-24 15:16 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 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