#111215Datetime fields with allowLanguageSynchronization stay disabled after switching to "Custom value"
Description
Problem
In a translated record, a field of type datetime with 'behaviour' => ['allowLanguageSynchronization' => true] cannot be edited after switching the localization state from “Value of default language” to “Custom value”. The date input stays greyed out. This affects e.g. pages.starttime and pages.endtime of translated pages for all users, including admins.
Workaround for editors: select “Custom value”, save the record, then the field is editable after reload.
Steps to reproduce
- Create a page in the default language and translate it.
- Edit the translated page, open tab “Access”.
- “Start” is set to “Value of default language” and is disabled (correct).
- Select “Custom value” for “Start”.
Expected: the date field becomes editable.
*Actual:* the date field stays disabled.
Cause
LocalizationStateSelector (backend/form-engine/field-wizard/localization-state-selector.ts) toggles disabled only on the first element with [data-formengine-input-name] in the field item. For datetime fields this is the original input that flatpickr turns into a hidden input. The visible input is flatpickr’s altInput ([data-formengine-datepicker-real-input-name]), which is neither enabled/disabled nor updated with the new value.
Related problem: raw timestamp as original language value
LocalizationStateSelector.php writes the raw database value of the default language row into data-original-language-value (e.g. 1766530860). When switching back to “Value of default language”, the TypeScript sets this raw timestamp as input value and dispatches change. FormEngineValidation then throws:
Error: Invalid ISO8601 DateTime string: 1766530860
at FormEngineValidation.formatValue
As a result the submitted hidden field is not updated. When switching to “Custom value” again (which starts with the default language value), the displayed date and the submitted value can differ.
Suggested fix
- TypeScript: after changing
input.disabled/input.value, sync the flatpickr instance (input._flatpickr): setaltInput.disabledand callsetDate()/clear()with the new value. - PHP: for datetime fields, render
data-original-language-valuein the same ISO 8601 format the datetime element uses for its own value, instead of the raw timestamp. That avoids the validation error and keeps the server’s time zone handling (converting the timestamp in the browser would use the browser’s time zone).
Environment
- Reproduced on TYPO3 14.3.8 and 12.4.50 (ELTS), Chromium.
- The relevant code is unchanged in 13.4, 14.3 and main:
localization-state-selector.tsonly toggles the first[data-formengine-input-name], the datetime picker still uses flatpickr withaltInput: true, andLocalizationStateSelector.phpstill renders the raw database value intodata-original-language-value.
Reviews 1
Related issues 2
History 3
-
Thorsten Schramm changed Related to #87858 <span data-processor="relativetime" data-value="2026-10-23T12:12:02+00:00" > 10/23/26, 12:12 </span>
-
Benni Mack changed Related to #107024 <span data-processor="relativetime" data-value="2026-11-19T17:23:52+00:00" > 11/19/26, 17:23 </span>
-
Benni Mack commented and changed status
NewClosed <span data-processor="relativetime" data-value="2026-11-19T17:25:03+00:00" > 11/19/26, 17:25 </span>
Closing as a duplicate of #107024