Skip to content
Snippets Groups Projects
Commit b3326bd0 authored by Imko Schumacher's avatar Imko Schumacher Committed by Benjamin Franzke
Browse files

[BUGFIX] Fix initialization of 00:00 time input

The value of the `time` input is sent as an ISO date to the
FormEngine, except for the time "00:00", which is just submitted
as "0".

This has lead to the input field not getting populated by
the JavaScript initialization, and the input "00:00" was lost.

In cases where such a `time` input is set as a required
field, the validation would then fail because of the field
getting interpreted as being empty/unset.

With this patch, a "0" value is also interpreted as a valid
"1970-01-01T00:00:00+00:00" string, that is parseable by
FormEngine. Note this only affects display within the
FormEngine; the format of the stored data is not changed
(converted by DataHandler to proper values and covered by
existing tests).

IMPORTANT: This only applies to NULLABLE time|timesec
inputs. Only for this configuration it is possible to
decide, that a stored "0" value in the database is
actually "00:00" and not an unset entry.

Integrators/developers need to set 'nullable'
TCA key to 'true' of the corresponding 'config' array,
in case they want to make a time/timesec input picker
be able to store and retrieve "00:00" as a valid
timestamp.

Resolves: #102602
Releases: main, 12.4
Change-Id: Id5dae6564a5da9ab3abd99bdc14b718cc7064464
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82093


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarBenjamin Franzke <ben@bnf.dev>
Reviewed-by: default avatarGarvin Hicking <gh@faktor-e.de>
Tested-by: default avatarGarvin Hicking <gh@faktor-e.de>
Reviewed-by: default avatarBenjamin Franzke <ben@bnf.dev>
parent 2e5bde6f
Branches
Tags
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment