[BUGFIX] Use the real page id for doesPageHaveUnallowedTables check 72/54672/4
authorWolfgang Klinger <wolfgang@wazum.com>
Sat, 12 Aug 2017 18:53:00 +0000 (20:53 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 7 Mar 2018 18:43:54 +0000 (19:43 +0100)
In case of handling a translated page record, use the according
proper uid value of the containing page of default language.

Resolves: #82053
Releases: master, 8.7
Change-Id: I0d0b5a268f4b87ef44d892f046ef474624b18058
Reviewed-on: https://review.typo3.org/54672
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index 2f03162..3a40050 100644 (file)
@@ -1586,7 +1586,15 @@ class DataHandler
                 // This checks 1) if we should check for disallowed tables and 2) if there are records from disallowed tables on the current page
                 $onlyAllowedTables = isset($GLOBALS['PAGES_TYPES'][$value]['onlyAllowedTables']) ? $GLOBALS['PAGES_TYPES'][$value]['onlyAllowedTables'] : $GLOBALS['PAGES_TYPES']['default']['onlyAllowedTables'];
                 if ($onlyAllowedTables) {
-                    $theWrongTables = $this->doesPageHaveUnallowedTables($id, $value);
+                    // use the real page id (default language)
+                    if ($table !== 'pages_language_overlay') {
+                        $recordId = $id;
+                    } elseif ($realPid >= 0) {
+                        $recordId = $realPid;
+                    } else {
+                        $recordId = $tscPID;
+                    }
+                    $theWrongTables = $this->doesPageHaveUnallowedTables($recordId, $value);
                     if ($theWrongTables) {
                         if ($this->enableLogging) {
                             $propArr = $this->getRecordProperties($table, $id);