Project

General

Profile

Actions

Bug #99847

closed

Null value for time field is ignored in BE

Added by JAKOTA Design Group GmbH over 1 year ago. Updated 11 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
-
Start date:
2023-02-06
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

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


Related issues 4 (3 open1 closed)

Related to TYPO3 Core - Bug #97216: Time value "midnight" (00:00) is not acceptedClosed2022-03-21

Actions
Related to TYPO3 Core - Bug #98252: TCA Default value for times cannot be setNew2022-09-02

Actions
Related to TYPO3 Core - Bug #100649: Extbase DataMapper doesn't respect datetime when 0 or 0000-00-00 or 0000-00-00 00:00:00 or 00:00:00New2023-04-18

Actions
Related to TYPO3 Core - Bug #92900: Unable to store "epoch start" on native datetime fields with dbtypeUnder Review2020-11-21

Actions
Actions

Also available in: Atom PDF