[BUGFIX] Fix allowLanguageSynchronization on pages_language_overlay 50/54650/3
authorOliver Hader <oliver@typo3.org>
Wed, 15 Nov 2017 12:43:06 +0000 (13:43 +0100)
committerFrank Naegler <frank.naegler@typo3.org>
Thu, 16 Nov 2017 08:54:53 +0000 (09:54 +0100)
In case a TCA field uses allowLanguageSynchronization (or
l10n_mode=exclude) for table pages_language_overlay, dependencies
(localizations of the initial record) are processed that point to
the according pages_language_overlay. However pages_language_overlay
records cannot be localized further, they always depend on a single
pages record which is the record of the default language.

In case the backend is used as non-admin user that has a language
restriction ("Limit to languages" in backend groups/users settings),
an error message is shown:

    [newlog()] recordEditAccessInternals() check failed.
    [ERROR: Language was not allowed.]

In TYPO3 v8, all pages_language_overlay records are selected which match
the condition pages_language_overlay.pid = pages_language_overlay.uid
(pid is used as transOrigPointerField). In TYPO3 v9 this changed since
pages_language_overlay has been migrated into pages having a distinct
transOrigPointerField in l10n_parent.

Resolves: #83001
Releases: 8.7
Change-Id: Ie4dfdb44c3d6a9b89819f473816f3e062a685027
Reviewed-on: https://review.typo3.org/54650
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>

index dbc16bd..e697ad5 100644 (file)
@@ -173,10 +173,15 @@ class DataMapProcessor
-        $dependencies = $this->fetchDependencies(
-            $forTableName,
-            $this->filterNewItemIds($forTableName, array_keys($idValues))
-        );
+        $dependencies = [];
+        // Fetching dependent localizations does not make sense for pages_language_overlay
+        // (pages_language_overlay records depend on one page and cannot be localized further)
+        if ($tableName !== 'pages_language_overlay') {
+            $dependencies = $this->fetchDependencies(
+                $forTableName,
+                $this->filterNewItemIds($forTableName, array_keys($idValues))
+            );
+        }
         foreach ($idValues as $id => $values) {
             $item = $this->findItem($tableName, $id);