Issue Bug Under Review Quiet

#109139Add validation: starttime and endtime

Aphisit Chanathale 03/03/26, 14:32 updated 10/23/26, 10:50

Description

Steps to reproduce

Log in to the TYPO3 backend.
Open a record that provides time-based access control fields (e.g. a content element or page with starttime and endtime).
In the record form, set the endtime to a date/time before the starttime (e.g. starttime = tomorrow, endtime = yesterday).
Save the record.
View the record in the frontend or check how it is evaluated for visibility.

Current result

The form allows saving inconsistent date values where endtime is earlier than starttime.
There is no validation or error message warning the editor about the incorrect date range.
Records with an endtime before starttime may not be displayed at all, or not at the intended time, leading to unexpected behavior in the frontend.
Editors are not made aware that they have configured an invalid publication period.
Expected result
The system validates the relationship between starttime and endtime before saving the record.
It should not be possible to save a record when endtime is earlier than starttime.
Editors receive a clear, accessible error message indicating that the end time must be equal to or later than the start time.
Only logically consistent date ranges are stored, ensuring that time-based visibility behaves as intended.

Impact

Affects all editors using time-based publication settings (starttime / endtime) for content elements, pages, or other records.
Incorrectly configured date ranges can cause content to never appear, to disappear too early, or to appear at unexpected times.
This leads to inconsistent content delivery and may have business or legal implications if time-critical content is not shown as planned (e.g. campaigns, announcements, legal notices).
From a usability and robustness perspective, the lack of validation undermines trust in the scheduling feature and increases the likelihood of configuration errors.

Definition of done

A validation is implemented that checks starttime and endtime before saving:
If endtime < starttime, the record is not saved and an appropriate error is shown.
The error message is clearly worded and accessible (e.g. exposed to assistive technologies and associated with the affected fields).
The validation applies consistently to all relevant record types using starttime and endtime.
Tested with different date/time combinations (including edge cases) to ensure correct behavior and no false positives.
No regressions in existing time-based publication behavior for valid date ranges.

Acceptance criteria

When endtime is earlier than starttime, the save operation is blocked.
An editor-visible error message is displayed, e.g. “End time must be later than or equal to start time.”
The error message is announced by screen readers and correctly associated with the starttime/endtime fields.
Valid configurations (endtime equal to or later than starttime) can be saved without errors and behave as expected in the frontend.
The validation works across all record types that use starttime and endtime.
QA / accessibility review confirms that the behavior is clear, predictable, and robust for all users.

Reviews 1

History 312