Issue Bug Closed

#99847Null value for time field is ignored in BE

JAKOTA Design Group GmbH 02/06/23, 15:52 updated 07/09/24, 12:46

Description

Hi,

Following the example for building a time picker

https://docs.typo3.org/m/typo3/reference-tca/11.5/en-us/ColumnsConfig/Type/Input/DateTime/Properties/DbType.html

I’ve done this:

    'start_time' => [
      'exclude' => true,
      'l10n_mode' => 'exclude',
      'l10n_display' => 'defaultAsReadonly',
      'label' => 'Start time',
      'config' => [
        'type' => 'input',
        'renderType' => 'inputDateTime',
        'dbType' => 'time',
        'size' => 4,
        'disableAgeDisplay' => true,
        'eval' => 'time,null',
        'default' => null,
      ],
    ],
CREATE TABLE tx_myext_domain_model_thing (
  start_time time default NULL,
);

and it work fine.

But if the field value in the DB is null the “Set value” checkbox should not be set automatically.

And another thing even if the checkbox for “Set value” is set and the field value in the backend is 00:00 the value in the DB is not changed from null to 00:00

This makes it hard to determine if no value is set or the time is 00:00.

Thanks

Reviews 3