Skip to content

Commit

Permalink
[BUGFIX] Simulate time ignored using Admin Panel
Browse files Browse the repository at this point in the history
Fixes ignoring selected Simulate time in frontend admin panel and correctly showing the Preview Info
  • Loading branch information
lsascha committed Jun 25, 2020
1 parent 8cb2b24 commit 59c23fd
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -53,7 +53,6 @@ public function __construct()
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
if ((bool)$this->context->getPropertyFromAspect('backend.user', 'isLoggedIn', false)) {
$GLOBALS['TSFE']->clear_preview();
$simulatingDate = $this->simulateDate($request);
$simulatingGroup = $this->simulateUserGroup($request);
$GLOBALS['TSFE']->fePreview = ((int)($simulatingDate || $simulatingGroup));
Expand All @@ -78,6 +77,9 @@ protected function simulateDate(ServerRequestInterface $request): bool
{
$simulatedDate = null;
$queryTime = $request->getQueryParams()['ADMCMD_simTime'] ?? false;
if ($queryTime === false && $GLOBALS['SIM_ACCESS_TIME'] !== $GLOBALS['ACCESS_TIME']) {
$queryTime = $GLOBALS['SIM_ACCESS_TIME'];
}
if (!$queryTime) {
return false;
}
Expand Down

0 comments on commit 59c23fd

Please sign in to comment.