Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.
95488[BUGFIX] Warn about endtime before starttime
Commit message
Test this change
Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch
- Check out patch set 9
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/88/95488/9 && git checkout FETCH_HEAD - Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/88/95488/9 && git cherry-pick FETCH_HEAD
Review
-
Code review CR +1 Needs a vote
- Christian Rath-Ulrich +1
- Matthias Vogel +1
-
Verified V +1 Needs a vote
- Christian Rath-Ulrich +1
- Matthias Vogel +1
- core-ci +1 CI
Issues 1
Files 21
- Build/Sources/TypeScript/backend/tests/form-engine-validation-test.ts+149 −0
- Build/Sources/TypeScript/backend/date-time-picker.ts+19 −2
- Build/Sources/TypeScript/backend/form-engine-validation.ts6+95 −1
- typo3/sysext/backend/Classes/Form/Element/DatetimeElement.php+2 −3
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaDateTimeEnableColumnRange.phpnew+60 −0
- typo3/sysext/backend/Classes/Form/AbstractNode.php4+40 −4
- typo3/sysext/backend/Resources/Public/JavaScript/date-time-picker.js+1 −1
- typo3/sysext/backend/Resources/Public/JavaScript/form-engine-validation.js+1 −1
- typo3/sysext/backend/Tests/Functional/Form/Element/DatetimeElementTest.phpnew+114 −0
- typo3/sysext/backend/Tests/Functional/Form/FormDataProvider/FormDataProviderTest.php+23 −0
- typo3/sysext/backend/Tests/Unit/Form/Element/DatetimeElementTest.php+14 −2
- typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaDateTimeEnableColumnRangeTest.phpnew+155 −0
- typo3/sysext/core/Classes/DataHandling/DataHandler.php4+65 −4
- typo3/sysext/core/Classes/SysLog/Error.php+7 −0
- typo3/sysext/core/Configuration/DefaultConfiguration.php+5 −0
- typo3/sysext/core/Documentation/Changelog/14.3.x/Important-109139-WarnWhenEndtimeIsBeforeStarttime.rstnew+60 −0
- typo3/sysext/core/Resources/Private/Language/locallang_core.xlf+3 −0
- typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/DataSet/TimeRestrictionConsistencyPages.csvnew+3 −0
- typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/Fixtures/TimeRestrictionConsistencyWorkspace.csvnew+10 −0
- typo3/sysext/core/Tests/Functional/DataHandling/DataHandler/TimeRestrictionConsistencyTest.phpnew+318 −0
Review log 2231
Show 46 earlier messages
-
Maike Kiebele uploaded patch set 1 08/31/26, 11:41
-
core-ci voted on patch set 1 V +1 08/31/26, 11:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107421
-
Benni Mack commented on patch set 1 08/31/26, 11:54
-
Maike Kiebele uploaded patch set 2
V +109/01/26, 12:14 -
core-ci voted on patch set 2 V +1 09/01/26, 12:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107486
-
Benni Mack uploaded patch set 3
V +109/03/26, 23:44
-
core-ci voted on patch set 3 V +1 09/03/26, 23:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107787
-
Benni Mack uploaded patch set 4
V +109/04/26, 09:50 -
core-ci voted on patch set 4 V +1 09/04/26, 10:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107849
-
Georg Ringer voted on patch set 4 CR +1 V +1 09/04/26, 11:32
-
Christian Rath-Ulrich uploaded patch set 5
CR +1V +110/21/26, 18:30 -
Christian Rath-Ulrich commented on patch set 5 V +1 10/21/26, 18:32
rebesed and testedDataHandler.php:1077ReplyDone -
core-ci voted on patch set 5 V +1 10/21/26, 18:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112032
-
Oli Bartsch voted on patch set 5 V -1 10/21/26, 19:07
-
Oli Bartsch commented on patch set 5 10/21/26, 19:22
form-engine-validation.ts:78Only `isWithinFieldBoundary` is tested. I would like to see a test for `validateFieldsBoundedBy` too. And maybe even a functional test that copies and localizes a `tt_content` record with endtime < starttime asserting an empty `errorLog`, like the commit message claims.form-engine-validation.ts:301The range check sets `has-error`/`aria-invalid`, so `isValid()` fails and FormEngine refuses to save. This also affects existing records with endtime before starttime, even for unrelated edits. That contradicts the RST "never rejects". So either keep the block and fix the RST and commit message (including the note about existing records), or make the client-side check a non-blocking hint without `errorClass`.form-engine-validation.ts:385The editor never sees why endtime is invalid, and `aria-invalid` ends up on flatpickr's hidden input. Please mirror `aria-invalid` to `altInput` in `date-time-picker.ts` and add a field-level message (e.g. via `aria-describedby`).AbstractNode.php:166`range.lowerField`/`upperField` is effectively a new TCA option that any TCA can set. It is undocumented, and it is exclusive while `range.lower` is inclusive. Please keep it internal (a dedicated internal key, and drop the unused `upperField` branch), or document it as a main-only feature.AbstractNode.php:200THis is wrong inside FlexForms, because `FlexFormElementContainer` passes the parent's data on unchanged. The docblock is therefore incorrect too. Please make it `private` and return `''` inside a FlexForm (or derive the name from `elementBaseName`/`itemFormElName`) and adjust the docblock.DataHandler.php:1092In workspaces, `$id` points to the version record, but the fallback values (the date not submitted, the title) come from the live `$currentRecord`. A partial datamap changing only endtime is then compared against the live starttime. Please read the fallbacks from the version row and add a functional workspace test.Important-109139-WarnWhenEndtimeIsBeforeStarttime.rst:1the file belongs in `Changelog/14.3.x/` -
Christian Rath-Ulrich uploaded patch set 6
V +110/22/26, 08:49 -
core-ci voted on patch set 6 V +1 10/22/26, 08:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112078
-
Christian Rath-Ulrich commented on patch set 6 10/22/26, 09:02
form-engine-validation.ts:78ReplyDone. validateFieldsBoundedBy is covered for an end date before the start date, equal to it, after it, and empty. The bounded field in that test has no name, only data-formengine-input-name, as the datetime element does. TimeRestrictionConsistencyTest::copyAndLocalizeKeepAnEmptyErrorLog creates a tt_content record with endtime before starttime, copies it and localizes it, and asserts an empty errorLog both times.form-engine-validation.ts:301ReplyTaken the second option. The sibling check no longer sets has-error, so isValid() stays true and FormEngine still saves. That includes an existing record that already ends before it starts, and an edit that does not touch the two dates. aria-invalid is still set, together with the hint from #385. The changelog now says the same. One sentence in the commit message still says the field is marked invalid. That sentence needs to be aligned on the next amend.form-engine-validation.ts:385ReplyDone. The end date field gets a visible hint, "The end date is at or before the start date, so this record will never be visible.", linked with aria-describedby. date-time-picker.ts copies aria-invalid, aria-describedby and has-error from the hidden input onto altInput, once when the picker is ready and again on t3-formengine-postfieldvalidation.AbstractNode.php:166ReplyKept internal. TcaDateTimeEnableColumnRange writes enablecolumnsRangeLowerField on the field config, outside config.range. range.lowerField is ignored, and the upperField branch is gone. The comparison stays exclusive, unlike the inclusive range.lower and range.upper. There is no new TCA option.AbstractNode.php:200ReplygetFormElementNameForSiblingField() is private and returns an empty string when flexFormFieldName or flexFormContainerFieldName is set, because the parent table, uid and columns are not the FlexForm siblings. The docblock says so. The sibling name is not derived from elementBaseName.DataHandler.php:1092ReplyDone. When the incoming id is the live uid and the write goes to a workspace version, the date that was not submitted and the title are read from that version row (getRecord() with the delete clause disabled). TimeRestrictionConsistencyWorkspaceTest covers both directions: a partial endtime change compared with a later version starttime logs one notice titled with the version record, and a partial change compared with an earlier version starttime logs none.Important-109139-WarnWhenEndtimeIsBeforeStarttime.rst:1ReplyDone -
Matthias Vogel uploaded patch set 7
V +110/22/26, 16:20Use the standard error styling for the end date hint and keep it compact below the field. Keep the hint accessible and non-blocking, including when the start date is read-only. Log DataHandler notices after successful writes using the stored record. Respect values changed by field post-processing hooks and avoid notices for rejected or failed updates. Add regression coverage for read-only and empty boundary values, rejected updates, hook-adjusted dates and database errors. Align the commit message with the final behavior. Rebased onto current main. Validation: 254 PHP unit tests, 31 functional tests and all 344 JavaScript tests passed. The full frontend build, TypeScript, ESLint, CGL, PHP integrity and RST checks also passed. -
core-ci voted on patch set 7 V +1 10/22/26, 16:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112147
-
Matthias Vogel voted on patch set 7 CR +1 V +1 10/22/26, 16:34
-
Simon Schaufelberger commented on patch set 7 CR -1 10/22/26, 18:51
please rebase and resolve the merge conflict -
Matthias Vogel uploaded patch set 8
CR +1V +110/23/26, 09:45 -
Matthias Vogel voted on patch set 8 CR +1 V +1 10/23/26, 09:52
-
core-ci voted on patch set 8 V -1 10/23/26, 10:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112259
-
Matthias Vogel rebased onto patch set 9
CR +1V +110/23/26, 10:50 -
Matthias Vogel voted on patch set 9 CR +1 V +1 10/23/26, 10:51
-
core-ci voted on patch set 9 V +1 10/23/26, 11:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112275
-
Christian Rath-Ulrich voted on patch set 9 CR +1 V +1 10/23/26, 19:05
-
Oli Bartsch commented on patch set 9 11/10/26, 13:39
To me, this patch is far to big for a bugfix, to be backported to v14. Additionally I wonder if instead of adding this special handling into FormEngine, we should better use a new dedicated form field (element) for start/endtime? -
Markus Klein commented on patch set 9 11/10/26, 14:17
Reply Unresolved
I'd even put this up one level and would see this as a feature that extensions may need as well. There are also fields depending on each other: Example an event's begin and end date. So maybe even widen the use-case?
DataHandler.php:1077