Project

General

Profile

Actions

Bug #85726

closed

Preview of page not working when publish date is set

Added by Marieke de Bruin over 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2018-08-02
Due date:
% Done:

100%

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

Description

It's not possible to preview a page if the publish date is set in the future.
You will get a 404 page with a message like this

The CMS isn't able to fetch the requested page /index.php?id=1&ADMCMD_simTime=1533393060 at this moment.

This is both for editors and admins.

Way to reproduce
Create a page and set a pubish date in the future. Press save and view page.

Environment
TYPO3 8.7.18


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #86653: Preview of page, with "show", not working when starttime is setClosed2018-10-14

Actions
Actions #1

Updated by Stephan Auer over 5 years ago

I can reproduce it too.
Interesting thing - with Version 8.7.9 the preview is working. So maybe a "fix" after that version was resulting into that issue.

UPDATE: At 8.7.9 there is some Snippet at sysext/frontend/Classes/View/AdminPanelView.php#89 where the admPanel is listening at GP['ADMCMD_simTime']
It seems like this was kicked in later 8.7 LTS Versions - and also in 9.4 there is no occurrence for "ADMCMD_simTime" in the code (reading). So maybe this is a feature? :-P

Actions #2

Updated by David Hoeckele over 5 years ago

seems to be related with this issue: https://forge.typo3.org/issues/66793

Actions #3

Updated by Riccardo De Contardi over 5 years ago

It seems still broken in 8.7.19 but working on the latest master 9.5.1-dev. Can someone confirm?

Actions #4

Updated by Riccardo De Contardi over 5 years ago

  • Category set to Frontend
Actions #5

Updated by Susanne Moog over 5 years ago

  • Status changed from New to Needs Feedback

I cannot reproduce this on current 8-branch anymore - can you still reproduce it?

My steps:
- Create a page with a content element
- Set publish date for page in the future
- click "view page"

Result: Preview marker on the top right frontend page and page is displayed, no errors.

Actions #6

Updated by Steffen Mächtel over 5 years ago

I have the same problem.

The Preview dont works on pages with start time.

TYPO3 8.7.19

I can see that the timestamp witch will added to the URL "ADMCMD_simTime=" is 1 hour to small. If i change this value manuel, then the preview works.

To test this from Typo3 backend, i changed the value in class TYPO3\CMS\Backend\Utility\BackendUtility in line 4921:

+3600 added to starttime

$simTime = '&ADMCMD_simTime=' . ($pageInfo['starttime'] + 3600);

--------------------------- UPDATE: ---------------------------

the timestamp added to "ADMCMD_simTime=" looks fine. The Problem starts in TypoScriptFrontendController.

$simTime -= date('Z', $simTime);

This line removes 1 hour in my case :-( When i remove this line for tests. The preview from Backend ("Show") works.

My timezone is Europe/Berlin.

--------------------------- UPDATE 2: ---------------------------

i have tested this with TYPO3 9.5.0 and its not working too.

see new created issue https://forge.typo3.org/issues/86653

Actions #7

Updated by Riccardo De Contardi over 5 years ago

  • Related to Bug #86653: Preview of page, with "show", not working when starttime is set added
Actions #8

Updated by Gerrit Code Review over 5 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59066

Actions #9

Updated by Steffen Mächtel over 5 years ago

Problem:

The AdminPanel preview input field handles timestamp different to
"page show".
  • The page "starttime" is safed in database in current server timezone.
  • The AdminPanel uses UTC for preview, wich is adjusted later in
    the TypoScriptFrontendController to server timezone.
  • The query parameter ADMCMD_simTime from "page show" use the database
    value without adjustments (server timezone). This value is also be
    adjusted in TypoScriptFrontendController. But it was already in
    server timezone.

The patch change ADMCMD_simTime query parameter also to UTC like
AdminPanel.

Current handling:

Startdate: 00:00 15-02-2019

Database: 1550185200 => Server Timezone (In this case Europe/Berlin)
AdminPanel: 1550188800 => UTC
Page show: 1550185200 => Server Timezone (In this case Europe/Berlin)

With patch applied:

Startdate: 00:00 15-02-2019

Database: 1550185200 => Server Timezone (In this case Europe/Berlin)
AdminPanel: 1550188800 => UTC
Page show: 1550188800 => UTC

Actions #10

Updated by Tymoteusz Motylewski over 5 years ago

@Steffen, is the fix for master (v9) the same/similar to v8? Then the patch needs to be pushed first to master branch and then it will be backported to v8

Actions #11

Updated by Steffen Mächtel over 5 years ago

I think for v9 there need to be more/different changes. Becouse in v9 the adminpanel dont handles ADMCMD_simTime query parameter at all.
I have already created a new issue for that: https://forge.typo3.org/issues/86653

Actions #12

Updated by Steffen Mächtel almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #13

Updated by Romain Tiger over 4 years ago

Hi ! I tested this patch and it works fine on typo3 v8 but only for admin account.
With non-admin account, I get the parent page rendered (instead of 404 before applying the patch)

Is there a solution for that bug ?

Actions #14

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF