[BUGFIX] Inline references are bound to versioned page 42/52342/4
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:20 +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/52342
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
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/deletePage.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/modifyPage.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Publish/DataSet/deletePage.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Publish/DataSet/modifyPage.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/PublishAll/DataSet/deletePage.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/PublishAll/DataSet/modifyPage.csv

index f58595c..801907d 100644 (file)
@@ -6054,6 +6054,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']))) {
index 823bfbb..753af65 100644 (file)
@@ -11,7 +11,7 @@ tt_content
 ,298,89,512,0,0,0,0,0,0,0,0,"Regular Element #2",1
 tx_irretutorial_1nff_hotel
 ,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier,offers
-,2,91,1,0,0,0,0,0,0,0,0,"Hotel #0",89,pages,,0
+,2,89,1,0,0,0,0,0,0,0,0,"Hotel #0",89,pages,,0
 ,3,89,1,0,0,0,0,0,0,0,0,"Hotel #1",297,tt_content,,2
 ,4,89,2,0,0,0,0,0,0,0,0,"Hotel #2",297,tt_content,,1
 ,5,89,1,0,0,0,0,0,0,0,0,"Hotel #1",298,tt_content,,1
index d1cf8c0..f6f7980 100644 (file)
@@ -11,7 +11,7 @@ tt_content
 ,298,89,512,0,0,0,0,0,0,0,0,"Regular Element #2",1
 tx_irretutorial_1nff_hotel
 ,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier,offers
-,2,91,1,0,0,0,0,0,0,0,0,"Hotel #0",89,pages,,0
+,2,89,1,0,0,0,0,0,0,0,0,"Hotel #0",89,pages,,0
 ,3,89,1,0,0,0,0,0,0,0,0,"Hotel #1",297,tt_content,,2
 ,4,89,2,0,0,0,0,0,0,0,0,"Hotel #2",297,tt_content,,1
 ,5,89,1,0,0,0,0,0,0,0,0,"Hotel #1",298,tt_content,,1
index 2f0215f..b37b71a 100644 (file)
@@ -11,7 +11,7 @@ tt_content
 ,298,89,1000000000,1,0,0,0,0,0,0,0,"Regular Element #2",1
 tx_irretutorial_1nff_hotel
 ,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier,offers
-,2,91,1000000000,1,0,0,0,0,0,0,0,"Hotel #0",89,pages,,0
+,2,89,1000000000,1,0,0,0,0,0,0,0,"Hotel #0",89,pages,,0
 ,3,89,1000000000,1,0,0,0,0,0,0,0,"Hotel #1",297,tt_content,,2
 ,4,89,1000000000,1,0,0,0,0,0,0,0,"Hotel #2",297,tt_content,,1
 ,5,89,1000000000,1,0,0,0,0,0,0,0,"Hotel #1",298,tt_content,,1
index 2b0084f..b181740 100644 (file)
@@ -11,7 +11,7 @@ tt_content
 ,298,89,512,0,0,0,0,0,0,0,0,"Regular Element #2",1
 tx_irretutorial_1nff_hotel
 ,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier,offers
-,2,91,1,0,0,0,0,0,0,0,0,"Hotel #0",89,pages,,0
+,2,89,1,0,0,0,0,0,0,0,0,"Hotel #0",89,pages,,0
 ,3,89,1,0,0,0,0,0,0,0,0,"Hotel #1",297,tt_content,,2
 ,4,89,2,0,0,0,0,0,0,0,0,"Hotel #2",297,tt_content,,1
 ,5,89,1,0,0,0,0,0,0,0,0,"Hotel #1",298,tt_content,,1
index 2f0215f..b37b71a 100644 (file)
@@ -11,7 +11,7 @@ tt_content
 ,298,89,1000000000,1,0,0,0,0,0,0,0,"Regular Element #2",1
 tx_irretutorial_1nff_hotel
 ,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier,offers
-,2,91,1000000000,1,0,0,0,0,0,0,0,"Hotel #0",89,pages,,0
+,2,89,1000000000,1,0,0,0,0,0,0,0,"Hotel #0",89,pages,,0
 ,3,89,1000000000,1,0,0,0,0,0,0,0,"Hotel #1",297,tt_content,,2
 ,4,89,1000000000,1,0,0,0,0,0,0,0,"Hotel #2",297,tt_content,,1
 ,5,89,1000000000,1,0,0,0,0,0,0,0,"Hotel #1",298,tt_content,,1
index 2b0084f..b181740 100644 (file)
@@ -11,7 +11,7 @@ tt_content
 ,298,89,512,0,0,0,0,0,0,0,0,"Regular Element #2",1
 tx_irretutorial_1nff_hotel
 ,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier,offers
-,2,91,1,0,0,0,0,0,0,0,0,"Hotel #0",89,pages,,0
+,2,89,1,0,0,0,0,0,0,0,0,"Hotel #0",89,pages,,0
 ,3,89,1,0,0,0,0,0,0,0,0,"Hotel #1",297,tt_content,,2
 ,4,89,2,0,0,0,0,0,0,0,0,"Hotel #2",297,tt_content,,1
 ,5,89,1,0,0,0,0,0,0,0,0,"Hotel #1",298,tt_content,,1