Project

General

Profile

Actions

Bug #91206

closed

PDOException "You cannot serialize or unserialize PDOStatement instances" in PopulatePageSlugs wizard

Added by Stephan Großberndt over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2020-04-27
Due date:
% Done:

100%

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

Description

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:


(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);
    }

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 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)
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()

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #89830: Avoid resolving default value of static property in ClassSchemaClosed2019-12-03

Actions
Related to TYPO3 Core - Task #90104: Introduce prepared statement for BackendUtility::getPageForRootlineClosedMarkus Klein2020-01-13

Actions
Related to TYPO3 Core - Bug #90535: 10.3.0 throws PHP Warning: mysqli_stmt::bind_param(): Couldn't fetch mysqli_stmt in /vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php line 236Closed2020-02-25

Actions
Actions #1

Updated by Stephan Großberndt over 4 years ago

  • Related to Bug #89830: Avoid resolving default value of static property in ClassSchema added
Actions #2

Updated by Stephan Großberndt over 4 years ago

  • Description updated (diff)
Actions #3

Updated by Markus Klein over 4 years ago

  • Status changed from New to Needs Feedback

What's the configuration of your runtime cache?

NOTE: It MUST have a TransientMemoryBackend!

Actions #4

Updated by Markus Klein over 4 years ago

  • Related to Task #90104: Introduce prepared statement for BackendUtility::getPageForRootline added
Actions #5

Updated by Markus Klein over 4 years ago

  • Related to Bug #90535: 10.3.0 throws PHP Warning: mysqli_stmt::bind_param(): Couldn't fetch mysqli_stmt in /vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php line 236 added
Actions #6

Updated by Markus Klein over 4 years ago

Seems to be a duplicate of #90535.

Actions #7

Updated by Markus Klein over 4 years ago

  • Status changed from Needs Feedback to Accepted

The install tool uses a failsafe version of Bootstrap and hence no caches. That means runtime-cache is set to a NullBackend and the upgrade wizard fails thereby.

Actions #8

Updated by Gerrit Code Review over 4 years ago

  • Status changed from Accepted to Under Review

Patch set 1 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/+/64320

Actions #9

Updated by Gerrit Code Review over 4 years ago

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/+/64320

Actions #10

Updated by Gerrit Code Review over 4 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/+/64320

Actions #11

Updated by Gerrit Code Review over 4 years ago

Patch set 4 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/+/64320

Actions #12

Updated by Gerrit Code Review over 4 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/+/64286

Actions #13

Updated by Stephan Großberndt over 4 years ago

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

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF