Subject: [PATCH] [BUGFIX] WS l10n_exclude fields --- Index: typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php b/typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php --- a/typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php (revision 10d2450119c37aa2379736d8a7c1390de9cee769) +++ b/typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php (revision a5dfe6bda4e661355187798a62fa62beceddda6d) @@ -199,6 +199,7 @@ 'l10n_state' => 'l10n_state', 'language' => $GLOBALS['TCA'][$tableName]['ctrl']['languageField'], 'parent' => $GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'], + 't3_origuid' => 't3_origuid', ]; if (!empty($GLOBALS['TCA'][$tableName]['ctrl']['translationSource'])) { $fieldNames['source'] = $GLOBALS['TCA'][$tableName]['ctrl']['translationSource']; @@ -213,12 +214,27 @@ ) ); + $modifiedIdValues = []; + foreach ($translationValues as $uid => $translationValue) { + if ($translationValue['t3_origuid'] > 0) { + $translationValue['uid'] = $translationValue['t3_origuid']; + $translationValue['backup_uid'] = $uid; + $modifiedIdValues[$translationValue['t3_origuid']] = $translationValue; + } else { + $modifiedIdValues[$uid] = $translationValue; + } + } + $dependencies = $this->fetchDependencies( $tableName, - $this->filterNewItemIds($tableName, array_keys($idValues)) + $this->filterNewItemIds($tableName, array_keys($modifiedIdValues)) ); - foreach ($idValues as $id => $values) { + foreach ($modifiedIdValues as $id => $values) { + $t3OrigUid = $id; + if (isset($values['backup_uid'])) { + $id = $values['backup_uid']; + } $item = $this->findItem($tableName, $id); // build item if it has not been created in a previous iteration if ($item === null) { @@ -242,8 +258,8 @@ continue; } // add dependencies - if (!empty($dependencies[$id])) { - $item->setDependencies($dependencies[$id]); + if (!empty($dependencies[$t3OrigUid])) { + $item->setDependencies($dependencies[$t3OrigUid]); } } // add item to $this->allItems and $this->nextItems @@ -641,7 +657,7 @@ $additionalInformation = ''; if (!empty($localDataHandler->errorLog)) { $additionalInformation = ', reason "' - . implode(', ', $localDataHandler->errorLog) . '"'; + . implode(', ', $localDataHandler->errorLog) . '"'; } throw new \RuntimeException( 'Child record was not processed' . $additionalInformation, @@ -1122,7 +1138,7 @@ $queryBuilder->getRestrictions() ->removeAll() ->add(GeneralUtility::makeInstance(DeletedRestriction::class)) - ->add(GeneralUtility::makeInstance(WorkspaceRestriction::class, $this->backendUser->workspace)); + ->add(GeneralUtility::makeInstance(WorkspaceRestriction::class, $this->backendUser->workspace, true)); $zeroParameter = $queryBuilder->createNamedParameter(0, Connection::PARAM_INT); $idsParameter = $queryBuilder->quoteArrayBasedValueListToIntegerList($idsChunked); @@ -1171,6 +1187,10 @@ ); } + if ($this->backendUser->workspace > 0) { + $predicates[] = $queryBuilder->expr()->eq('t3ver_wsid', $this->backendUser->workspace); + } + $statement = $queryBuilder ->select(...array_values($fieldNames)) ->from($tableName) @@ -1523,7 +1543,7 @@ && !empty($GLOBALS['TCA'][$configuration['foreign_table']]) ) || $this->isInlineRelationField($tableName, $fieldName) - ; + ; } /** @@ -1545,7 +1565,7 @@ $configuration['type'] === 'inline' && !empty($configuration['foreign_table']) && !empty($GLOBALS['TCA'][$configuration['foreign_table']]) - ; + ; } /** @@ -1560,8 +1580,8 @@ return State::isApplicable($tableName) || BackendUtility::isTableLocalizable($tableName) - && count($this->getLocalizationModeExcludeFieldNames($tableName)) > 0 - ; + && count($this->getLocalizationModeExcludeFieldNames($tableName)) > 0 + ; } /**