Project

General

Profile

Actions

Bug #92987

open

Preview of page from docheader button shows root page when starttime is set

Added by André Buchmann over 3 years ago. Updated over 1 year ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2018-10-15
Due date:
2018-10-15 (over 5 years late)
% Done:

0%

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

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


Related issues 3 (1 open2 closed)

Related to TYPO3 Core - Bug #92944: Preview links are broken for pages with start or end date if outside current dateClosed2020-11-27

Actions
Related to TYPO3 Core - Story #101564: User Interface related translation issuesNew2023-08-03

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

Actions
Actions #1

Updated by André Buchmann over 3 years ago

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

Updated by André Buchmann over 3 years ago

  • Related to deleted (Bug #86653: Preview of page, with "show", not working when starttime is set)
Actions #3

Updated by André Buchmann over 3 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
Actions #4

Updated by André Buchmann over 3 years ago

  • File deleted (Bildschirmfoto 2020-12-04 um 13.00.53.png)
Actions #6

Updated by Riccardo De Contardi over 3 years ago

I can confirm it with 11.0.0-dev (latest master)

Actions #7

Updated by Riccardo De Contardi over 3 years ago

  • Category set to Backend User Interface
Actions #8

Updated by Dennis Prinse over 3 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.

Actions #9

Updated by André Buchmann almost 3 years ago

  • Related to Bug #92944: Preview links are broken for pages with start or end date if outside current date added
Actions #10

Updated by André Buchmann almost 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.

Example:
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
Actions #11

Updated by Joey Bouten over 1 year 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;
    }

Actions #12

Updated by Astrid Haubold 6 months ago

  • Related to Story #101564: User Interface related translation issues added
Actions

Also available in: Atom PDF