Issue Bug Closed

#103690Preview of page in the past (expired) throws exception

Riccardo De Contardi 04/20/24, 20:56 updated 04/20/24, 21:38

Description

Prerequsites

  • plain TYPO3 12.4.14 installation

steps to reproduce

  1. Create a page, enable it (un-hide), save it
  2. Tab Access > edit Expiration Date [endtime] and set it on a date in the past
  3. save the page and click on the “view” button (or close it and click on the “preview” button)

Expected result

You should see a preview of the page (with the “yellow preview box” on the top right corner)

Actual result:

An exception is thrown

(1/1) TypeError
DateTimeImmutable::setTimestamp(): Argument #1 ($timestamp) must be of type int, string given
        $this->context->setAspect(
            'date',
            GeneralUtility::makeInstance(
                DateTimeAspect::class,
                (new \DateTimeImmutable())->setTimestamp($queryTime)
            )
        );
        return true;
    }

Note: this seems not reproducible on TYPO3 11 or 13 – you see a preview of the page (with the yellow box); it happens only on 12.4.14

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.