Project

General

Profile

Actions

Bug #103690

closed

Preview of page in the past (expired) throws exception

Added by Riccardo De Contardi about 2 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2024-04-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

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


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #103588: PreviewSimulator for time restricted pagesResolved2024-04-10

Actions
Related to TYPO3 Core - Bug #99627: Context:class don't detect timezone correctlyResolved2023-01-19

Actions
Related to TYPO3 Core - Bug #98045: DateAspect->getTimezone (almost) never returns the correct valueResolvedAndreas Wolf2022-07-28

Actions
Actions #1

Updated by Stefan Bürk about 2 months ago

  • Related to Bug #103588: PreviewSimulator for time restricted pages added
  • Related to Bug #99627: Context:class don't detect timezone correctly added
  • Related to Bug #98045: DateAspect->getTimezone (almost) never returns the correct value added
Actions #3

Updated by Stefan Bürk about 2 months ago

  • Status changed from New to Needs Feedback
Actions #4

Updated by Riccardo De Contardi about 2 months ago

  • Status changed from Needs Feedback to Closed

I close this issue in favor of https://forge.typo3.org/issues/103588 - refer to it for the patch.

Thanks to Stefan Bürk for taking care

Actions

Also available in: Atom PDF