[BUGFIX] Inline references are bound to versioned page 43/52343/2
authorOliver Hader <oliver@typo3.org>
Mon, 3 Apr 2017 16:25:59 +0000 (18:25 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Mon, 3 Apr 2017 17:19:33 +0000 (19:19 +0200)
When modifying inline child elements that belong to a page
as parent record in a workspace, the pid values of these
inline children are bound to the page version instead of
the according counterpart (real record or placeholder)
of the live workspace.

Change-Id: I113b5c36672e767d4151f8a41ff9c5fa20b11877
Resolves: #80663
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/52343
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 dbee5f8..809d436 100644 (file)
@@ -5933,6 +5933,11 @@ class DataHandler
                 }
                 // Update child records if change to pid is required (only if the current record is not on a workspace):
                 if ($thePidToUpdate) {
+                    // ensure, only live page ids are used as 'pid' values
+                    $liveId = BackendUtility::getLiveVersionIdOfRecord('pages', $theUidToUpdate);
+                    if ($liveId !== null) {
+                        $thePidToUpdate = $liveId;
+                    }
                     $updateValues = ['pid' => $thePidToUpdate];
                     foreach ($originalItemArray as $v) {
                         if ($v['id'] && $v['table'] && is_null(BackendUtility::getLiveVersionIdOfRecord($v['table'], $v['id']))) {