Bug #85726
closedPreview of page not working when publish date is set
Added by Marieke de Bruin over 6 years ago. Updated almost 5 years ago.
100%
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
Updated by Stephan Auer over 6 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
Updated by David Hoeckele over 6 years ago
seems to be related with this issue: https://forge.typo3.org/issues/66793
Updated by Riccardo De Contardi about 6 years ago
It seems still broken in 8.7.19 but working on the latest master 9.5.1-dev. Can someone confirm?
Updated by Susanne Moog about 6 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.
Updated by Steffen Mächtel about 6 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
Updated by Riccardo De Contardi about 6 years ago
- Related to Bug #86653: Preview of page, with "show", not working when starttime is set added
Updated by Gerrit Code Review almost 6 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
Updated by Steffen Mächtel almost 6 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
Updated by Tymoteusz Motylewski almost 6 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
Updated by Steffen Mächtel almost 6 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
Updated by Steffen Mächtel over 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset b2cbbaae2667a64db72b5688f7164b4fd943cfad.
Updated by Romain Tiger about 5 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 ?
Updated by Benni Mack almost 5 years ago
- Status changed from Resolved to Closed