[BUGFIX] Computed properties are queried in workspace context 92/45492/2
authorOliver Hader <oliver@typo3.org>
Tue, 29 Dec 2015 15:58:50 +0000 (16:58 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 30 Dec 2015 15:45:54 +0000 (16:45 +0100)
This is a follow-up to issue #68643 to sanitize all places that
reuse the fields (including the computed properties) of a record.

Resolves: #66135
Releases: master, 7.6, 6.2
Change-Id: Ifb57193ff07e3d9ddae50568a0dce741f9aaf12d
Reviewed-on: https://review.typo3.org/45492
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/frontend/Classes/Page/PageRepository.php

index 47b185b..ac69829 100644 (file)
@@ -378,7 +378,7 @@ class PageRepository
             $origPage = reset($pagesInput);
             if (is_array($origPage)) {
                 // Make sure that only fields which exist in the first incoming record are overlaid!
-                $fieldArr = array_intersect($fieldArr, array_keys($origPage));
+                $fieldArr = array_intersect($fieldArr, array_keys($this->purgeComputedProperties($origPage)));
             }
             foreach ($pagesInput as $origPage) {
                 if (is_array($origPage)) {
@@ -1406,7 +1406,7 @@ class PageRepository
             }
             // Find pointed-to record.
             if ($moveID) {
-                $res = $this->getDatabaseConnection()->exec_SELECTquery(implode(',', array_keys($row)), $table, 'uid=' . (int)$moveID . $this->enableFields($table));
+                $res = $this->getDatabaseConnection()->exec_SELECTquery(implode(',', array_keys($this->purgeComputedProperties($row))), $table, 'uid=' . (int)$moveID . $this->enableFields($table));
                 $origRow = $this->getDatabaseConnection()->sql_fetch_assoc($res);
                 $this->getDatabaseConnection()->sql_free_result($res);
                 if ($origRow) {