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. run ./installer/data/mysql/updatedatabase.pl
9. repeat step 2, 3, 4, 5, 6
   ----->  Error 500 page is no more displayed
   -----> «Published on » and « Expected on » field have NULL as value

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Hammat Wele 2025-11-19 14:15:04 +00:00 committed by Lucas Gass
parent b190813020
commit cbdd895dbf
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 2 additions and 2 deletions

View File

@ -209,10 +209,10 @@ if ( $op and $op eq 'cud-serialchangestatus' ) {
my ( $plan_date, $pub_date );
if ( defined $planneddates[$i] && $planneddates[$i] ne 'XXX' ) {
$plan_date = $planneddates[$i];
$plan_date = $planneddates[$i] || $today;
}
if ( defined $publisheddates[$i] && $publisheddates[$i] ne 'XXX' ) {
$pub_date = $publisheddates[$i];
$pub_date = $publisheddates[$i] || $today;
}
if ( $serialids[$i] && $serialids[$i] eq 'NEW' ) {