Project

General

Profile

Bug #91206

Updated by Stephan Großberndt almost 4 years ago

When upgrading to TYPO3 9.5 on a PostgreSQL instance and running the upgrade wizard @Introduce URL parts ("slugs") to all existing pages@ an exception is thrown: 

 <pre> 

 
 (1/1) PDOException 

 You cannot serialize or unserialize PDOStatement instances 
 in /typo3_src-9.5.15/typo3/sysext/core/Classes/Cache/Frontend/VariableFrontend.php line 59 

             ]; 
             GeneralUtility::callUserFunction($_funcRef, $params, $this); 
         } 
         if (!$this->backend instanceof TransientBackendInterface) { 
             $variable = serialize($variable); 
         } 
         $this->backend->set($entryIdentifier, $variable, $tags, $lifetime); 
     } 

 at PDOStatement->__sleep() 
 at serialize(object(TYPO3\CMS\Core\Database\Driver\PDOStatement)) 
 in /typo3_src-9.5.15/typo3/sysext/core/Classes/Cache/Frontend/VariableFrontend.php line 59 

             ]; 
             GeneralUtility::callUserFunction($_funcRef, $params, $this); 
         } 
         if (!$this->backend instanceof TransientBackendInterface) { 
             $variable = serialize($variable); 
         } 
         $this->backend->set($entryIdentifier, $variable, $tags, $lifetime); 
     } </pre> 

 at TYPO3\CMS\Core\Cache\Frontend\VariableFrontend->set('getPageForRootlineStatement-93b379c58d60ba9d2216897c8cdb066d', object(TYPO3\CMS\Core\Database\Driver\PDOStatement)) 
 in /typo3_src-9.5.15/typo3/sysext/backend/Classes/Utility/BackendUtility.php line 497 

                         $queryBuilder->expr()->eq('uid', $queryBuilder->createPositionalParameter($uid, \PDO::PARAM_INT)), 
                         QueryHelper::stripLogicalOperatorPrefix($clause) 
                     ); 
                 $statement = $queryBuilder->execute(); 
                 $runtimeCache->set('getPageForRootlineStatement-' . $statementCacheIdent, $statement); 
             } else { 
                 $statement->bindValue(1, (int)$uid); 
                 $statement->execute(); 
             } 

 at TYPO3\CMS\Backend\Utility\BackendUtility::getPageForRootline(1, '', true, array('nav_title')) 
 in /typo3_src-9.5.15/typo3/sysext/backend/Classes/Utility/BackendUtility.php line 389 

             $loopCheck = 100; 
             $theRowArray = []; 
             while ($uid != 0 && $loopCheck) { 
                 $loopCheck--; 
                 $row = self::getPageForRootline($uid, $clause, $workspaceOL, $additionalFields); 
                 if (is_array($row)) { 
                     $uid = $row['pid']; 
                     $theRowArray[] = $row; 
                 } else { 

 at TYPO3\CMS\Backend\Utility\BackendUtility::BEgetRootLine(1, '', true, array('nav_title')) 
 in /typo3_src-9.5.15/typo3/sysext/core/Classes/DataHandling/SlugHelper.php line 588 

      */ 
     protected function resolveParentPageRecord(int $pid, int $languageId): ?array 
     { 
         $parentPageRecord = null; 
         $rootLine = BackendUtility::BEgetRootLine($pid, '', true, ['nav_title']); 
         do { 
             $parentPageRecord = array_shift($rootLine); 
             // do not use spacers (199), recyclers and folders and everything else 
         } while (!empty($rootLine) && (int)$parentPageRecord['doktype'] >= 199); 

 at TYPO3\CMS\Core\DataHandling\SlugHelper->resolveParentPageRecord(1, 0) 
 in /typo3_src-9.5.15/typo3/sysext/core/Classes/DataHandling/SlugHelper.php line 166 

         $prefix = ''; 
         if ($this->configuration['generatorOptions']['prefixParentPageSlug'] ?? false) { 
             $languageFieldName = $GLOBALS['TCA'][$this->tableName]['ctrl']['languageField'] ?? null; 
             $languageId = (int)($recordData[$languageFieldName] ?? 0); 
             $parentPageRecord = $this->resolveParentPageRecord($pid, $languageId); 
             if (is_array($parentPageRecord)) { 
                 // If the parent page has This seems to be a slug, use that instead of "re-generating" the slug from the parents' page title 
                 if (!empty($parentPageRecord['slug'])) { 
                     $rootLineItemSlug = $parentPageRecord['slug']; 

 at TYPO3\CMS\Core\DataHandling\SlugHelper->generate(array('uid' => 64, 'pid' => 1, 't3ver_oid' => 0, 't3ver_id' => 0, 't3ver_wsid' => 0, 't3ver_label' => '', 't3ver_state' => 0, 't3ver_stage' => 0, 't3ver_count' => 0, 't3ver_tstamp' => 0, 't3ver_move_id' => 0, 't3_origuid' => 0, 'tstamp' => 1562246581, 'sorting' => 768, 'deleted' => 0, 'perms_userid' => 1, 'perms_groupid' => 1, 'perms_user' => 31, 'perms_group' => 31, 'perms_everybody' => 0, 'editlock' => 0, 'crdate' => 1561988574, 'cruser_id' => 1, 'hidden' => 0, 'title' => 'Login', 'doktype' => 1, 'TSconfig' => null, 'is_siteroot' => 0, 'php_tree_stop' => 0, 'url' => '', 'starttime' => 0, 'endtime' => 0, 'urltype' => 1, 'shortcut' => 0, 'shortcut_mode' => 0, 'no_cache' => 0, 'fe_group' => '', 'subtitle' => '', 'layout' => 0, 'target' => '', 'media' => 0, 'lastUpdated' => 0, 'keywords' => null, 'cache_timeout' => 0, 'cache_tags' => '', 'newUntil' => 0, 'description' => null, 'no_search' => 0, 'SYS_LASTCHANGED' => 1562246581, 'abstract' => null, 'module' => '', 'extendToSubpages' => 0, 'author' => '', 'author_email' => '', 'nav_title' => '', 'nav_hide' => 0, 'content_from_pid' => 0, 'mount_pid' => 0, 'mount_pid_ol' => 0, 'alias' => '', 'l18n_cfg' => 0, 'fe_login_mode' => 0, 'backend_layout' => '', 'backend_layout_next_level' => '', 'tsconfig_includes' => null, 'categories' => 0, 'tx_realurl_pathsegment' => '', 'tx_realurl_pathoverride' => 0, 'tx_realurl_exclude' => 0, 'tx_realurl_nocache' => 0, 'nav_icon' => 0, 'thumbnail' => 0, 'rowDescription' => null, 'sys_language_uid' => 0, 'l10n_parent' => 0, 'l10n_source' => 0, 'l10n_state' => null, 'l10n_diffsource' => null, 'slug' => null, 'legacy_overlay_uid' => 0), 1) 
 very similar issue to #89830 which solved this in /typo3_src-9.5.15/typo3/sysext/install/Classes/Updates/PopulatePageSlugs.php line 169 

                             $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($record['t3ver_oid'], \PDO::PARAM_INT)) 
                         )->execute()->fetch(); 
                     $pid = (int)$liveVersion['pid']; 
                 } 
                 $slug = $slugHelper->generate($record, $pid); 
             } 

             $state = RecordStateFactory::forName($this->table) 
                 ->fromArray($record, $pid, $recordId); 

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

      * @return bool Whether everything went smoothly or not 
      */ 
     public function executeUpdate(): bool 
     { 
         $this->populateSlugs(); 
         return true; 
     } 

     /** 

 at TYPO3\CMS\Install\Updates\PopulatePageSlugs->executeUpdate() 
 </pre> 
 TYPO3v10 only: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62518

Back