Project

General

Profile

Actions

Bug #102602

closed

Time input does not initialize 00:00 properly

Added by Imko Schumacher 12 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Start date:
2023-12-04
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
13
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

The time input does not properly load the time 00:00. When the field is required, it is marked as error after reloading the record.
This prevents a valid record to be saved.

Steps to reproduce

  1. Create record in the backend
  2. Set time to 00:00
  3. Save form

Results

  • Expected result: Input has the time 00:00
  • Actual result: the input is unset and the input field has an error (since required)

TCA

    'columns' => [
        'mytime' => [
            'label' => 'mytime',
            'config' => [
                'type' => 'datetime',
                'format' => 'time',
                'default' => 0,
                'required' => true,
                'nullable' => false,
            ],
        ],
    ],

Cause

This bug was introduced in TYPO3 v12. In previous version, the time was set to 00:00.

It was introduced by the change https://review.typo3.org/c/Packages/TYPO3.CMS/+/79793

Possible fixes

This bug could be fixed in one of these places by removing the equals 0 checks
a) Form/Element/DatetimeElement
b) TypeScript/backend/form-engine-validation.ts

I think the better place is a), since all times are then returned as 1970-01-01T00:00:00Z. Whereas now, 0 is the exception.


Files

time-after-save.png (1.96 KB) time-after-save.png Imko Schumacher, 2023-12-04 19:28
set-time-0000.png (1.79 KB) set-time-0000.png Imko Schumacher, 2023-12-04 19:28

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #101258: FormEngine date field doesn't accept 00:00 01-01-1970Closed2023-07-06

Actions
Actions

Also available in: Atom PDF