Project

General

Profile

Actions

Bug #87949

closed

Upgrade v8 LTS to v9 LTS - PopulatePageSlugs Update not work with Workspaces

Added by Markus Pircher over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Target version:
Start date:
2019-03-19
Due date:
% Done:

100%

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

Description

trace:

(1/1) #1534710048 TYPO3\CMS\Core\Exception\SiteNotFoundException
No pseudo-site found in root line of page 1386

in /public/typo3/sysext/core/Classes/Site/PseudoSiteFinder.php line 179

at TYPO3\CMS\Core\Site\PseudoSiteFinder->getSiteByPageId(1386, array(array('pid' => -1, 'uid' => 1386, 't3ver_oid' => 148, 't3ver_wsid' => 0, 't3ver_state' => 0, 'title' => '', 'alias' => '', 'nav_title' => '', 'media' => '', 'layout' => 1, 'hidden' => 0, 'starttime' => 0, 'endtime' => 0, 'fe_group' => '', 'extendToSubpages' => 0, 'doktype' => 1, 'TSconfig' => null, 'tsconfig_includes' => null, 'is_siteroot' => 0, 'mount_pid' => 0, 'mount_pid_ol' => 0, 'fe_login_mode' => 0, 'backend_layout_next_level' => '')))
in /public/typo3/sysext/core/Classes/Routing/SiteMatcher.php line 210

at TYPO3\CMS\Core\Routing\SiteMatcher->matchByPageId(1386)
in /public/typo3/sysext/core/Classes/DataHandling/SlugHelper.php line 290

at TYPO3\CMS\Core\DataHandling\SlugHelper->isUniqueInSite('/page-title', object(TYPO3\CMS\Core\DataHandling\Model\RecordState))
in /public/typo3/sysext/install/Classes/Updates/PopulatePageSlugs.php line 172

at TYPO3\CMS\Install\Updates\PopulatePageSlugs->populateSlugs()
in /public/typo3/sysext/install/Classes/Updates/PopulatePageSlugs.php line 99

at TYPO3\CMS\Install\Updates\PopulatePageSlugs->executeUpdate()
in /public/typo3/sysext/install/Classes/Service/UpgradeWizardsService.php line 397

at TYPO3\CMS\Install\Service\UpgradeWizardsService->executeWizard('pagesSlugs')
in /public/typo3/sysext/install/Classes/Controller/UpgradeController.php line 967

at TYPO3\CMS\Install\Controller\UpgradeController->upgradeWizardsExecuteAction(object(TYPO3\CMS\Core\Http\ServerRequest))
in /public/typo3/sysext/install/Classes/Http/RequestHandler.php line 205

at TYPO3\CMS\Install\Http\RequestHandler->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /public/typo3/sysext/install/Classes/Http/Application.php line 65

at TYPO3\CMS\Install\Http\Application->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /public/typo3/sysext/core/Classes/Http/AbstractApplication.php line 110

at TYPO3\CMS\Core\Http\AbstractApplication->run()
in /public/typo3/install.php line 104

at {closure}()
in /public/typo3/install.php line 105

Actions #1

Updated by Benni Mack over 5 years ago

This is somehow related to https://review.typo3.org/c/Packages/TYPO3.CMS/+/59955 and

Where you need a matchbyPageId() and need to put in the online version of the record in.

Actions #2

Updated by Markus Pircher over 5 years ago

It works if i changed TYPO3\CMS\Install\Updates\PopulatePageSlugs->populateSlugs()
I add $liveRecordId;

while ($record = $statement->fetch()) {
            $recordId = (int)$record['uid'];
            $liveRecordId = $recordId;
            $pid = (int)$record['pid'];
            $languageId = (int)$record['sys_language_uid'];
            $pageIdInDefaultLanguage = $languageId > 0 ? (int)$record['l10n_parent'] : $recordId;
            $slug = $suggestedSlugs[$pageIdInDefaultLanguage][$languageId] ?? '';

            // see if an alias field was used, then let's build a slug out of that.
            if (!empty($record['alias'])) {
                $slug = $slugHelper->sanitize('/' . $record['alias']);
            }

            if (empty($slug)) {
                if ($pid === -1) {
                    $queryBuilder = $connection->createQueryBuilder();
                    $queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
                    $liveVersion = $queryBuilder
                        ->select('pid')
                        ->from('pages')
                        ->where(
                            $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($record['t3ver_oid'], \PDO::PARAM_INT))
                        )->execute()->fetch();
                    $pid = (int)$liveVersion['pid'];
                    $liveRecordId = (int)$liveVersion['uid'];
                }
                $slug = $slugHelper->generate($record, $pid);
            }

            $state = RecordStateFactory::forName($this->table)
                ->fromArray($record, $pid, $liveRecordId);
            if ($hasToBeUniqueInSite && !$slugHelper->isUniqueInSite($slug, $state)) {
                $slug = $slugHelper->buildSlugForUniqueInSite($slug, $state);
            }
            if ($hasToBeUniqueInPid && !$slugHelper->isUniqueInPid($slug, $state)) {
                $slug = $slugHelper->buildSlugForUniqueInPid($slug, $state);
            }

            $connection->update(
                $this->table,
                [$this->fieldName => $slug],
                ['uid' => $recordId]
            );
        }
Actions #3

Updated by Gerrit Code Review over 5 years ago

  • Status changed from New to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60500

Actions #4

Updated by Oliver Hader over 5 years ago

That's (from my POV) how it should behave - according changes and tests still missing.

--- a/typo3/sysext/core/Classes/DataHandling/Model/RecordState.php
+++ b/typo3/sysext/core/Classes/DataHandling/Model/RecordState.php
@@ -174,23 +174,27 @@ class RecordState
      * the `pid` of the current subject.
      *
      * Example:
-     * + pages: uid: 10, pid: 5, sys_language_uid: 0, l10n_parent: 0  -> returns 10
-     * + pages: uid: 11, pid: 5, sys_language_uid: 1, l10n_parent: 10 -> returns 10
-     * + other: uid: 12, pid: 10 -> returns 10
+     * + pages: uid: 10, pid:  5, sys_language_uid: 0, l10n_parent:  0, t3ver_oid:  0 -> returns 10
+     * + pages: uid: 11, pid:  5, sys_language_uid: 1, l10n_parent: 10, t3ver_oid:  0 -> returns 10
+     * + pages: uid: 12, pid: -1, sys_language_uid: 0, l10n_parent:  0, t3ver_oid: 10 -> returns 10
+     * + pages: uid: 13, pid: -1, sys_language_uid: 1, l10n_parent: 12, t3ver_oid: 11 -> returns 10
+     * + other: uid: 21, pid: 10, t3ver_oid: 0  -> returns 10
+     * + other: uid: 22, pid: -1, t3ver_oid: 21 -> returns 10
      *
      * @return string
      */
     public function resolveNodeAggregateIdentifier(): string
     {
Actions #5

Updated by Gerrit Code Review over 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60500

Actions #6

Updated by Benni Mack over 5 years ago

  • Target version changed from Candidate for patchlevel to next-patchlevel
Actions #7

Updated by Gerrit Code Review over 5 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60626

Actions #8

Updated by Benni Mack over 5 years ago

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

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF