diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-82701-AlwaysConsiderPublishingReferencesInWorkspaces.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-82701-AlwaysConsiderPublishingReferencesInWorkspaces.rst new file mode 100644 index 0000000000000000000000000000000000000000..9959695df20209bad93283e54386e0ec1f5370a1 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-82701-AlwaysConsiderPublishingReferencesInWorkspaces.rst @@ -0,0 +1,39 @@ +.. include:: ../../Includes.txt + +====================================================================== +Breaking: #82701 - Always consider publishing references in workspaces +====================================================================== + +See :issue:`82701` + +Description +=========== + +The TSconfig option `options.workspaces.considerReferences` to disable references when publishing +records from a workspace has been removed. + +The according method `TYPO3\CMS\Version\DataHandler\CommandMap::setWorkspacesConsiderReferences()` +has been removed. + + +Impact +====== + +Disabling this setting will have no effect anymore, thus publishing records will always +publish relations e.g. in IRRE relations as well. + +Calling the removed PHP method will throw a PHP fatal error. + + +Affected Installations +====================== + +Installations with workspaces enabled, having the TSconfig option explicitly disabled. + + +Migration +========= + +Remove any calls to the method, as it has no effect anymore. + +.. index:: TSConfig, PartiallyScanned diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php index 5d8a5c4c63fbe1f5b972b6dd4177ffdb309a4b18..6da30b7d695f7fd17c4d9298c32176a68f49107a 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php @@ -1261,4 +1261,11 @@ return [ 'Breaking-80700-DeprecatedFunctionalityRemoved.rst', ], ], + 'TYPO3\CMS\Version\DataHandler\CommandMap->setWorkspacesConsiderReferences' => [ + 'numberOfMandatoryArguments' => 0, + 'maximumNumberOfArguments' => 0, + 'restFiles' => [ + 'Breaking-82701-AlwaysConsiderPublishingReferencesInWorkspaces.rst', + ], + ], ]; diff --git a/typo3/sysext/version/Classes/DataHandler/CommandMap.php b/typo3/sysext/version/Classes/DataHandler/CommandMap.php index d4197f2b78975e5312c0c854e88e2ae5cc008b6e..3f2315f912e6ff3e8d8562f310e31747e5eb93cf 100644 --- a/typo3/sysext/version/Classes/DataHandler/CommandMap.php +++ b/typo3/sysext/version/Classes/DataHandler/CommandMap.php @@ -27,14 +27,11 @@ class CommandMap const SCOPE_WorkspacesSwap = 'SCOPE_WorkspacesSwap'; const SCOPE_WorkspacesSetStage = 'SCOPE_WorkspacesSetStage'; const SCOPE_WorkspacesClear = 'SCOPE_WorkspacesClear'; - const KEY_ScopeErrorMessage = 'KEY_ScopeErrorMessage'; - const KEY_ScopeErrorCode = 'KEY_ScopeErrorCode'; const KEY_GetElementPropertiesCallback = 'KEY_GetElementPropertiesCallback'; const KEY_GetCommonPropertiesCallback = 'KEY_GetCommonPropertiesCallback'; const KEY_ElementConstructCallback = 'KEY_EventConstructCallback'; const KEY_ElementCreateChildReferenceCallback = 'KEY_ElementCreateChildReferenceCallback'; const KEY_ElementCreateParentReferenceCallback = 'KEY_ElementCreateParentReferenceCallback'; - const KEY_PurgeWithErrorMessageGetIdCallback = 'KEY_PurgeWithErrorMessageGetIdCallback'; const KEY_UpdateGetIdCallback = 'KEY_UpdateGetIdCallback'; const KEY_TransformDependentElementsToUseLiveId = 'KEY_TransformDependentElementsToUseLiveId'; @@ -68,11 +65,6 @@ class CommandMap */ protected $workspacesChangeStageMode; - /** - * @var bool - */ - protected $workspacesConsiderReferences; - /** * @var array */ @@ -99,7 +91,6 @@ class CommandMap $this->setWorkspace($workspace); $this->setWorkspacesSwapMode($this->getTceMain()->BE_USER->getTSConfigVal('options.workspaces.swapMode')); $this->setWorkspacesChangeStageMode($this->getTceMain()->BE_USER->getTSConfigVal('options.workspaces.changeStageMode')); - $this->setWorkspacesConsiderReferences($this->getTceMain()->BE_USER->getTSConfigVal('options.workspaces.considerReferences')); $this->constructScopes(); } @@ -215,19 +206,6 @@ class CommandMap return $this; } - /** - * Sets the workspace behaviour to automatically consider references - * (see options.workspaces.considerReferences) - * - * @param bool $workspacesConsiderReferences - * @return \TYPO3\CMS\Version\DataHandler\CommandMap - */ - public function setWorkspacesConsiderReferences($workspacesConsiderReferences) - { - $this->workspacesConsiderReferences = (bool)$workspacesConsiderReferences; - return $this; - } - /** * Gets the element entity processor. * @@ -488,7 +466,7 @@ class CommandMap /** * Applies the workspaces dependencies and removes incomplete structures or automatically - * completes them, depending on the options.workspaces.considerReferences setting + * completes them * * @param \TYPO3\CMS\Version\Dependency\DependencyResolver $dependency * @param string $scope @@ -512,37 +490,11 @@ class CommandMap // and the evaluation of all dependent records that should be used for this action instead: $intersectingElements = array_intersect_key($dependentElements, $elementsToBeVersioned); if (!empty($intersectingElements)) { - // If at least one element intersects but not all, throw away all elements of the depdendent structure: - if (count($intersectingElements) !== count($dependentElements) && $this->workspacesConsiderReferences === false) { - $this->purgeWithErrorMessage($intersectingElements, $scope); - } else { - $this->update(current($intersectingElements), $dependentElements, $scope); - } + $this->update(current($intersectingElements), $dependentElements, $scope); } } } - /** - * Purges incomplete structures from the command map and triggers an error message. - * - * @param array $elements - * @param string $scope - */ - protected function purgeWithErrorMessage(array $elements, $scope) - { - /** @var $element ElementEntity */ - foreach ($elements as $element) { - $table = $element->getTable(); - $id = $this->processCallback($this->getScopeData($scope, self::KEY_PurgeWithErrorMessageGetIdCallback), [$element]); - $this->remove($table, $id, 'version'); - $this->getTceMain()->log($table, $id, 5, 0, 1, $this->getScopeData($scope, self::KEY_ScopeErrorMessage), $this->getScopeData($scope, self::KEY_ScopeErrorCode), [ - BackendUtility::getRecordTitle($table, BackendUtility::getRecord($table, $id)), - $table, - $id - ]); - } - } - /** * Updates the command map accordant to valid structures and takes care of the correct order. * @@ -757,9 +709,6 @@ class CommandMap $this->scopes = [ // settings for publishing and swapping: self::SCOPE_WorkspacesSwap => [ - // error message and error code - self::KEY_ScopeErrorMessage => 'Record "%s" (%s:%s) cannot be swapped or published independently, because it is related to other new or modified records.', - self::KEY_ScopeErrorCode => 1288283630, // callback functons used to modify the commandMap // + element properties are specific for each element // + common properties are the same for all elements @@ -770,8 +719,6 @@ class CommandMap // callback function used to determine whether an element is a valid child or parent reference (e.g. IRRE) self::KEY_ElementCreateChildReferenceCallback => 'createNewDependentElementChildReferenceCallback', self::KEY_ElementCreateParentReferenceCallback => 'createNewDependentElementParentReferenceCallback', - // callback function used to get the correct record uid to be used in the error message - self::KEY_PurgeWithErrorMessageGetIdCallback => 'getElementLiveIdCallback', // callback function used to fetch the correct record uid on modifying the commandMap self::KEY_UpdateGetIdCallback => 'getElementLiveIdCallback', // setting whether to use the uid of the live record instead of the workspace record @@ -779,9 +726,6 @@ class CommandMap ], // settings for modifying the stage: self::SCOPE_WorkspacesSetStage => [ - // error message and error code - self::KEY_ScopeErrorMessage => 'Record "%s" (%s:%s) cannot be sent to another stage independently, because it is related to other new or modified records.', - self::KEY_ScopeErrorCode => 1289342524, // callback functons used to modify the commandMap // + element properties are specific for each element // + common properties are the same for all elements @@ -792,8 +736,6 @@ class CommandMap // callback function used to determine whether an element is a valid child or parent reference (e.g. IRRE) self::KEY_ElementCreateChildReferenceCallback => 'createNewDependentElementChildReferenceCallback', self::KEY_ElementCreateParentReferenceCallback => 'createNewDependentElementParentReferenceCallback', - // callback function used to get the correct record uid to be used in the error message - self::KEY_PurgeWithErrorMessageGetIdCallback => 'getElementIdCallback', // callback function used to fetch the correct record uid on modifying the commandMap self::KEY_UpdateGetIdCallback => 'getElementIdCallback', // setting whether to use the uid of the live record instead of the workspace record @@ -801,9 +743,6 @@ class CommandMap ], // settings for clearing and flushing: self::SCOPE_WorkspacesClear => [ - // error message and error code - self::KEY_ScopeErrorMessage => 'Record "%s" (%s:%s) cannot be flushed independently, because it is related to other new or modified records.', - self::KEY_ScopeErrorCode => 1300467990, // callback functons used to modify the commandMap // + element properties are specific for each element // + common properties are the same for all elements @@ -814,8 +753,6 @@ class CommandMap // callback function used to determine whether an element is a valid child or parent reference (e.g. IRRE) self::KEY_ElementCreateChildReferenceCallback => 'createClearDependentElementChildReferenceCallback', self::KEY_ElementCreateParentReferenceCallback => 'createClearDependentElementParentReferenceCallback', - // callback function used to get the correct record uid to be used in the error message - self::KEY_PurgeWithErrorMessageGetIdCallback => 'getElementIdCallback', // callback function used to fetch the correct record uid on modifying the commandMap self::KEY_UpdateGetIdCallback => 'getElementIdCallback', // setting whether to use the uid of the live record instead of the workspace record diff --git a/typo3/sysext/workspaces/Documentation/Administration/Configuration/Index.rst b/typo3/sysext/workspaces/Documentation/Administration/Configuration/Index.rst index 01fc0b39c8e27c3da1df944b6e02a8adc98c006a..91fc8c06d38075c2ad66e86dab5c2f7becc4e5d3 100644 --- a/typo3/sysext/workspaces/Documentation/Administration/Configuration/Index.rst +++ b/typo3/sysext/workspaces/Documentation/Administration/Configuration/Index.rst @@ -243,21 +243,6 @@ Description .. _usertsconfig-options-workspaces-considerreferences: -considerReferences -****************** - -Data type - Boolean - -Description - If elements which are part of an interdependent structure (e.g. Inline - Relational Record Editing) are swapped, published or sent to a stage - alone, the whole related parent/child structure is taken into account - automatically. - -Default - 1 - allowed\_languages ****************** diff --git a/typo3/sysext/workspaces/ext_localconf.php b/typo3/sysext/workspaces/ext_localconf.php index 4005ec76cd5e0b479e32666e8f826ac129972f2d..3b119dc73b86b013e7fce50b113316081cafed9e 100644 --- a/typo3/sysext/workspaces/ext_localconf.php +++ b/typo3/sysext/workspaces/ext_localconf.php @@ -34,10 +34,7 @@ if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations } if (TYPO3_MODE === 'BE') { - // If publishing/swapping dependent parent-child references, consider all parents and children - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('options.workspaces.considerReferences = 1'); $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/tree/pagetree/class.t3lib_tree_pagetree_dataprovider.php']['postProcessCollections'][] = \TYPO3\CMS\Workspaces\Hooks\PagetreeCollectionsProcessor::class; - $GLOBALS['TYPO3_CONF_VARS']['BE']['toolbarItems'][1435433114] = \TYPO3\CMS\Workspaces\Backend\ToolbarItems\WorkspaceSelectorToolbarItem::class; // Registers preview link icon