#103669Backend Preview of "planned" pages throw 503 on PHP 8.2
Description
It seems like this piece of code in the PreviewSimulator is not “precise” enough for PHP 8.2 and throws a 503 if you try to preview a page from the backend, that has a start date in the future:
protected function simulateDate(ServerRequestInterface $request): bool
{
$queryTime = $request->getQueryParams()['ADMCMD_simTime'] ?? false;
if (!$queryTime) {
return false;
}
$GLOBALS['SIM_EXEC_TIME'] = $queryTime;
$GLOBALS['SIM_ACCESS_TIME'] = $queryTime - $queryTime % 60;
$this->context->setAspect(
'date',
GeneralUtility::makeInstance(
DateTimeAspect::class,
(new \DateTimeImmutable())->setTimestamp($queryTime)
)
);
return true;
}
DateTimeImmutable::setTimestamp(): Argument #1 ($timestamp) must be of type int, string given
Suggest to add a typecast early on to convert $queryTime string to the int it actually is.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 3
-
Johannes Rebhan commented 04/18/24, 18:12
-
Georg Ringer changed Duplicates #103588 04/19/24, 05:46
-
Georg Ringer commented and changed status
NewClosed Tagstype04/19/24, 05:46thanks for creating the issue. this has been solved with #103588 – therefore closing this issue as duplicate
Something like that maybe?