Bug 36466 - Incorrect date value stored when "Published on" or "Expected on" are empty
Summary: Incorrect date value stored when "Published on" or "Expected on" are empty
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Hammat wele
QA Contact: Testopia
URL:
Keywords: rel_22_11_candidate, rel_23_05_candidate, rel_23_11_candidate, rel_24_05_candidate
Depends on:
Blocks:
 
Reported: 2024-03-29 21:14 UTC by Hammat wele
Modified: 2024-05-17 09:51 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 33039: Incorrect date value stored when 'Published on' or 'Expected on' are empty (2.11 KB, patch)
2024-03-29 21:35 UTC, Hammat wele
Details | Diff | Splinter Review
Bug 36466: Incorrect date value stored when 'Published on' or 'Expected on' are empty (2.06 KB, patch)
2024-03-29 21:53 UTC, Hammat wele
Details | Diff | Splinter Review
Bug 36466: (follow-up) Adding atomicupdate file to fix 0000-00-00 in serial table (1.25 KB, patch)
2024-03-29 22:15 UTC, Hammat wele
Details | Diff | Splinter Review
Bug 36466: Incorrect date value stored when 'Published on' or 'Expected on' are empty (2.13 KB, patch)
2024-04-02 11:20 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36466: (follow-up) Adding atomicupdate file to fix 0000-00-00 in serial table (1.30 KB, patch)
2024-04-02 11:20 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36466: Incorrect date value stored when 'Published on' or 'Expected on' are empty (2.19 KB, patch)
2024-04-03 07:19 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 36466: (follow-up) Adding atomicupdate file to fix 0000-00-00 in serial table (1.37 KB, patch)
2024-04-03 07:20 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 36466: Incorrect date value stored when 'Published on' or 'Expected on' are empty (2.24 KB, patch)
2024-05-10 18:49 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 36466: (follow-up) Adding atomicupdate file to fix 0000-00-00 in serial table (1.46 KB, patch)
2024-05-10 18:49 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Hammat wele 2024-03-29 21:14:48 UTC
When we edit a serial and we leave the date fields ("Published on" or "Expected on") empty 
incorrect date are saved in the database 0000-00-00 instade of current date and we get Error 500


to reproduce 
1. Connect to staff interface 
2. Go to Serials and create a new subscription 
3. Click on Serial collection in the left menu (and note the Subscription numnber)
4. Select a serial to edit and Click on «Edit serials»
5. In the Serial edition form, delete «Published on > and « Expected on » dates and save 
 ----> Error 500 page is displayed 
6. Check the value of «Published on > and « Expected on » dates  in the database
    select planneddate,publisheddate from serial where subscriptionid=<Subscription numnber in step 3>;
    ------> planneddate publisheddate have «0000-00-00» value
Comment 1 Hammat wele 2024-03-29 21:35:43 UTC Comment hidden (obsolete)
Comment 2 Hammat wele 2024-03-29 21:53:37 UTC
Created attachment 164155 [details] [review]
Bug 36466: Incorrect date value stored when 'Published on' or 'Expected on' are empty

When we edit a serial and we leave the date fields ('Published on' or 'Expected on') empty
incorrect date are saved in the database 0000-00-00 instade of current date and we get Error 500

to reproduce
1. Connect to staff interface
2. Go to Serials and create a new subscription
3. Click on Serial collection in the left menu (and note the Subscription numnber)
4. Select a serial to edit and Click on «Edit serials»
5. In the Serial edition form, delete «Published on > and « Expected on » dates and save
 ----> Error 500 page is displayed
6. Check the value of «Published on > and « Expected on » dates  in the database
    select planneddate,publisheddate from serial where subscriptionid=<Subscription numnber in step 3>;
    ------> planneddate publisheddate have «0000-00-00» value
7. Apply the patch
8. repeat step 2, 3, 4, 5, 6
 ----->  Error 500 page is no more displayed
 -----> «Published on » and « Expected on » field have today date
Comment 3 Hammat wele 2024-03-29 22:15:14 UTC
Created attachment 164156 [details] [review]
Bug 36466: (follow-up) Adding atomicupdate file to fix 0000-00-00 in serial table
Comment 4 Owen Leonard 2024-04-02 11:20:50 UTC
Created attachment 164254 [details] [review]
Bug 36466: Incorrect date value stored when 'Published on' or 'Expected on' are empty

When we edit a serial and we leave the date fields ('Published on' or
'Expected on') empty incorrect date are saved in the database 0000-00-00
instade of current date and we get Error 500

to reproduce
1. Connect to staff interface
2. Go to Serials and create a new subscription
3. Click on Serial collection in the left menu (and note the
   Subscription numnber)
