View Issue Details

IDProjectCategoryView StatusLast Update
0027928mantisbtcustom fieldspublic2021-03-05 20:11
Reportermidnightltd Assigned Todregad  
PrioritynormalSeverityminorReproducibilitysometimes
Status closedResolutionfixed 
Product Version2.24.4 
Target Version2.24.5Fixed in Version2.24.5 
Summary0027928: Unable to edit Issues having Date custom fields on PHP 8.0
Description

When trying to edit some records not all using PHP 8.0.1 I was receiving and error that a problem occurred.. Log shows these errors

Steps To Reproduce
  • define a date custom field with default value set to empty string
  • link it to project
  • edit issue in that project
TagsPHP 8

Relationships

has duplicate 0027944 closeddregad can not resolve or edit the issue which has customized field 

Activities

midnightltd

midnightltd

2021-01-30 12:00

reporter  

image.png (17,834 bytes)   
image.png (17,834 bytes)   
midnightltd

midnightltd

2021-01-30 12:13

reporter   ~0065047

I was able to roll back to PHP 7.4.14 and it all works.

dregad

dregad

2021-01-30 20:08

developer   ~0065048

To facilitate issue reproduction, can you please provide details about the offending custom field, and the value(s) that are causing the error to occur ?

dregad

dregad

2021-01-31 06:10

developer   ~0065050

Nevermind, I can reproduce the behavior by defining a date custom field with default value set to empty string.

midnightltd

midnightltd

2021-01-31 07:04

reporter   ~0065051

Sorry for not getting back before now. We have 2 custom date fields, one float and 2 string fields and most of the time the fields are blank. We just use them for certain bugs.

image-2.png (22,849 bytes)   
image-2.png (22,849 bytes)   
dregad

dregad

2021-02-15 17:47

developer   ~0065127

PR https://github.com/mantisbt/mantisbt/pull/1739

dregad

dregad

2021-03-05 19:31

developer   ~0065182

Changed target to 2.24.5

Related Changesets

MantisBT: master c09fb41b

2021-01-31 08:41:13

dregad

Details Diff
Fix PHP warning when updating issue with date CF

On PHP 8, when updating an issue in a project where a date custom field
is linked, and the field's value is not set (empty string), Mantis
throws a Warning:

Uncaught TypeError: date(): Argument 0000002 ($timestamp) must be of type
?int, string given

This fixes the issue by setting the date to 0 if it is not numeric,
prior to calling print_date_selection_set().

Fixes 0027928
Affected Issues
0027928
mod - core/cfdefs/cfdef_standard.php Diff File

MantisBT: master-2.24 4aa1c22b

2021-02-21 11:01:57

dregad

Details Diff
Fix PHP warning when updating issue with date CF

On PHP 8, when updating an issue in a project where a date custom field
is linked, and the field's value is not set (empty string), Mantis
throws a Warning:

Uncaught TypeError: date(): Argument 0000002 ($timestamp) must be of type
?int, string given

This fixes the issue by setting the date to 0 if it is not numeric,
prior to calling print_date_selection_set().

Fixes 0027928

(cherry picked from commit c09fb41bf8beae969013029ad0577ab11344e8b1)
Affected Issues
0027928
mod - core/cfdefs/cfdef_standard.php Diff File