Commit db6af6d8 authored by Benni Mack's avatar Benni Mack Committed by Georg Ringer
Browse files

[BUGFIX] Avoid using non-API functionality for workspaces

BackendUser has some tight integration with workspaces, however
it also contains some legacy non-workspace related functionality
whereas checks against $pid is done for branch versioning.

This has been removed and some new internal methods are
now used with a clearer return value and internal code structure.

Resolves: #88155
Releases: master
Change-Id: I7b902085e53bd6bd8a8522df4815d31482468102
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60483


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Frank Nägler's avatarFrank Nägler <frank.naegler@typo3.org>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Achim Fritz's avatarAchim Fritz <af@achimfritz.de>
Reviewed-by: Frank Nägler's avatarFrank Nägler <frank.naegler@typo3.org>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent 18a9238c
......@@ -480,7 +480,7 @@ class NewRecordController
if ($displayNewPagesIntoLink
&& $this->isTableAllowedOnPage('pages', $this->pageinfo)
&& $this->getBackendUserAuthentication()->check('tables_modify', 'pages')
&& $this->getBackendUserAuthentication()->workspaceCreateNewRecord(($this->pageinfo['_ORIG_uid'] ?: $this->id), 'pages')
&& $this->getBackendUserAuthentication()->workspaceCanCreateNewRecord('pages')
) {
// Create link to new page inside:
$recordIcon = $this->moduleTemplate->getIconFactory()->getIconForRecord($table, [], Icon::SIZE_SMALL)->render();
......@@ -494,7 +494,7 @@ class NewRecordController
if ($displayNewPagesAfterLink
&& $this->isTableAllowedOnPage('pages', $this->pidInfo)
&& $this->getBackendUserAuthentication()->check('tables_modify', 'pages')
&& $this->getBackendUserAuthentication()->workspaceCreateNewRecord($this->pidInfo['uid'], 'pages')
&& $this->getBackendUserAuthentication()->workspaceCanCreateNewRecord('pages')
) {
$newPageLinks[] = $this->renderLink(
$pageIcon . htmlspecialchars($lang->sL($v['ctrl']['title'])) . ' (' . htmlspecialchars($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:db_new.php.after')) . ')',
......@@ -536,7 +536,7 @@ class NewRecordController
&& $this->isTableAllowedOnPage($table, $this->pageinfo)
&& $this->getBackendUserAuthentication()->check('tables_modify', $table)
&& ($rootLevelConfiguration === -1 || ($this->id xor $rootLevelConfiguration))
&& $this->getBackendUserAuthentication()->workspaceCreateNewRecord(($this->pageinfo['_ORIG_uid'] ? $this->pageinfo['_ORIG_uid'] : $this->id), $table)
&& $this->getBackendUserAuthentication()->workspaceCanCreateNewRecord($table)
) {
$newRecordIcon = $this->moduleTemplate->getIconFactory()->getIconForRecord($table, [], Icon::SIZE_SMALL)->render();
$rowContent = '';
......
......@@ -886,54 +886,50 @@ class BackendUserAuthentication extends AbstractUserAuthentication
/**
* Checking if editing of an existing record is allowed in current workspace if that is offline.
* Rules for editing in offline mode:
* - record supports versioning and is an offline version from workspace and has the corrent stage
* - record supports versioning and is an offline version from workspace and has the current stage
* - or record (any) is in a branch where there is a page which is a version from the workspace
* and where the stage is not preventing records
*
* @param string $table Table of record
* @param array|int $recData Integer (record uid) or array where fields are at least: pid, t3ver_wsid, t3ver_stage (if versioningWS is set)
* @param array|int $recData Integer (record uid) or array where fields are at least: pid, t3ver_wsid, t3ver_oid, t3ver_stage (if versioningWS is set)
* @return string String error code, telling the failure state. FALSE=All ok
*/
public function workspaceCannotEditRecord($table, $recData)
{
// Only test offline spaces:
if ($this->workspace !== 0) {
if (!is_array($recData)) {
$recData = BackendUtility::getRecord(
$table,
$recData,
'pid' . (BackendUtility::isTableWorkspaceEnabled($table) ? ',t3ver_oid,t3ver_wsid,t3ver_stage' : '')
);
}
if (is_array($recData)) {
// We are testing a "version" (identified by having a t3ver_oid): it can be edited provided
// that workspace matches and versioning is enabled for the table.
if ((int)($recData['t3ver_oid'] ?? 0) > 0) {
if ((int)$recData['t3ver_wsid'] !== $this->workspace) {
// So does workspace match?
return 'Workspace ID of record didn\'t match current workspace';
}
// So is the user allowed to "use" the edit stage within the workspace?
return $this->workspaceCheckStageForCurrent(0)
? false
: 'User\'s access level did not allow for editing';
}
// We are testing a "live" record:
// For "Live" records, check that PID for table allows editing
if ($res = $this->workspaceAllowLiveRecordsInPID($recData['pid'], $table)) {
// Live records are OK in this branch, but what about the stage of branch point, if any:
// OK
return $res > 0
? false
: 'Stage for versioning root point and users access level did not allow for editing';
// Only test if the user is in a workspace
if ($this->workspace === 0) {
return false;
}
$tableSupportsVersioning = BackendUtility::isTableWorkspaceEnabled($table);
if (!is_array($recData)) {
$recData = BackendUtility::getRecord(
$table,
$recData,
'pid' . ($tableSupportsVersioning ? ',t3ver_oid,t3ver_wsid,t3ver_stage' : '')
);
}
if (is_array($recData)) {
// We are testing a "version" (identified by having a t3ver_oid): it can be edited provided
// that workspace matches and versioning is enabled for the table.
if ($tableSupportsVersioning && (int)($recData['t3ver_oid'] ?? 0) > 0) {
if ((int)$recData['t3ver_wsid'] !== $this->workspace) {
// So does workspace match?
return 'Workspace ID of record didn\'t match current workspace';
}
// If not offline and not in versionized branch, output error:
return 'Online record was not in versionized branch!';
// So is the user allowed to "use" the edit stage within the workspace?
return $this->workspaceCheckStageForCurrent(0)
? false
: 'User\'s access level did not allow for editing';
}
// Check if we are testing a "live" record
if ($this->workspaceAllowsLiveEditingInTable($table)) {
// Live records are OK in the current workspace
return false;
}
return 'No record';
// If not offline, output error
return 'Online record was not in a workspace!';
}
// OK because workspace is 0
return false;
return 'No record';
}
/**
......@@ -947,19 +943,19 @@ class BackendUserAuthentication extends AbstractUserAuthentication
*/
public function workspaceCannotEditOfflineVersion($table, $recData)
{
if (BackendUtility::isTableWorkspaceEnabled($table)) {
if (!is_array($recData)) {
$recData = BackendUtility::getRecord($table, $recData, 'uid,pid,t3ver_oid,t3ver_wsid,t3ver_stage');
}
if (is_array($recData)) {
if ((int)$recData['t3ver_oid'] > 0) {
return $this->workspaceCannotEditRecord($table, $recData);
}
return 'Not an offline version';
if (!BackendUtility::isTableWorkspaceEnabled($table)) {
return 'Table does not support versioning.';
}
if (!is_array($recData)) {
$recData = BackendUtility::getRecord($table, $recData, 'uid,pid,t3ver_oid,t3ver_wsid,t3ver_stage');
}
if (is_array($recData)) {
if ((int)$recData['t3ver_oid'] > 0) {
return $this->workspaceCannotEditRecord($table, $recData);
}
return 'No record';
return 'Not an offline version';
}
return 'Table does not support versioning.';
return 'No record';
}
/**
......@@ -969,6 +965,8 @@ class BackendUserAuthentication extends AbstractUserAuthentication
* of versioning because the element was within a versionized branch
* but NOT ok in terms of the state the root point had!
*
* Note: this method is not in use anymore and will likely be deprecated in future TYPO3 versions.
*
* @param int $pid PID value to check for. OBSOLETE!
* @param string $table Table name
* @return mixed Returns FALSE if a live record cannot be created and must be versionized in order to do so. 2 means a) Workspace is "Live" or workspace allows "live edit" of records from non-versionized tables (and the $table is not versionizable). 1 and -1 means the pid is inside a versionized branch where -1 means that the branch-point did NOT allow a new record according to its state.
......@@ -989,23 +987,64 @@ class BackendUserAuthentication extends AbstractUserAuthentication
return false;
}
/**
* Checks if a record is allowed to be edited in the current workspace.
* This is not bound to an actual record, but to the mere fact if the user is in a workspace
* and depending on the table settings.
*
* @param string $table
* @return bool
*/
public function workspaceAllowsLiveEditingInTable(string $table): bool
{
// In live workspace the record can be added/modified
if ($this->workspace === 0) {
return true;
}
// Workspace setting allows to "live edit" records of tables without versioning
if ($this->workspaceRec['live_edit'] && !BackendUtility::isTableWorkspaceEnabled($table)) {
return true;
}
// Always for Live workspace AND if live-edit is enabled
// and tables are completely without versioning it is ok as well.
if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS_alwaysAllowLiveEdit']) {
return true;
}
// If the answer is FALSE it means the only valid way to create or edit records by creating records in the workspace
return false;
}
/**
* Evaluates if a record from $table can be created in $pid
*
* Note: this method is not in use anymore and will likely be deprecated in future TYPO3 versions.
*
* @param int $pid Page id. This value must be the _ORIG_uid if available: So when you have pages versionized as "page" or "element" you must supply the id of the page version in the workspace!
* @param string $table Table name
* @return bool TRUE if OK.
*/
public function workspaceCreateNewRecord($pid, $table)
{
if ($res = $this->workspaceAllowLiveRecordsInPID($pid, $table)) {
// If LIVE records cannot be created in the current PID due to workspace restrictions, prepare creation of placeholder-record
if ($res < 0) {
// Stage for versioning root point and users access level did not allow for editing
return false;
}
} elseif (!BackendUtility::isTableWorkspaceEnabled($table)) {
// So, if no live records were allowed, we have to create a new version of this record:
// If LIVE records cannot be created due to workspace restrictions, prepare creation of placeholder-record
if (!$this->workspaceAllowsLiveEditingInTable($table) && !BackendUtility::isTableWorkspaceEnabled($table)) {
// So, if no live records were allowed, we have to create a new version of this record
return false;
}
return true;
}
/**
* Evaluates if a record from $table can be created. If the table is not set up for versioning,
* and the "live edit" flag of the page is set, return false. In live workspace this is always true,
* as all records can be created in live workspace
*
* @param string $table Table name
* @return bool
*/
public function workspaceCanCreateNewRecord(string $table): bool
{
// If LIVE records cannot be created due to workspace restrictions, prepare creation of placeholder-record
if (!$this->workspaceAllowsLiveEditingInTable($table) && !BackendUtility::isTableWorkspaceEnabled($table)) {
return false;
}
return true;
......@@ -1013,6 +1052,9 @@ class BackendUserAuthentication extends AbstractUserAuthentication
/**
* Evaluates if auto creation of a version of a record is allowed.
* Auto-creation of version: In offline workspace, test if versioning is
* enabled and look for workspace version of input record.
* If there is no versionized record found we will create one and save to that.
*
* @param string $table Table of the record
* @param int $id UID of record
......@@ -1021,18 +1063,22 @@ class BackendUserAuthentication extends AbstractUserAuthentication
*/
public function workspaceAllowAutoCreation($table, $id, $recpid)
{
// Auto-creation of version: In offline workspace, test if versioning is
// enabled and look for workspace version of input record.
// If there is no versionized record found we will create one and save to that.
if (
$this->workspace !== 0
&& BackendUtility::isTableWorkspaceEnabled($table) && $recpid >= 0
&& !BackendUtility::getWorkspaceVersionOfRecord($this->workspace, $table, $id, 'uid')
) {
// There must be no existing version of this record in workspace.
return true;
// No version can be created in live workspace
if ($this->workspace === 0) {
return false;
}
return false;
// No versioning support for this table, so no version can be created
if (!BackendUtility::isTableWorkspaceEnabled($table)) {
return false;
}
if ($recpid < 0) {
return false;
}
// There must be no existing version of this record in workspace
if (BackendUtility::getWorkspaceVersionOfRecord($this->workspace, $table, $id, 'uid')) {
return false;
}
return true;
}
/**
......@@ -1050,48 +1096,46 @@ class BackendUserAuthentication extends AbstractUserAuthentication
if ($this->isAdmin()) {
return true;
}
if ($this->workspace !== 0 && ExtensionManagementUtility::isLoaded('workspaces')) {
$stage = (int)$stage;
$stat = $this->checkWorkspaceCurrent();
// Check if custom staging is activated
$workspaceRec = BackendUtility::getRecord('sys_workspace', $stat['uid']);
if ($workspaceRec['custom_stages'] > 0 && $stage !== 0 && $stage !== -10) {
// Get custom stage record
$workspaceStageRec = BackendUtility::getRecord('sys_workspace_stage', $stage);
// Check if the user is responsible for the current stage
if (
$stat['_ACCESS'] === 'owner'
|| $stat['_ACCESS'] === 'member'
&& GeneralUtility::inList($workspaceStageRec['responsible_persons'], 'be_users_' . $this->user['uid'])
) {
return true;
}
// Check if the user is in a group which is responsible for the current stage
foreach ($this->userGroupsUID as $groupUid) {
if (
$stat['_ACCESS'] === 'owner'
|| $stat['_ACCESS'] === 'member'
&& GeneralUtility::inList($workspaceStageRec['responsible_persons'], 'be_groups_' . $groupUid)
) {
return true;
}
}
} elseif ($stage == -10 || $stage == -20) {
if ($stat['_ACCESS'] === 'owner') {
return true;
}
return false;
} else {
$memberStageLimit = $this->workspaceRec['review_stage_edit'] ? 1 : 0;
// Always OK for live workspace
if ($this->workspace === 0 || !ExtensionManagementUtility::isLoaded('workspaces')) {
return true;
}
$stage = (int)$stage;
$stat = $this->checkWorkspaceCurrent();
$accessType = $stat['_ACCESS'];
// Workspace owners are always allowed for stage change
if ($accessType === 'owner') {
return true;
}
// Check if custom staging is activated
$workspaceRec = BackendUtility::getRecord('sys_workspace', $stat['uid']);
if ($workspaceRec['custom_stages'] > 0 && $stage !== 0 && $stage !== -10) {
// Get custom stage record
$workspaceStageRec = BackendUtility::getRecord('sys_workspace_stage', $stage);
// Check if the user is responsible for the current stage
if (
$accessType === 'member'
&& GeneralUtility::inList($workspaceStageRec['responsible_persons'], 'be_users_' . $this->user['uid'])
) {
return true;
}
// Check if the user is in a group which is responsible for the current stage
foreach ($this->userGroupsUID as $groupUid) {
if (
$stat['_ACCESS'] === 'owner'
|| $stat['_ACCESS'] === 'member' && $stage <= $memberStageLimit
$accessType === 'member'
&& GeneralUtility::inList($workspaceStageRec['responsible_persons'], 'be_groups_' . $groupUid)
) {
return true;
}
}
} else {
// Always OK for live workspace.
} elseif ($stage === -10 || $stage === -20) {
// Nobody is allowed to do that except the owner (which was checked above)
return false;
} elseif (
$accessType === 'reviewer' && $stage <= 1
|| $accessType === 'member' && $stage <= 0
) {
return true;
}
return false;
......@@ -1113,25 +1157,23 @@ class BackendUserAuthentication extends AbstractUserAuthentication
if ($this->isAdmin()) {
return true;
}
// If no access to workspace, of course you cannot publish!
$retVal = false;
$wsAccess = $this->checkWorkspace($wsid);
if ($wsAccess) {
switch ($wsAccess['uid']) {
case 0:
// Live workspace
// If access to Live workspace, no problem.
$retVal = true;
break;
default:
// Custom workspace
$retVal = $wsAccess['_ACCESS'] === 'owner' || $this->checkWorkspace(0) && !($wsAccess['publish_access'] & Permission::PAGE_EDIT);
// Either be an adminuser OR have access to online
// workspace which is OK as well as long as publishing
// access is not limited by workspace option.
}
// If no access to workspace, of course you cannot publish!
if ($wsAccess === false) {
return false;
}
return $retVal;
if ((int)$wsAccess['uid'] === 0) {
// If access to Live workspace, no problem.
return true;
}
// Custom workspaces
// 1. Owners can always publish
if ($wsAccess['_ACCESS'] === 'owner') {
return true;
}
// 2. User has access to online workspace which is OK as well as long as publishing
// access is not limited by workspace option.
return $this->checkWorkspace(0) && !($wsAccess['publish_access'] & 2);
}
/**
......@@ -1142,10 +1184,15 @@ class BackendUserAuthentication extends AbstractUserAuthentication
*/
public function workspaceSwapAccess()
{
if ($this->workspace > 0 && (int)$this->workspaceRec['swap_modes'] === 2) {
return false;
// Always possible in live workspace
if ($this->workspace === 0) {
return true;
}
return true;
// In custom workspaces, only possible if swap_modes flag is not "2" (explicitly disabling swapping)
if ((int)$this->workspaceRec['swap_modes'] !== 2) {
return true;
}
return false;
}
/**
......
......@@ -934,14 +934,8 @@ class DataHandler implements LoggerAwareInterface
$this->newlog('recordEditAccessInternals() check failed. [' . $this->BE_USER->errorMsg . ']', 1);
} elseif (!$this->bypassWorkspaceRestrictions) {
// Workspace related processing:
// If LIVE records cannot be created in the current PID due to workspace restrictions, prepare creation of placeholder-record
if ($res = $this->BE_USER->workspaceAllowLiveRecordsInPID($theRealPid, $table)) {
if ($res < 0) {
$recordAccess = false;
$this->newlog('Stage for versioning root point and users access level did not allow for editing', 1);
}
} else {
// So, if no live records were allowed, we have to create a new version of this record:
// If LIVE records cannot be created due to workspace restrictions, prepare creation of placeholder-record
if (!$this->BE_USER->workspaceAllowsLiveEditingInTable($table)) {
if (BackendUtility::isTableWorkspaceEnabled($table)) {
$createNewVersion = true;
} else {
......@@ -988,9 +982,9 @@ class DataHandler implements LoggerAwareInterface
$recordAccess = false;
// Versioning is required and it must be offline version!
// Check if there already is a workspace version
$WSversion = BackendUtility::getWorkspaceVersionOfRecord($this->BE_USER->workspace, $table, $id, 'uid,t3ver_oid');
if ($WSversion) {
$id = $WSversion['uid'];
$workspaceVersion = BackendUtility::getWorkspaceVersionOfRecord($this->BE_USER->workspace, $table, $id, 'uid,t3ver_oid');
if ($workspaceVersion) {
$id = $workspaceVersion['uid'];
$recordAccess = true;
} elseif ($this->BE_USER->workspaceAllowAutoCreation($table, $id, $theRealPid)) {
// new version of a record created in a workspace - so always refresh pagetree to indicate there is a change in the workspace
......@@ -1003,7 +997,7 @@ class DataHandler implements LoggerAwareInterface
$cmd = [];
$cmd[$table][$id]['version'] = [
'action' => 'new',
// Default is to create a version of the individual records... element versioning that is.
// Default is to create a version of the individual records
'label' => 'Auto-created for WS #' . $this->BE_USER->workspace
];
$tce->start([], $cmd, $this->BE_USER);
......@@ -1112,7 +1106,7 @@ class DataHandler implements LoggerAwareInterface
// Setting placeholder state value for temporary record
$newVersion_placeholderFieldArray['t3ver_state'] = (string)new VersionState(VersionState::NEW_PLACEHOLDER);
// Setting workspace - only so display of place holders can filter out those from other workspaces.
// Setting workspace - only so display of placeholders can filter out those from other workspaces.
$newVersion_placeholderFieldArray['t3ver_wsid'] = $this->BE_USER->workspace;
$newVersion_placeholderFieldArray[$GLOBALS['TCA'][$table]['ctrl']['label']] = $this->getPlaceholderTitleForTableLabel($table);
// Saving placeholder as 'original'
......@@ -5149,7 +5143,7 @@ class DataHandler implements LoggerAwareInterface
if ($this->isElementToBeDeleted($table, $id)) {
return null;
}
if (!$GLOBALS['TCA'][$table] || !BackendUtility::isTableWorkspaceEnabled($table) || $id <= 0) {
if (!BackendUtility::isTableWorkspaceEnabled($table) || $id <= 0) {
$this->newlog('Versioning is not supported for this table "' . $table . '" / ' . $id, 1);
return null;
}
......
......@@ -236,13 +236,9 @@ class DataHandlerHook
} else {
$dataHandler->newlog('Versioning not enabled for record with an online ID (t3ver_oid) given', 2);
}
} elseif ($res = $dataHandler->BE_USER->workspaceAllowLiveRecordsInPID($record['pid'], $table)) {
// Look, if record is "online" or in a versionized branch, then delete directly.
if ($res > 0) {
$dataHandler->deleteEl($table, $id);
} else {
$dataHandler->newlog('Stage of root point did not allow for deletion', 1);
}
} elseif ($dataHandler->BE_USER->workspaceAllowsLiveEditingInTable($table)) {
// Look, if record is "online" then delete directly.
$dataHandler->deleteEl($table, $id);
} elseif ($recordVersionState->equals(VersionState::MOVE_PLACEHOLDER)) {
// Placeholders for moving operations are deletable directly.
// Get record which its a placeholder for and reset the t3ver_state of that:
......@@ -318,6 +314,7 @@ class DataHandlerHook
if ($dataHandler->BE_USER->workspace === 0) {
return;
}
$tableSupportsVersioning = BackendUtility::isTableWorkspaceEnabled($table);
if ($destPid < 0) {
// Fetch move placeholder, since it might point to a new page in the current workspace
$movePlaceHolder = BackendUtility::getMovePlaceholder($table, abs($destPid), 'uid,pid');
......@@ -331,7 +328,7 @@ class DataHandlerHook
$workspaceVersion = BackendUtility::getWorkspaceVersionOfRecord($dataHandler->BE_USER->workspace, $table, $uid, 'uid,t3ver_oid');
// Handle move-placeholders if the current record is not one already
if (
BackendUtility::isTableWorkspaceEnabled($table)
$tableSupportsVersioning
&& !$moveRecVersionState->equals(VersionState::MOVE_PLACEHOLDER)
) {
// Create version of record first, if it does not exist
......@@ -352,32 +349,27 @@ class DataHandlerHook
$workspaceAccessBlocked = [];
// Element was in "New/Deleted/Moved" so it can be moved...
$recIsNewVersion = $moveRecVersionState->indicatesPlaceholder();
$destRes = $dataHandler->BE_USER->workspaceAllowLiveRecordsInPID($resolvedPid, $table);
$canMoveRecord = ($recIsNewVersion || BackendUtility::isTableWorkspaceEnabled($table));
$recordMustNotBeVersionized = $dataHandler->BE_USER->workspaceAllowsLiveEditingInTable($table);
$canMoveRecord = $recIsNewVersion || $tableSupportsVersioning;
// Workspace source check:
if (!$recIsNewVersion) {
$errorCode = $dataHandler->BE_USER->workspaceCannotEditRecord($table, $workspaceVersion['uid'] ?: $uid);
if ($errorCode) {
$workspaceAccessBlocked['src1'] = 'Record could not be edited in workspace: ' . $errorCode . ' ';
} elseif (!$canMoveRecord && $dataHandler->BE_USER->workspaceAllowLiveRecordsInPID($moveRec['pid'], $table) <= 0) {
} elseif (!$canMoveRecord && !$recordMustNotBeVersionized) {
$workspaceAccessBlocked['src2'] = 'Could not remove record from table "' . $table . '" from its page "' . $moveRec['pid'] . '" ';
}
}
// Workspace destination check:
// All records can be inserted if $destRes is greater than zero.
// Only new versions can be inserted if $destRes is FALSE.
// NO RECORDS can be inserted if $destRes is negative which indicates a stage
// not allowed for use. If "versioningWS" is version 2, moving can take place of versions.
// since TYPO3 CMS 7, version2 is the default and the only option
if (!($destRes > 0 || $canMoveRecord && !$destRes)) {
// All records can be inserted if $recordMustNotBeVersionized is true.
// Only new versions can be inserted if $recordMustNotBeVersionized is FALSE.
if (!($recordMustNotBeVersionized || $canMoveRecord && !$recordMustNotBeVersionized)) {
$workspaceAccessBlocked['dest1'] = 'Could not insert record from table "' . $table . '" in destination PID "' . $resolvedPid . '" ';
} elseif ($destRes == 1 && $workspaceVersion['uid']) {
$workspaceAccessBlocked['dest2'] = 'Could not insert other versions in destination PID ';
}
if (empty($workspaceAccessBlocked)) {
// If the move operation is done on a versioned record, which is
// NOT new/deleted placeholder and versioningWS is in version 2, then...
// since TYPO3 CMS 7, version2 is the default and the only option
// NOT new/deleted placeholder, then also create a move placeholder
if ($workspaceVersion['uid'] && !$recIsNewVersion && BackendUtility::isTableWorkspaceEnabled($table)) {
$this->moveRecord_wsPlaceholders($table, (int)$uid, (int)$destPid, (int)$workspaceVersion['uid'], $dataHandler);
} else {
......
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