Review 14.3 Merged

95203[BUGFIX] Round simulated preview time up to full minutes

Benni Mack CR +2 V +2 Normal +87 −3 updated 08/10/26, 13:38

Commit message

PreviewUriBuilder::getAdditionalQueryParametersForAccessRestrictedPages()
decides second-exact whether ADMCMD_simTime has to be added, while the
frontend evaluates page visibility against the 'accessTime' of the date
aspect, which has a precision of 60 seconds by design - see
PageRepository::getDefaultConstraints() and
SystemEnvironmentBuilder::initializeGlobalTimeTrackingVariables().

Due to that mismatch both branches fail for a 'starttime' carrying
seconds. With a 'starttime' of 09:13:21:

* At 09:13:45 the condition is false, no ADMCMD_simTime is emitted and
  the frontend compares 09:13:21 <= accessTime (09:13:00). The page is
  not found and the preview ends in a 404 with PAGE_NOT_FOUND.
* At 09:12:00 the condition is true and ADMCMD_simTime=09:13:21 is
  emitted, but PreviewSimulator::simulateDate() derives SIM_ACCESS_TIME
  as $queryTime - $queryTime % 60, which is 09:13:00 again and still
  below 'starttime' - a 404 as well.

The branch meant to compensate for a 'starttime' in the future can
therefore not succeed at all while the value carries seconds; the
preview only starts working once the clock passes 09:14:00. Editors hit
this without a way to see why, since 'starttime' is declared
format=datetime, whose picker neither displays nor allows editing
seconds, while its "Today" shortcut stores the live wall-clock second.

The simulated time is now rounded up to the first full minute the record
is live at. That is a no-op for every record with starttime % 60 === 0,
which is everything that works today, and no stored data is touched. The
'endtime' branch needs no adjustment: flooring endtime - 1 still
satisfies the endtime > accessTime constraint. The workspaces preview
uses the same method and benefits alike.

Functional tests are added for both failure modes, for the cases that
behave unchanged and for the 'endtime' branch, none of which had
coverage before.

This patch was created with the support of coding agents.

Review

  • Code review CR +2 Done
    • Benni Mack +2
  • Verified V +2 Done
    • Benni Mack +2
    • core-ci +1 CI

Issues 1

Files 2

Review log 34

  1. Benni Mack commented on patch set 1 08/10/26, 13:20

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 08/10/26, 13:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106283

  3. Benni Mack voted on patch set 1 CR +2 V +2 08/10/26, 13:38

  4. Benni Mack merged patch set 2 08/10/26, 13:38