Commit 3b7f9ee4 authored by Benni Mack's avatar Benni Mack Committed by Susanne Moog
Browse files

[TASK] Use Workspace API for checking TCA versioning support

The API method BackendUtility::isTableWorkspaceEnabled($table)
should be used when dealing with a backend context to determine
if a table has versioning support enabled.

This functionality wasn't used consistently throughout TYPO3
Backend / CLI code and should be used in order to determine.

For PageRepository a separate protected method is introduced
to avoid a dependency on BackendUtility.

This patch is a precursor for streamlining the workspaces API further.

Resolves: #89108
Releases: master
Change-Id: Id63e04a5faa1520459d23fb5467ebfb523d9d958
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61639

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Susanne Moog's avatarSusanne Moog <look@susi.dev>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Susanne Moog's avatarSusanne Moog <look@susi.dev>
parent 0bf69670
......@@ -626,8 +626,10 @@ class ShortcutRepository
$selectFields[] = $GLOBALS['TCA'][$table]['ctrl']['typeicon_column'];
}
if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
if (BackendUtility::isTableWorkspaceEnabled($table)) {
$selectFields[] = 't3ver_state';
$selectFields[] = 't3ver_wsid';
$selectFields[] = 't3ver_oid';
}
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
......
......@@ -498,7 +498,7 @@ class Clipboard
)
);
if (isset($tcaCtrl['versioningWS']) && $tcaCtrl['versioningWS']) {
if (BackendUtility::isTableWorkspaceEnabled($table)) {
$queryBuilder
->andWhere(
$queryBuilder->expr()->eq(
......
......@@ -626,7 +626,7 @@ class EditDocumentController
reset($this->editconf[$nTable]);
$nUid = key($this->editconf[$nTable]);
$recordFields = 'pid,uid';
if (!empty($GLOBALS['TCA'][$nTable]['ctrl']['versioningWS'])) {
if (BackendUtility::isTableWorkspaceEnabled($nTable)) {
$recordFields .= ',t3ver_oid';
}
$nRec = BackendUtility::getRecord($nTable, $nUid, $recordFields);
......@@ -673,7 +673,7 @@ class EditDocumentController
}
$recordFields = 'pid,uid';
if (!empty($GLOBALS['TCA'][$nTable]['ctrl']['versioningWS'])) {
if (!BackendUtility::isTableWorkspaceEnabled($nTable)) {
$recordFields .= ',t3ver_oid';
}
$nRec = BackendUtility::getRecord($nTable, $nUid, $recordFields);
......@@ -2292,13 +2292,14 @@ class EditDocumentController
*/
protected function getRecordForEdit(string $table, int $theUid)
{
$tableSupportsVersioning = BackendUtility::isTableWorkspaceEnabled($table);
// Fetch requested record:
$reqRecord = BackendUtility::getRecord($table, $theUid, 'uid,pid');
$reqRecord = BackendUtility::getRecord($table, $theUid, 'uid,pid' . ($tableSupportsVersioning ? ',t3ver_oid' : ''));
if (is_array($reqRecord)) {
// If workspace is OFFLINE:
if ($this->getBackendUser()->workspace != 0) {
// Check for versioning support of the table:
if ($GLOBALS['TCA'][$table] && $GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
if ($tableSupportsVersioning) {
// If the record is already a version of "something" pass it by.
if ($reqRecord['pid'] == -1) {
// (If it turns out not to be a version of the current workspace there will be trouble, but
......
......@@ -385,7 +385,7 @@ class SuggestWizardDefaultReceiver
protected function makeWorkspaceOverlay(&$row)
{
// Check for workspace-versions
if ($GLOBALS['BE_USER']->workspace != 0 && $GLOBALS['TCA'][$this->table]['ctrl']['versioningWS'] == true) {
if ($GLOBALS['BE_USER']->workspace != 0 && BackendUtility::isTableWorkspaceEnabled($this->table)) {
BackendUtility::workspaceOL($this->mmForeignTable ? $this->mmForeignTable : $this->table, $row);
}
}
......
......@@ -3347,7 +3347,7 @@ class BackendUtility
) {
$realPid = 0;
$outputRows = [];
if ($GLOBALS['TCA'][$table] && static::isTableWorkspaceEnabled($table)) {
if (static::isTableWorkspaceEnabled($table)) {
if (is_array($row) && !$includeDeletedRecords) {
$row['_CURRENT_VERSION'] = true;
$realPid = $row['pid'];
......@@ -3437,8 +3437,11 @@ class BackendUtility
if (!ExtensionManagementUtility::isLoaded('workspaces')) {
return;
}
if (!static::isTableWorkspaceEnabled($table)) {
return;
}
// Check that the input record is an offline version from a table that supports versioning:
if (is_array($rr) && $rr['pid'] == -1 && static::isTableWorkspaceEnabled($table)) {
if (is_array($rr)) {
// Check values for t3ver_oid and t3ver_wsid:
if (isset($rr['t3ver_oid']) && isset($rr['t3ver_wsid'])) {
// If "t3ver_oid" is already a field, just set this:
......@@ -3762,7 +3765,7 @@ class BackendUtility
if ($workspace === null && static::getBackendUserAuthentication() instanceof BackendUserAuthentication) {
$workspace = static::getBackendUserAuthentication()->workspace;
}
if ((int)$workspace !== 0 && $GLOBALS['TCA'][$table] && static::isTableWorkspaceEnabled($table)) {
if ((int)$workspace !== 0 && static::isTableWorkspaceEnabled($table)) {
// Select workspace version of record:
$queryBuilder = static::getQueryBuilderForTable($table);
$queryBuilder->getRestrictions()
......
......@@ -44,7 +44,6 @@ use TYPO3\CMS\Core\Site\Entity\NullSite;
use TYPO3\CMS\Core\Site\Entity\SiteLanguage;
use TYPO3\CMS\Core\Site\SiteFinder;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\HttpUtility;
use TYPO3\CMS\Core\Utility\MathUtility;
......@@ -3671,8 +3670,8 @@ class PageLayoutView implements LoggerAwareInterface
if ($GLOBALS['TCA'][$table]['ctrl']['sortby']) {
$fieldListArr[] = $GLOBALS['TCA'][$table]['ctrl']['sortby'];
}
if (ExtensionManagementUtility::isLoaded('workspaces')
&& $GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
if (BackendUtility::isTableWorkspaceEnabled($table)) {
$fieldListArr[] = 't3ver_oid';
$fieldListArr[] = 't3ver_state';
$fieldListArr[] = 't3ver_wsid';
}
......
......@@ -902,7 +902,7 @@ class BackendUserAuthentication extends AbstractUserAuthentication
$recData = BackendUtility::getRecord(
$table,
$recData,
'pid' . ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] ? ',t3ver_wsid,t3ver_stage' : '')
'pid' . (BackendUtility::isTableWorkspaceEnabled($table) ? ',t3ver_oid,t3ver_wsid,t3ver_stage' : '')
);
}
if (is_array($recData)) {
......@@ -910,9 +910,6 @@ class BackendUserAuthentication extends AbstractUserAuthentication
// that workspace matches and versioning is enabled for the table.
if ((int)$recData['pid'] === -1) {
// No versioning, basic error, inconsistency even! Such records should not have a pid of -1!
if (!$GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
return 'Versioning disabled for table';
}
if ((int)$recData['t3ver_wsid'] !== $this->workspace) {
// So does workspace match?
return 'Workspace ID of record didn\'t match current workspace';
......@@ -951,9 +948,9 @@ class BackendUserAuthentication extends AbstractUserAuthentication
*/
public function workspaceCannotEditOfflineVersion($table, $recData)
{
if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
if (BackendUtility::isTableWorkspaceEnabled($table)) {
if (!is_array($recData)) {
$recData = BackendUtility::getRecord($table, $recData, 'uid,pid,t3ver_wsid,t3ver_stage');
$recData = BackendUtility::getRecord($table, $recData, 'uid,pid,t3ver_oid,t3ver_wsid,t3ver_stage');
}
if (is_array($recData)) {
if ((int)$recData['pid'] === -1) {
......@@ -983,7 +980,7 @@ class BackendUserAuthentication extends AbstractUserAuthentication
// and tables are completely without versioning it is ok as well.
if (
$this->workspace === 0
|| $this->workspaceRec['live_edit'] && !$GLOBALS['TCA'][$table]['ctrl']['versioningWS']
|| $this->workspaceRec['live_edit'] && !BackendUtility::isTableWorkspaceEnabled($table)
|| $GLOBALS['TCA'][$table]['ctrl']['versioningWS_alwaysAllowLiveEdit']
) {
// OK to create for this table.
......@@ -1008,7 +1005,7 @@ class BackendUserAuthentication extends AbstractUserAuthentication
// Stage for versioning root point and users access level did not allow for editing
return false;
}
} elseif (!$GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
} elseif (!BackendUtility::isTableWorkspaceEnabled($table)) {
// So, if no live records were allowed, we have to create a new version of this record:
return false;
}
......@@ -1030,7 +1027,7 @@ class BackendUserAuthentication extends AbstractUserAuthentication
// If there is no versionized record found we will create one and save to that.
if (
$this->workspace !== 0
&& $GLOBALS['TCA'][$table]['ctrl']['versioningWS'] && $recpid >= 0
&& BackendUtility::isTableWorkspaceEnabled($table) && $recpid >= 0
&& !BackendUtility::getWorkspaceVersionOfRecord($this->workspace, $table, $id, 'uid')
) {
// There must be no existing version of this record in workspace.
......
......@@ -941,7 +941,7 @@ class DataHandler implements LoggerAwareInterface
}
} else {
// So, if no live records were allowed, we have to create a new version of this record:
if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
if (BackendUtility::isTableWorkspaceEnabled($table)) {
$createNewVersion = true;
} else {
$recordAccess = false;
......@@ -972,7 +972,7 @@ class DataHandler implements LoggerAwareInterface
$this->newlog('recordEditAccessInternals() check failed. [' . $this->BE_USER->errorMsg . ']', 1);
} else {
// Here we fetch the PID of the record that we point to...
$tempdata = $this->recordInfo($table, $id, 'pid' . (!empty($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) ? ',t3ver_wsid,t3ver_stage' : ''));
$tempdata = $this->recordInfo($table, $id, 'pid' . (BackendUtility::isTableWorkspaceEnabled($table) ? ',t3ver_oid,t3ver_wsid,t3ver_stage' : ''));
$theRealPid = $tempdata['pid'];
// Use the new id of the versionized record we're trying to write to:
// (This record is a child record of a parent and has already been versionized.)
......@@ -1086,7 +1086,7 @@ class DataHandler implements LoggerAwareInterface
}
}
// Set stage to "Editing" to make sure we restart the workflow
if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
if (BackendUtility::isTableWorkspaceEnabled($table)) {
$fieldArray['t3ver_stage'] = 0;
}
// Hook: processDatamap_postProcessFieldArray
......@@ -3787,7 +3787,7 @@ class DataHandler implements LoggerAwareInterface
)
);
if (isset($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) && $GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
if (BackendUtility::isTableWorkspaceEnabled($table)) {
$queryBuilder->andWhere(
$queryBuilder->expr()->eq('t3ver_oid', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT))
);
......@@ -4212,7 +4212,7 @@ class DataHandler implements LoggerAwareInterface
)
);
if (isset($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) && $GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
if (BackendUtility::isTableWorkspaceEnabled($table)) {
$queryBuilder->andWhere(
$queryBuilder->expr()->eq('t3ver_oid', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT))
);
......@@ -5102,7 +5102,7 @@ class DataHandler implements LoggerAwareInterface
)
);
if (isset($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) && $GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
if (BackendUtility::isTableWorkspaceEnabled($table)) {
$queryBuilder->andWhere(
$queryBuilder->expr()->eq('t3ver_oid', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT))
);
......@@ -5146,7 +5146,7 @@ class DataHandler implements LoggerAwareInterface
if ($this->isElementToBeDeleted($table, $id)) {
return null;
}
if (!$GLOBALS['TCA'][$table] || !$GLOBALS['TCA'][$table]['ctrl']['versioningWS'] || $id <= 0) {
if (!$GLOBALS['TCA'][$table] || !BackendUtility::isTableWorkspaceEnabled($table) || $id <= 0) {
$this->newlog('Versioning is not supported for this table "' . $table . '" / ' . $id, 1);
return null;
}
......@@ -6461,7 +6461,7 @@ class DataHandler implements LoggerAwareInterface
'header' => BackendUtility::getRecordTitle($table, $row),
'pid' => $row['pid'],
'event_pid' => $this->eventPid($table, isset($row['_ORIG_pid']) ? $row['t3ver_oid'] : $row['uid'], $row['pid']),
't3ver_state' => $GLOBALS['TCA'][$table]['ctrl']['versioningWS'] ? $row['t3ver_state'] : '',
't3ver_state' => BackendUtility::isTableWorkspaceEnabled($table) ? $row['t3ver_state'] : '',
'_ORIG_pid' => $row['_ORIG_pid']
];
}
......
......@@ -1243,7 +1243,7 @@ class PageRepository implements LoggerAwareInterface
if ($ctrl['delete']) {
$constraints[] = $expressionBuilder->eq($table . '.' . $ctrl['delete'], 0);
}
if ($ctrl['versioningWS'] ?? false) {
if ($this->hasTableWorkspaceSupport($table)) {
if ($this->versioningWorkspaceId === 0) {
// Filter out placeholder records (new/moved/deleted items)
// in case we are NOT in a versioning preview (that means we are online!)
......@@ -1270,7 +1270,7 @@ class PageRepository implements LoggerAwareInterface
if (is_array($ctrl['enablecolumns'])) {
// In case of versioning-preview, enableFields are ignored (checked in
// versionOL())
if ($this->versioningWorkspaceId === 0 || !$ctrl['versioningWS']) {
if ($this->versioningWorkspaceId === 0 || !$this->hasTableWorkspaceSupport($table)) {
if (($ctrl['enablecolumns']['disabled'] ?? false) && !$show_hidden && !($ignore_array['disabled'] ?? false)) {
$field = $table . '.' . $ctrl['enablecolumns']['disabled'];
$constraints[] = $expressionBuilder->eq($field, 0);
......@@ -1378,7 +1378,7 @@ class PageRepository implements LoggerAwareInterface
*/
public function fixVersioningPid($table, &$rr)
{
if ($this->versioningWorkspaceId > 0 && is_array($rr) && (int)$rr['pid'] === -1 && $GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
if ($this->versioningWorkspaceId > 0 && is_array($rr) && $this->hasTableWorkspaceSupport($table)) {
$oid = 0;
$wsid = 0;
// Check values for t3ver_oid and t3ver_wsid:
......@@ -1533,7 +1533,7 @@ class PageRepository implements LoggerAwareInterface
*/
protected function movePlhOL($table, &$row)
{
if (!empty($GLOBALS['TCA'][$table]['ctrl']['versioningWS'])
if ($this->hasTableWorkspaceSupport($table)
&& (int)VersionState::cast($row['t3ver_state'])->equals(VersionState::MOVE_PLACEHOLDER)
) {
$moveID = 0;
......@@ -1594,7 +1594,7 @@ class PageRepository implements LoggerAwareInterface
protected function getMovePlaceholder($table, $uid, $fields = '*')
{
$workspace = (int)$this->versioningWorkspaceId;
if (!empty($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) && $workspace > 0) {
if ($workspace > 0 && $this->hasTableWorkspaceSupport($table)) {
// Select workspace version of record:
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
$queryBuilder->getRestrictions()
......@@ -1645,7 +1645,7 @@ class PageRepository implements LoggerAwareInterface
*/
public function getWorkspaceVersionOfRecord($workspace, $table, $uid, $fields = '*', $bypassEnableFieldsCheck = false)
{
if ($workspace !== 0 && !empty($GLOBALS['TCA'][$table]['ctrl']['versioningWS'])) {
if ($workspace !== 0 && $this->hasTableWorkspaceSupport($table)) {
$workspace = (int)$workspace;
$uid = (int)$uid;
// Select workspace version of record, only testing for deleted.
......@@ -1741,4 +1741,9 @@ class PageRepository implements LoggerAwareInterface
{
return GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
}
protected function hasTableWorkspaceSupport(string $tableName): bool
{
return !empty($GLOBALS['TCA'][$tableName]['ctrl']['versioningWS']);
}
}
......@@ -20,6 +20,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\ReferenceIndex;
......@@ -242,6 +243,10 @@ If you want to get more detailed information, use the --verbose option.')
if (isset($GLOBALS['TCA'][$rec['ref_table']]['ctrl']['delete'])) {
$selectFields[] = $GLOBALS['TCA'][$rec['ref_table']]['ctrl']['delete'];
}
if (BackendUtility::isTableWorkspaceEnabled($rec['ref_table'])) {
$selectFields[] = 't3ver_oid';
$selectFields[] = 't3ver_wsid';
}
$existingRecords[$idx] = $queryBuilder
->select(...$selectFields)
......
......@@ -222,7 +222,7 @@ class DatabaseIntegrityCheck
$this->recStats['published_versions'][$table][$newID] = $newID;
}
// Select all versions of this record:
if ($this->genTreeIncludeVersions && $GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
if ($this->genTreeIncludeVersions && BackendUtility::isTableWorkspaceEnabled($table)) {
$this->genTree_records($newID, '', $table, true);
}
}
......
......@@ -845,9 +845,10 @@ class DatabaseRecordList
$selectFields[] = $GLOBALS['TCA'][$table]['ctrl'][$field];
}
}
if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
if (BackendUtility::isTableWorkspaceEnabled($table)) {
$selectFields[] = 't3ver_state';
$selectFields[] = 't3ver_wsid';
$selectFields[] = 't3ver_oid';
}
if ($l10nEnabled) {
$selectFields[] = $GLOBALS['TCA'][$table]['ctrl']['languageField'];
......@@ -3616,11 +3617,10 @@ class DatabaseRecordList
if ($GLOBALS['TCA'][$table]['ctrl']['sortby']) {
$fieldListArr[] = $GLOBALS['TCA'][$table]['ctrl']['sortby'];
}
if (ExtensionManagementUtility::isLoaded(
'workspaces'
) && $GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
if (BackendUtility::isTableWorkspaceEnabled($table)) {
$fieldListArr[] = 't3ver_state';
$fieldListArr[] = 't3ver_wsid';
$fieldListArr[] = 't3ver_oid';
}
}
} else {
......
......@@ -605,7 +605,7 @@ page.10.value = HELLO WORLD!
string $tableName,
int $workspaceId
) {
if (empty($GLOBALS['TCA'][$tableName]['ctrl']['versioningWS'])) {
if (!BackendUtility::isTableWorkspaceEnabled($tableName)) {
return;
}
......
......@@ -507,7 +507,7 @@ class WorkspaceVersionRecordsCommand extends Command
->add(GeneralUtility::makeInstance(DeletedRestriction::class));
$result = $queryBuilder
->select('uid', 'pid', 't3ver_move_id', 't3ver_wsid', 't3ver_state')
->select('uid', 'pid', 't3ver_move_id', 't3ver_wsid', 't3ver_oid', 't3ver_state')
->from($table)
->where(
$queryBuilder->expr()->neq(
......
......@@ -58,7 +58,7 @@ class BackendUtilityHook
*/
public function makeEditForm_accessCheck($params)
{
if ($GLOBALS['BE_USER']->workspace !== 0 && $GLOBALS['TCA'][$params['table']]['ctrl']['versioningWS']) {
if ($GLOBALS['BE_USER']->workspace !== 0 && BackendUtility::isTableWorkspaceEnabled($params['table'])) {
$record = BackendUtility::getRecordWSOL($params['table'], $params['uid']);
if (abs($record['t3ver_stage']) > StagesService::STAGE_EDIT_ID) {
$stages = GeneralUtility::makeInstance(StagesService::class);
......
......@@ -192,7 +192,7 @@ class DataHandlerHook
$recordVersionState = VersionState::cast($record['t3ver_state']);
// Look, if record is an offline version, then delete directly:
if ($record['pid'] == -1) {
if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
if (BackendUtility::isTableWorkspaceEnabled($table)) {
// In Live workspace, delete any. In other workspaces there must be match.
if ($dataHandler->BE_USER->workspace == 0 || (int)$record['t3ver_wsid'] == $dataHandler->BE_USER->workspace) {
$liveRec = BackendUtility::getLiveVersionOfRecord($table, $id, 'uid,t3ver_state');
......@@ -1380,7 +1380,7 @@ class DataHandlerHook
}
// Traversing all tables supporting versioning:
foreach ($GLOBALS['TCA'] as $table => $cfg) {
if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] && $table !== 'pages') {
if (BackendUtility::isTableWorkspaceEnabled($table) && $table !== 'pages') {
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable($table);
......@@ -1435,7 +1435,7 @@ class DataHandlerHook
}
// Traversing all tables supporting versioning:
foreach ($GLOBALS['TCA'] as $table => $cfg) {
if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] && $table !== 'pages') {
if (BackendUtility::isTableWorkspaceEnabled($table) && $table !== 'pages') {
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable($table);
......
......@@ -235,7 +235,7 @@ class WorkspaceService implements SingletonInterface
if (!$GLOBALS['BE_USER']->check($selectionType, $table)) {
continue;
}
if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
if (BackendUtility::isTableWorkspaceEnabled($table)) {
$recs = $this->selectAllVersionsFromPages($table, $pageList, $wsid, $filter, $stage, $language);
$moveRecs = $this->getMoveToPlaceHolderFromPages($table, $pageList, $wsid, $filter, $stage);
$recs = array_merge($recs, $moveRecs);
......@@ -782,7 +782,7 @@ class WorkspaceService implements SingletonInterface
$this->versionsOnPageCache[$workspaceId][$pageId] = false;
foreach ($GLOBALS['TCA'] as $tableName => $tableConfiguration) {
if ($tableName === 'pages' || empty($tableConfiguration['ctrl']['versioningWS'])) {
if ($tableName === 'pages' || !BackendUtility::isTableWorkspaceEnabled($tableName)) {
continue;
}
......@@ -832,7 +832,7 @@ class WorkspaceService implements SingletonInterface
public function getPagesWithVersionsInTable($workspaceId)
{
foreach ($GLOBALS['TCA'] as $tableName => $tableConfiguration) {
if ($tableName === 'pages' || empty($tableConfiguration['ctrl']['versioningWS'])) {
if ($tableName === 'pages' || !BackendUtility::isTableWorkspaceEnabled($tableName)) {
continue;
}
......
Supports Markdown
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