4. Select a serial to edit and Click on «Edit serials»
5. In the Serial edition form, delete «Published on > and « Expected on
   » dates and save
    ----> Error 500 page is displayed
6. Check the value of «Published on > and « Expected on » dates  in the
   database
   select planneddate,publisheddate from serial where
   subscriptionid=<Subscription numnber in step 3>;
    ------> planneddate publisheddate have «0000-00-00» value
7. Apply the patch
8. repeat step 2, 3, 4, 5, 6
   ----->  Error 500 page is no more displayed
   -----> «Published on » and « Expected on » field have today date

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 5 Owen Leonard 2024-04-02 11:20:53 UTC
Created attachment 164255 [details] [review]
Bug 36466: (follow-up) Adding atomicupdate file to fix 0000-00-00 in serial table

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Emmi Takkinen 2024-04-03 07:19:59 UTC
Created attachment 164306 [details] [review]
Bug 36466: Incorrect date value stored when 'Published on' or 'Expected on' are empty

When we edit a serial and we leave the date fields ('Published on' or
'Expected on') empty incorrect date are saved in the database 0000-00-00
instade of current date and we get Error 500

to reproduce
1. Connect to staff interface
2. Go to Serials and create a new subscription
3. Click on Serial collection in the left menu (and note the
   Subscription numnber)
4. Select a serial to edit and Click on «Edit serials»
5. In the Serial edition form, delete «Published on > and « Expected on
   » dates and save
    ----> Error 500 page is displayed
6. Check the value of «Published on > and « Expected on » dates  in the
   database
   select planneddate,publisheddate from serial where
   subscriptionid=<Subscription numnber in step 3>;
    ------> planneddate publisheddate have «0000-00-00» value
7. Apply the patch
8. repeat step 2, 3, 4, 5, 6
   ----->  Error 500 page is no more displayed
   -----> «Published on » and « Expected on » field have today date

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Comment 7 Emmi Takkinen 2024-04-03 07:20:33 UTC
Created attachment 164307 [details] [review]
Bug 36466: (follow-up) Adding atomicupdate file to fix 0000-00-00 in serial table

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Comment 8 Nick Clemens (kidclamp) 2024-05-10 18:49:04 UTC
Created attachment 166601 [details] [review]
Bug 36466: Incorrect date value stored when 'Published on' or 'Expected on' are empty

When we edit a serial and we leave the date fields ('Published on' or
'Expected on') empty incorrect date are saved in the database 0000-00-00
instade of current date and we get Error 500

to reproduce
1. Connect to staff interface
2. Go to Serials and create a new subscription
3. Click on Serial collection in the left menu (and note the
   Subscription numnber)
4. Select a serial to edit and Click on «Edit serials»
5. In the Serial edition form, delete «Published on > and « Expected on
   » dates and save
    ----> Error 500 page is displayed
6. Check the value of «Published on > and « Expected on » dates  in the
   database
   select planneddate,publisheddate from serial where
   subscriptionid=<Subscription numnber in step 3>;
    ------> planneddate publisheddate have «0000-00-00» value
7. Apply the patch
8. repeat step 2, 3, 4, 5, 6
   ----->  Error 500 page is no more displayed
   -----> «Published on » and « Expected on » field have today date

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 9 Nick Clemens (kidclamp) 2024-05-10 18:49:06 UTC
Created attachment 166602 [details] [review]
Bug 36466: (follow-up) Adding atomicupdate file to fix 0000-00-00 in serial table

WNC amended patch - tidied

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 10 Nick Clemens (kidclamp) 2024-05-10 18:50:19 UTC
Moving from enhancement

Passing QA, but leaving a question for RM:
The atomicupdate sets the dates to NULL, which is valid
The code now sets blank dates to TODAY - is this correct? Or should it just be NULL?
Comment 11 Katrin Fischer 2024-05-14 13:23:02 UTC
I am really interested in this one since we have been seeing issues with dates in subscriptions ourselves since the last update (flatpickr), but I need a little bit longer to test here.
Comment 12 Katrin Fischer 2024-05-17 09:51:44 UTC
I can confirm that we have been seeing these issues especially with "irregular" patterns where the next issue date is empty and should be empty in 22.11. 
We have quite an issue there right now as libraries are forced to set the "next issue publication" date to work around the error 500.
 
(In reply to Nick Clemens (kidclamp) from comment #10)
> Moving from enhancement
> 
> Passing QA, but leaving a question for RM:
> The atomicupdate sets the dates to NULL, which is valid
> The code now sets blank dates to TODAY - is this correct? Or should it just
> be NULL?

I believe at least for the irregular patterns this doesn't feel correct. We want to have the published and expected dates as NULL for these.

The database update looks correct to me.

Could we get a tiny follow-up here if you agree?