Bug 35957 - Does Serial module still allow saving 0000-00-00 in database?
Summary: Does Serial module still allow saving 0000-00-00 in database?
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-31 12:53 UTC by Marcel de Rooy
Modified: 2024-09-13 07:23 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2024-01-31 12:53:58 UTC
Seeing two issues in 22.11 with invalid/empty date fields:

[1] Exception 'Koha::Exceptions::WrongParameter' thrown 'Invalid date '00-1-11-30' passed to output_pref'
Crash in output_pref comes from serials/subscription-add.pl line 405
    $nextacquidate = $nextacquidate
        ? output_pref( { str => $nextacquidate, dateonly => 1, dateformat => 'iso' } )
        : $firstacquidate;
So it received a 0000-00-00.

[2] Receive step on serial collection. Save issue without filling dates:
|     9531 |       156662 |            318 | No. 12    | 11          | 0           | 0           |      1 | 0000-00-00  |       | 0000-00-00    |                   | NULL       |            0 | NULL         |
Planned and publisheddate were NULL but are now 0000-00-00.

Did not check master. Probably still the same?
Comment 1 Katrin Fischer 2024-09-13 07:23:25 UTC
We have seen the same issue in our databases. About 140 subscriptions were broken that way in one database alone.

We have a similar problem with the OPAC self registration:
Bug 36488 - Flatpickr creates invalid date entries

One thing we have been pondering is if it has to do with the mysql-strict-mode and that being a reason why we have not been able to reproduce the problem in development environments. (unconfirmed)

I'd really love to see this fixed as it creates bad errors for the libraries in the GUI.