Issue Bug Closed

#89291Regression in RelationHandler due to Doctrine DBAL migration

Benni Mack 09/27/19, 11:07 updated 12/23/19, 22:42

Description

The Doctrine DBAL migration code had the following change in RelationHandler->purgeDeletePlaceholder()

Before

        $versions = $this->getDatabaseConnection()->exec_SELECTgetRows(
            'uid,t3ver_oid,t3ver_state',
            $tableName,
            'pid=-1 AND t3ver_oid IN (' . implode(',', $ids) . ') AND t3ver_wsid=' . $this->getWorkspaceId() .
                ' AND t3ver_state=' . VersionState::cast(VersionState::DELETE_PLACEHOLDER)
        );

after

        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($tableName);
        $queryBuilder->getRestrictions()->removeAll();
        $versions = $queryBuilder->select('uid', 't3ver_oid', 't3ver_state')
            ->from($tableName)
            ->where(
                $queryBuilder->expr()->eq('pid', -1),
                $queryBuilder->expr()->in('t3ver_oid', $ids),
                $queryBuilder->expr()->neq('t3ver_wsid', (int)$this->getWorkspaceId()),
                $queryBuilder->expr()->eq('t3ver_state', (int)VersionState::cast(VersionState::DELETE_PLACEHOLDER))
            )
            ->execute()
            ->fetchAll();

As you can see the t3ver_wis was changed from “=” to “neq()” which is a nasty regression when dealing with deleted placeholders.

See https://review.typo3.org/c/Packages/TYPO3.CMS/+/49530/

This should be fixed.

Reviews 3