Bug 37183

Summary: Serials batch edit changes the expiration date to TODAY
Product: Koha Reporter: Michaela Sieber <michaela.sieber>
Component: SerialsAssignee: Chris Cormack <chris>
Status: Pushed to oldstable --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: blocker    
Priority: P5 - low CC: clemens.tubach, david, fridolin.somers, lucas, wainuiwitikapark
Version: MainKeywords: rel_23_11_candidate
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35073
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes batch editing of serials and the expiration date. Before this patch, if no date was entered in the expiration date field, it was changed to the current date when the batch edit form was saved. This caused the expiration date to change to the current date for all serials in the batch edit.
Version(s) released in:
24.11.00,24.05.02,23.11.07
Circulation function:
Attachments: Bug 37183 : Batch edit serial subscriptions sets expiration date to today
Bug 37183: Batch edit serial subscriptions sets expiration date to today
Bug 37183: Batch edit serial subscriptions sets expiration date to today

Description Michaela Sieber 2024-06-25 14:32:55 UTC
Severity = Critical as data loss is imminent due to this bug


Serials:
1) Add a new serial, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Put a biblionumber in the 'record' field, i.e. '112'. Press 'next' and click 'ok' on the alert box
3) Fill all the required fields and click 'test prediction'
4) Fill the Subscription end date  (= Expirations Date)
5) Click 'save subscription'. 
6) Repeat steps 1-5 to create a second serial.

Batch edit:
1) Visit serials and hit the 'Search' button:
/cgi-bin/koha/serials/serials-home.pl
2) Click the 2 checkboxes for the 2 serials we created previously and click the new link that pops up 'edit selected serials'.
3) Click 'Save' without changing anything.
4) Go back to either of the serials, notice the value for expiration Date is changed to TODAY (Date of the batch edit). 
Visit: /cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=1
Comment 1 Chris Cormack 2024-06-29 22:56:24 UTC
Created attachment 168299 [details] [review]
Bug 37183 : Batch edit serial subscriptions sets expiration date to today

To test
Serials:
1) Add a new serial, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Put a biblionumber in the 'record' field, i.e. '112'. Press 'next' and click 'ok' on the alert box
3) Fill all the required fields and click 'test prediction'
4) Fill the Subscription end date  (= Expirations Date)
5) Click 'save subscription'.
6) Repeat steps 1-5 to create a second serial.

Batch edit:
1) Visit serials and hit the 'Search' button:
/cgi-bin/koha/serials/serials-home.pl
2) Click the 2 checkboxes for the 2 serials we created previously and click the new link that pops up 'edit selected serials'.
3) Click 'Save' without changing anything.
4) Go back to either of the serials, notice the value for expiration Date is changed to TODAY (Date of the batch edit).

Apply patch and retest note the date only changes if you set it now
Comment 2 David Nind 2024-07-01 03:42:43 UTC
Created attachment 168305 [details] [review]
Bug 37183: Batch edit serial subscriptions sets expiration date to today

Test plan:

Add some serials:
1) Add a new serial, visit:
   /cgi-bin/koha/serials/subscription-add.pl
2) Put a biblionumber in the 'record' field, e.g. '112'.
   Press 'next' and click 'ok' on the alert box.
3) Fill all the required fields and click 'test prediction'.
4) Fill the Subscription end date (= Expiration Date).
5) Click 'save subscription'.
6) Repeat steps 1-5 to create a second serial.

Batch edit serials:
1) Visit serials and hit the 'Search' button:
   /cgi-bin/koha/serials/serials-home.pl
2) Click the 2 checkboxes for the 2 serials we created
   previously and click the new link that pops up
   'Edit selected serials'.
3) Click 'Save' without changing anything.
4) Go back to either of the serials, notice the value
   for Expiration date is changed to TODAY
   (the date of the batch edit).

Apply the patch and retest the batch editing (before
retesting, change the expiration dates of the two
serials back to the original expiration date).

Note that the expiration date now only changes if you
enter a date in the 'Expiration date' field.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Martin Renvoize (ashimema) 2024-07-01 08:26:50 UTC
Created attachment 168307 [details] [review]
Bug 37183: Batch edit serial subscriptions sets expiration date to today

Test plan:

Add some serials:
1) Add a new serial, visit:
   /cgi-bin/koha/serials/subscription-add.pl
2) Put a biblionumber in the 'record' field, e.g. '112'.
   Press 'next' and click 'ok' on the alert box.
3) Fill all the required fields and click 'test prediction'.
4) Fill the Subscription end date (= Expiration Date).
5) Click 'save subscription'.
6) Repeat steps 1-5 to create a second serial.

Batch edit serials:
1) Visit serials and hit the 'Search' button:
   /cgi-bin/koha/serials/serials-home.pl
2) Click the 2 checkboxes for the 2 serials we created
   previously and click the new link that pops up
   'Edit selected serials'.
3) Click 'Save' without changing anything.
4) Go back to either of the serials, notice the value
   for Expiration date is changed to TODAY
   (the date of the batch edit).

Apply the patch and retest the batch editing (before
retesting, change the expiration dates of the two
serials back to the original expiration date).

Note that the expiration date now only changes if you
enter a date in the 'Expiration date' field.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize (ashimema) 2024-07-01 08:27:15 UTC
Thanks for taking this on Chris.

All working as described now.

Passing QA
Comment 5 Katrin Fischer 2024-07-01 16:58:59 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 6 Lucas Gass (lukeg) 2024-07-24 20:14:04 UTC
Backported to 24.04.x for upcoming 24.05.02
Comment 7 Fridolin Somers 2024-07-25 07:55:30 UTC
Pushed to 23.11.x for 23.11.07
Comment 8 Wainui Witika-Park 2024-09-18 03:25:24 UTC
Not backporting to 23.05.x unless requested