Commit 608f238a authored by Benni Mack's avatar Benni Mack Committed by Oliver Bartsch
Browse files

[TASK] Remove unused methods related to workspaces

Resolves: #96490
Releases: main
Change-Id: I43218e8f99f062fc43f14e1b26d7b68d8ca5414d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72937

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent d465a7a6
......@@ -1621,60 +1621,6 @@ class PageRepository implements LoggerAwareInterface
}
}
/**
* Returns the PID of the new (moved) location within a version, when a $liveUid is given.
*
* Please note: This is only performed within a workspace.
* This was previously stored in the move placeholder's PID, but move pointer's PID and move placeholder's PID
* are the same since TYPO3 v10, so the MOVE_POINTER is queried.
*
* @param string $table Table name
* @param int $liveUid Record UID of online version
* @return int|null If found, the Page ID of the moved record, otherwise null.
*/
protected function getMovedPidOfVersionedRecord(string $table, int $liveUid): ?int
{
if ($this->versioningWorkspaceId <= 0) {
return null;
}
if (!$this->hasTableWorkspaceSupport($table)) {
return null;
}
// Select workspace version of record
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
$queryBuilder->getRestrictions()
->removeAll()
->add(GeneralUtility::makeInstance(DeletedRestriction::class));
$row = $queryBuilder->select('pid')
->from($table)
->where(
$queryBuilder->expr()->eq(
't3ver_state',
$queryBuilder->createNamedParameter(
(string)VersionState::cast(VersionState::MOVE_POINTER),
\PDO::PARAM_INT
)
),
$queryBuilder->expr()->eq(
't3ver_oid',
$queryBuilder->createNamedParameter($liveUid, \PDO::PARAM_INT)
),
$queryBuilder->expr()->eq(
't3ver_wsid',
$queryBuilder->createNamedParameter($this->versioningWorkspaceId, \PDO::PARAM_INT)
)
)
->setMaxResults(1)
->execute()
->fetchAssociative();
if (is_array($row)) {
return (int)$row['pid'];
}
return null;
}
/**
* Select the version of a record for a workspace
*
......
......@@ -18,7 +18,6 @@ namespace TYPO3\CMS\Workspaces\Service;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
use TYPO3\CMS\Core\Database\Query\QueryHelper;
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
use TYPO3\CMS\Core\Database\Query\Restriction\RootLevelRestriction;
......@@ -1051,20 +1050,6 @@ class WorkspaceService implements SingletonInterface
return $this->pagesWithVersionsInTable[$workspaceId][$tableName];
}
/**
* @param string $tableName
* @return QueryBuilder
*/
protected function createQueryBuilderForTable(string $tableName)
{
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable($tableName);
$queryBuilder->getRestrictions()
->removeAll()
->add(GeneralUtility::makeInstance(DeletedRestriction::class));
return $queryBuilder;
}
/**
* @return LanguageService|null
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment