Bug #92987
closedPreview of page from docheader button shows root page when starttime is set
Added by André Buchmann almost 4 years ago. Updated 5 months ago.
0%
Description
Description:
When the preview button in the docheader is pressed, not the actual site is shown but the root page. The preview button in the page details or in the page-tree context menu shows the selected page. Buttons on language columns also show the root page.
Failing buttos are red, working buttons are green:
Typo3 Version: 9.5.23 and 10.4.10
To test this:
1. create a page and set starttime to a future date.
2. click on preview button in docheader while in column/language view
Expected result:
See the page content of the selected / current page
What i can see:
The root page is shown with the parameter "?ADMCMD_simTime=123456789"
Files
preview-page-detail-translation_works.png (9.73 KB) preview-page-detail-translation_works.png | André Buchmann, 2020-12-04 12:17 | ||
preview-page-docheader_not-working.png (16.9 KB) preview-page-docheader_not-working.png | André Buchmann, 2020-12-04 12:17 | ||
preview-pagetree-contextmenu_works.png (3.96 KB) preview-pagetree-contextmenu_works.png | André Buchmann, 2020-12-04 12:17 |
Updated by André Buchmann almost 4 years ago
- Related to Bug #86653: Preview of page, with "show", not working when starttime is set added
Updated by André Buchmann almost 4 years ago
- Related to deleted (Bug #86653: Preview of page, with "show", not working when starttime is set)
Updated by André Buchmann almost 4 years ago
- Due date set to 2018-10-15
- Start date changed from 2020-12-04 to 2018-10-15
- Follows Bug #86653: Preview of page, with "show", not working when starttime is set added
Updated by André Buchmann almost 4 years ago
- File deleted (
Bildschirmfoto 2020-12-04 um 13.00.53.png)
Updated by André Buchmann almost 4 years ago
- File preview-page-detail-translation_works.png preview-page-detail-translation_works.png added
- File preview-page-docheader_not-working.png preview-page-docheader_not-working.png added
- File preview-pagetree-contextmenu_works.png preview-pagetree-contextmenu_works.png added
- Description updated (diff)
Updated by Riccardo De Contardi almost 4 years ago
I can confirm it with 11.0.0-dev (latest master)
Updated by Riccardo De Contardi almost 4 years ago
- Category set to Backend User Interface
Updated by Dennis Prinse almost 4 years ago
As I just mentioned at ticket #87759 this is still an issue at TYPO3 v10 and even worse than in TYPO3 v9.
The button in the last screenshot from within the page properties view doesn't work in TYPO3 v10. In TYPO3 v10, users even get send to the homepage using that button. In TYPO3 v9.5.24, the button from within the properties does indeed send users to the correct page and the preview seems to be working as expected by showing the page. And from within the pagetree context menu, the editor gets send to the correct page too.
However in TYPO3 v10.4.12 I can't seem to get the preview working from within the pagetree context menu of manually editing the url, users keep ending up at an error page (404 or 403 for example).
Additional information:
Where the view page module in TYPO3 v9 was working as a workaround too, the view page module in v10 has the same issues as using the docheader buttons and list module where te user is being send to the homepage.
Updated by André Buchmann over 3 years ago
- Related to Bug #92944: Preview links are broken for pages with start or end date if outside current date added
Updated by André Buchmann over 3 years ago
This issue was partially solved with 9.5.25 by the changes made to the PageRepository in #92944 (https://github.com/TYPO3/TYPO3.CMS/commit/8b0e90c9a4)
Improvement
For the default language the right url is now called with the "ADMCMD_simTime" param. This works fine on the server but locally I get 403 "Page Not Found Reason: ID was not an accessible page" (Can be local issue).
Unfixed
Translations work only if they have the exact same slug as the default language.
Default Language | example.com/example-page | should be working |
Translation with modified slug | example.com/de/beispiel-seite | results in 404 error |
Translation with same slug | example.com/fr/example-page | works like default lang |
Updated by Joey Bouten about 2 years ago
- TYPO3 Version changed from 9 to 11
Issue also confirmed in V11.
Adding:
$queryBuilder->getRestrictions()->removeByType(StartTimeRestriction::class);
to the following function in class `typo3/sysext/core/Classes/Domain/Repository/PageRepository.php` fixes it. But this would cause multiple issues ofcourse.
protected function getPageOverlaysForLanguageUids(array $pageUids, array $languageUids): array
{
// Remove default language ("0")
$languageUids = array_filter($languageUids);
$languageField = $GLOBALS['TCA']['pages']['ctrl']['languageField'];
$overlays = [];
foreach ($pageUids as $pageId) {
// Create a map based on the order of values in $languageUids. Those entries reflect the order of the language + fallback chain.
// We can't work with database ordering since there is no common SQL clause to order by e.g. [7, 1, 2].
$orderedListByLanguages = array_flip($languageUids);
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('pages');
$queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class, $this->context));
// Because "fe_group" is an exclude field, so it is synced between overlays, the group restriction is removed for language overlays of pages
$queryBuilder->getRestrictions()->removeByType(FrontendGroupRestriction::class);
$queryBuilder->getRestrictions()->removeByType(StartTimeRestriction::class);
$result = $queryBuilder->select('*')
->from('pages')
->where(
$queryBuilder->expr()->eq(
$GLOBALS['TCA']['pages']['ctrl']['transOrigPointerField'],
$queryBuilder->createNamedParameter($pageId, \PDO::PARAM_INT)
),
$queryBuilder->expr()->in(
$GLOBALS['TCA']['pages']['ctrl']['languageField'],
$queryBuilder->createNamedParameter($languageUids, Connection::PARAM_INT_ARRAY)
)
)
->execute();
// Create a list of rows ordered by values in $languageUids
while ($row = $result->fetch()) {
$orderedListByLanguages[$row[$languageField]] = $row;
}
foreach ($orderedListByLanguages as $languageUid => $row) {
if (!is_array($row)) {
continue;
}
// Found a result for the current language id
$this->versionOL('pages', $row);
if (is_array($row)) {
$row['_PAGES_OVERLAY'] = true;
$row['_PAGES_OVERLAY_UID'] = $row['uid'];
$row['_PAGES_OVERLAY_LANGUAGE'] = $languageUid;
$row['_PAGES_OVERLAY_REQUESTEDLANGUAGE'] = $languageUids[0];
// Unset vital fields that are NOT allowed to be overlaid:
unset($row['uid'], $row['pid']);
$overlays[$pageId] = $row;
// Language fallback found, stop querying further languages
break;
}
}
}
return $overlays;
}
Updated by Astrid Haubold about 1 year ago
- Related to Story #101564: User Interface related translation issues added
Updated by Riccardo De Contardi 5 months ago
- Status changed from New to Needs Feedback
I am not able to reproduce it on version 11,12 and 13. Could you confirm? If still reproducible, could you add a step-by-step guide? Thank you!
Updated by André Buchmann 5 months ago
- Has duplicate Bug #100008: Preview urls of pages with starttime / endtime set are wrong in most places added
Updated by André Buchmann 5 months ago
- Status changed from Needs Feedback to Resolved
@Riccardo De Contardi it has been fixed in TYPO3 v11.5.25 by #100008
Thanks to @Oliver Bartsch