#62739ReadOnly DateTime fields are broken in Backend Forms
Description
When a table has a configuration for a column to be readOnly and eval as datetime, the backend form generated a PHP Warning and shows no form:
$columns['activated_on'] = array(
'exclude' => 1,
'label' => 'LLL:EXT:sf_register/Resources/Private/Language/locallang_be.xml:fe_users.activated_on',
'config' => array(
'type' => 'input',
'readOnly' => TRUE,
'eval' => 'datetime',
)
);
#1: PHP Warning: date() expects parameter 2 to be long, string given in typo3/sysext/backend/Classes/Form/FormEngine.php line 3583
This happens because the FormEngine class tries to render the field and the value for a new field is the empty string:
TYPO3\CMS\Backend\Form\FormEngine:1503
This could be solved, if the itemFormElValue is cast to an integer, if a datetime format is detected.
You could also argue, that this is a misconfiguration in TCA, because adding ‘default’ => 0 also solves the problem:
$columns['activated_on'] = array(
'exclude' => 1,
'label' => 'LLL:EXT:sf_register/Resources/Private/Language/locallang_be.xml:fe_users.activated_on',
'config' => array(
'type' => 'input',
'readOnly' => TRUE,
'eval' => 'datetime',
'default' => 0,
)
);Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.