Bug 35307

Summary: Expired holds are missing an input, so updating holds causes loss of data
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Hold requestsAssignee: Bugs List <koha-bugs>
Status: Pushed to stable --- QA Contact: Testopia <testopia>
Severity: critical    
Priority: P5 - low CC: david, f.demians, fridolin.somers, gmcharlt, kebliss, victor
Version: 23.05Keywords: rel_22_11_candidate
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35306
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.06,22.11.13
Attachments: Bug 35307: Add a hidden input for expired holds
Bug 35307: Add a hidden input for expired holds
Bug 35307: Add a hidden input for expired holds

Description Nick Clemens (kidclamp) 2023-11-09 21:25:15 UTC
In 23.05 when viewing a list of holds expired holds show as 'Expired: mm/dd/yyyy'

The table is a form, and when submitted, these expired rows have no input - so the array of expiration dates fetched is out of sync and rows after an expired hold can have dates set incorrectly.

To test:
1 - Place 3 holds on a bib, each for a different patron
2 - IN the db, set the first hold to be expired:
    UPDATE reserves SET expirationdate='2023-01-01' WHERE reserve_id=1;
3 - Refresh the holds page for the biblio
4 - Note the first hold now says 'Expired' in the expiration date column
5 - Set an expiration date for the last hold
6 - Click 'Update holds'
7 - Note the date is applied to the second hold
Comment 1 Nick Clemens (kidclamp) 2023-11-13 16:04:23 UTC
Created attachment 158888 [details] [review]
Bug 35307: Add a hidden input for expired holds

To test:
 1 - Place 3 holds on a bib, each for a different patron
 2 - IN the db, set the first hold to be expired:
    UPDATE reserves SET expirationdate='2023-01-01' WHERE reserve_id=1;
 3 - Refresh the holds page for the biblio
 4 - Note the first hold now says 'Expired' in the expiration date column
 5 - Set an expiration date for the last hold
 6 - Click 'Update holds'
 7 - Note the date is applied to the second hold
 8 - Delete the holds
 9 - Apply patch
10 - Repeat 1-6
11 - Confirm only the correct hold is updated
Comment 2 David Nind 2023-11-14 23:13:08 UTC
Created attachment 158957 [details] [review]
Bug 35307: Add a hidden input for expired holds

To test:
 1 - Place 3 holds on a bib, each for a different patron
 2 - IN the db, set the first hold to be expired:
    UPDATE reserves SET expirationdate='2023-01-01' WHERE reserve_id=1;
 3 - Refresh the holds page for the biblio
 4 - Note the first hold now says 'Expired' in the expiration date column
 5 - Set an expiration date for the last hold
 6 - Click 'Update holds'
 7 - Note the date is applied to the second hold
 8 - Delete the holds
 9 - Apply patch
10 - Repeat 1-6
11 - Confirm only the correct hold is updated

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2023-11-14 23:20:10 UTC
Can confirm that this is not an issues on master, and that the patch fixes the issue on 23.05.x.
Comment 4 Victor Grousset/tuxayo 2023-11-15 20:01:17 UTC
Created attachment 159006 [details] [review]
Bug 35307: Add a hidden input for expired holds

To test:
 1 - Place 3 holds on a bib, each for a different patron
 2 - IN the db, set the first hold to be expired:
    UPDATE reserves SET expirationdate='2023-01-01' WHERE reserve_id=1;
 3 - Refresh the holds page for the biblio
 4 - Note the first hold now says 'Expired' in the expiration date column
 5 - Set an expiration date for the last hold
 6 - Click 'Update holds'
 7 - Note the date is applied to the second hold
 8 - Delete the holds
 9 - Apply patch
10 - Repeat 1-6
11 - Confirm only the correct hold is updated

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 5 Victor Grousset/tuxayo 2023-11-15 20:19:26 UTC
Thanks David for double checking master/main

Bug affects 22.11.x but not 22.05.x
Comment 6 Victor Grousset/tuxayo 2023-11-15 20:19:47 UTC
Works, makes sense, QA script happy, code looks good, passing QA :)
Comment 7 Fridolin Somers 2023-11-17 07:32:04 UTC
Pushed to 23.05.x for 23.05.06
Comment 8 Frédéric Demians 2023-12-18 10:13:31 UTC
Pushed to 22.11.x for 22.11.13