Date type custom field with default value
Moderators: Developer, Contributor
-
- Posts: 44
- Joined: 31 May 2017, 12:45
Re: Date type custom field with default value
Thanks this is resolved.
Re: Date type custom field with default value
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.
Any help would be appreciated
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
-
- Posts: 4
- Joined: 26 Feb 2021, 13:59
Re: Date type custom field with default value
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
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
Upgrade tp 2.24.5 , there they fixed in an issue with date custom fields
Re: Date type custom field with default value
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
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.
I simply removed the empty values and the issue was gone.
-
- Posts: 4
- Joined: 26 Feb 2021, 13:59
Re: Date type custom field with default value
Thank you for your help.
I have resolved my problem in post https://www.mantisbt.org/forums/viewtop ... 593#p71593
I have resolved my problem in post https://www.mantisbt.org/forums/viewtop ... 593#p71593