Page 2 of 2

Re: Date type custom field with default value

Posted: 19 Sep 2017, 22:44
by atrol
The problem occurs as there are still ´NULL´ strings in mantis_history_table.

Re: Date type custom field with default value

Posted: 22 Sep 2017, 12:19
by shanthini.g
Thanks this is resolved. :)

Re: Date type custom field with default value

Posted: 12 Feb 2021, 18:17
by mos
I know this is an old thread, but I'm faced with a similar issue after updating to the latest version.
We have a custom date field which is somehow causing us trouble now, which worked in the past.
the date field is empty by default and is optional.

Code: Select all

date(): Argument #2 ($timestamp) must be of type ?int, string given
C:\inetpub\wwwroot\mantisbt-2.24.4\core\date_api.php: 241: - - - - date( <string>'Y-m-d', <string>'' )
C:\inetpub\wwwroot\mantisbt-2.24.4\core\cfdefs\cfdef_standard.php: 500: - - - - print_date_selection_set( <string>'custom_field_12', <string>'Y-m-d', <string>'', <boolean>false, <boolean>true, <integer>0, <integer>0, <string>'input-sm', <string>'' )
C:\inetpub\wwwroot\mantisbt-2.24.4\core\custom_field_api.php: 1429: - - - - cfdef_input_date( <array> { ['id'] => '12', ['name'] => 'Start of Development/Fixing', ['type'] => '8', ['possible_values'] => '', ['default_value'] => '', ['valid_regexp'] => '', ['access_level_r'] => '55', ['access_level_rw'] => '55', ['length_min'] => '0', ['length_max'] => '0', ['require_report'] => '0', ['require_update'] => '0', ['display_report'] => '0', ['display_update'] => '1', ['require_resolved'] => '0', ['display_resolved'] => '0', ['display_closed'] => '0', ['require_closed'] => '0', ['filter_by'] => '1', ['linked_projects'] => <array> { [0] => 1, [1] => 2, [2] => 3, [3] => 4, [4] => 5, [5] => 6, [6] => 7, [7] => 8, [8] => 12, [9] => 15, [10] => 19, [11] => 32, [12] => 42 } }, <string>'', <string>'' )
C:\inetpub\wwwroot\mantisbt-2.24.4\bug_update_page.php: 713: - - - - print_custom_field_input( <array> { ['id'] => '12', ['name'] => 'Start of Development/Fixing', ['type'] => '8', ['possible_values'] => '', ['default_value'] => '', ['valid_regexp'] => '', ['access_level_r'] => '55', ['access_level_rw'] => '55', ['length_min'] => '0', ['length_max'] => '0', ['require_report'] => '0', ['require_update'] => '0', ['display_report'] => '0', ['display_update'] => '1', ['require_resolved'] => '0', ['display_resolved'] => '0', ['display_closed'] => '0', ['require_closed'] => '0', ['filter_by'] => '1', ['linked_projects'] => <array> { [0] => 1, [1] => 2, [2] => 3, [3] => 4, [4] => 5, [5] => 6, [6] => 7, [7] => 8, [8] => 12, [9] => 15, [10] => 19, [11] => 32, [12] => 42 } }, <integer>6014, <string>'0' )

Any help would be appreciated

Re: Date type custom field with default value

Posted: 05 Mar 2021, 18:07
by jmsoupeaux
Bonjour,
je viens de faire un upgrade de la version 1.2.15 vers une version 2.24.4 et j'ai le même plantage.
je crée une fiche la mise à jour se fait bien et lorsque je passe en modification je ne change rien, à la validation j'ai le message suivant :

date(): Argument #2 ($timestamp) must be of type ?int, string given
C:\inetpub\wwwroot\mantisbtprod-new\core\date_api.php: 242: - - - - date()
C:\inetpub\wwwroot\mantisbtprod-new\core\cfdefs\cfdef_standard.php: 500: - - - - print_date_selection_set()
C:\inetpub\wwwroot\mantisbtprod-new\core\custom_field_api.php: 1429: - - - - cfdef_input_date()
C:\inetpub\wwwroot\mantisbtprod-new\bug_update_page.php: 713: - - - - print_custom_field_input()

config :
PHP 8.0.2
Mantisbt 2.24.4
MySQL 8.0.22

Re: Date type custom field with default value

Posted: 06 Mar 2021, 08:10
by cas
Upgrade tp 2.24.5 , there they fixed in an issue with date custom fields :mrgreen:

Re: Date type custom field with default value

Posted: 06 Mar 2021, 10:41
by atrol
jmsoupeaux wrote: 05 Mar 2021, 18:07 PHP 8.0.2
Using PHP 7.x should also fix the issue and maybe even some more PHP 8 related issues.

Re: Date type custom field with default value

Posted: 06 Mar 2021, 13:44
by mos
I figured it out, the old database had empty entries for the custom date for each issue.
I simply removed the empty values and the issue was gone.

Re: Date type custom field with default value

Posted: 17 Mar 2021, 11:24
by jmsoupeaux
Thank you for your help.

I have resolved my problem in post https://www.mantisbt.org/forums/viewtop ... 593#p71593