Bug 37183 - Serials batch edit changes the expiration date to TODAY
Summary: Serials batch edit changes the expiration date to TODAY
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: Main
Hardware: All All
: P5 - low blocker
Assignee: Chris Cormack
QA Contact: Martin Renvoize
URL:
Keywords: rel_23_11_candidate
Depends on:
Blocks:
 
Reported: 2024-06-25 14:32 UTC by Michaela Sieber
Modified: 2024-07-25 13:33 UTC (History)
4 users (show)

See Also:
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 (2.03 KB, patch)
2024-06-29 22:56 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 37183: Batch edit serial subscriptions sets expiration date to today (2.23 KB, patch)
2024-07-01 03:42 UTC, David Nind
Details | Diff | Splinter Review
Bug 37183: Batch edit serial subscriptions sets expiration date to today (2.30 KB, patch)
2024-07-01 08:26 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 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 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 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 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