diff --git a/typo3/sysext/core/Classes/DataHandling/DataHandler.php b/typo3/sysext/core/Classes/DataHandling/DataHandler.php index eee662c0c706..1c6c586c54b9 100644 --- a/typo3/sysext/core/Classes/DataHandling/DataHandler.php +++ b/typo3/sysext/core/Classes/DataHandling/DataHandler.php @@ -3774,6 +3774,10 @@ protected function copyRecord_processInline( $newId = $this->copyRecord($v['table'], $v['id'], $realDestPid); } } + } elseif ($this->BE_USER->workspace > 0 && !BackendUtility::isTableWorkspaceEnabled($v['table'])) { + // We are in workspace context creating a new parent version and have a child table + // that is not workspace aware. We don't do anything with this child. + continue; } else { // If a record has been copied already during this request, // prevent superfluous duplication and use the existing copy diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/AbstractActionTestCase.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/AbstractActionTestCase.php index 08d6182c5361..ed1a5276ac6b 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/AbstractActionTestCase.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/AbstractActionTestCase.php @@ -60,6 +60,15 @@ public function deleteParentContentAndDiscardDeletedParent() * IRRE Child Records */ + /** + * See DataSet/changeHotelSortingWithOfferNotWorkspaceAware.csv + */ + public function changeHotelSortingWithOfferNotWorkspaceAware() + { + $GLOBALS['TCA']['tx_irretutorial_1ncsv_offer']['ctrl']['versioningWS'] = false; + $this->actionService->moveRecord(self::TABLE_Hotel, self::VALUE_HotelIdFirst, -self::VALUE_HotelIdSecond); + } + /** * See DataSet/createAndCopyParentContentRecordWithHotelAndOfferChildRecordsAndDiscardCopiedParentRecord.csv */ diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Modify/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Modify/ActionTest.php index 7aef4e31414c..87f0bf36209e 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Modify/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Modify/ActionTest.php @@ -263,6 +263,29 @@ public function copyPageWithHotelBeforeParentContent() * IRRE Child Records */ + /** + * @test + * See DataSet/changeHotelSortingWithOfferNotWorkspaceAware.csv + */ + public function changeHotelSortingWithOfferNotWorkspaceAware() + { + parent::changeHotelSortingWithOfferNotWorkspaceAware(); + $this->assertAssertionDataSet('changeHotelSortingWithOfferNotWorkspaceAware'); + + $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections(); + self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint() + ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2')); + self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint() + ->setRecordIdentifier(self::TABLE_Hotel . ':' . self::VALUE_HotelIdFirst)->setRecordField(self::FIELD_HotelOffer) + ->setTable(self::TABLE_Offer)->setField('title')->setValues('Offer #1.1')); + self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint() + ->setRecordIdentifier(self::TABLE_Hotel . ':' . self::VALUE_HotelIdFirst)->setRecordField(self::FIELD_HotelOffer) + ->setTable(self::TABLE_Offer)->setField('title')->setValues('Offer #1.2')); + self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint() + ->setRecordIdentifier(self::TABLE_Hotel . ':' . self::VALUE_HotelIdSecond)->setRecordField(self::FIELD_HotelOffer) + ->setTable(self::TABLE_Offer)->setField('title')->setValues('Offer #2.1')); + } + /** * @test * See DataSet/createParentContentRecordWithHotelAndOfferChildRecords.csv diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Modify/DataSet/changeHotelSortingWithOfferNotWorkspaceAware.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Modify/DataSet/changeHotelSortingWithOfferNotWorkspaceAware.csv new file mode 100644 index 000000000000..08f9577deddc --- /dev/null +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Modify/DataSet/changeHotelSortingWithOfferNotWorkspaceAware.csv @@ -0,0 +1,26 @@ +"tt_content",,,,,,,,,,,,, +,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","tx_irretutorial_1ncsv_hotels" +,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1","3,4" +,298,89,512,0,0,0,0,0,0,0,0,"Regular Element #2",5 +"tx_irretutorial_1ncsv_hotel",,,,,,,,,,,,, +,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","title","offers" +,3,89,256,0,0,0,0,0,0,0,0,"Hotel #1","5,6" +,4,89,128,0,0,0,0,0,0,0,0,"Hotel #2",7 +,5,89,64,0,0,0,0,0,0,0,0,"Hotel #1",8 +,6,89,256,0,0,0,1,4,0,3,0,"Hotel #1","5,6" +,7,89,192,0,0,0,1,3,0,0,3,"[MOVE-TO PLACEHOLDER for #3, WS#1]","5,6" +"tx_irretutorial_1ncsv_offer",,,,,,,,,,,,, +,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","title","prices" +,5,89,256,0,0,0,0,0,0,0,0,"Offer #1.1","7,8,9" +,6,89,128,0,0,0,0,0,0,0,0,"Offer #1.2","10,11" +,7,89,64,0,0,0,0,0,0,0,0,"Offer #2.1",12 +,8,89,32,0,0,0,0,0,0,0,0,"Offer #1.1",13 +"tx_irretutorial_1ncsv_price",,,,,,,,,,,,, +,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","title", +,7,89,256,0,0,0,0,0,0,0,0,"Price #1.1.1", +,8,89,128,0,0,0,0,0,0,0,0,"Price #1.1.2", +,9,89,64,0,0,0,0,0,0,0,0,"Price #1.1.3", +,10,89,32,0,0,0,0,0,0,0,0,"Price #1.2.1", +,11,89,16,0,0,0,0,0,0,0,0,"Price #1.2.2", +,12,89,8,0,0,0,0,0,0,0,0,"Price #2.1.1", +,13,89,4,0,0,0,0,0,0,0,0,"Price #1.1.1", diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/AbstractActionTestCase.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/AbstractActionTestCase.php index b5baae205627..d3938551a2e5 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/AbstractActionTestCase.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/AbstractActionTestCase.php @@ -60,6 +60,15 @@ public function deleteParentContentAndDiscardDeletedParent() * IRRE Child Records */ + /** + * See DataSet/changeHotelSortingWithOfferNotWorkspaceAware.csv + */ + public function changeHotelSortingWithOfferNotWorkspaceAware() + { + $GLOBALS['TCA']['tx_irretutorial_1nff_offer']['ctrl']['versioningWS'] = false; + $this->actionService->moveRecord(self::TABLE_Hotel, self::VALUE_HotelIdFirst, -self::VALUE_HotelIdSecond); + } + /** * See DataSet/createAndCopyParentContentRecordWithHotelAndOfferChildRecordsAndDiscardCopiedParentRecord.csv */ diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php index af7e9f32c65d..c45b163fdbed 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php @@ -263,6 +263,29 @@ public function copyPageWithHotelBeforeParentContent() * IRRE Child Records */ + /** + * @test + * See DataSet/changeHotelSortingWithOfferNotWorkspaceAware.csv + */ + public function changeHotelSortingWithOfferNotWorkspaceAware() + { + parent::changeHotelSortingWithOfferNotWorkspaceAware(); + $this->assertAssertionDataSet('changeHotelSortingWithOfferNotWorkspaceAware'); + + $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()'); + self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint() + ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2')); + self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint() + ->setRecordIdentifier(self::TABLE_Hotel . ':' . self::VALUE_HotelIdFirst)->setRecordField(self::FIELD_HotelOffer) + ->setTable(self::TABLE_Offer)->setField('title')->setValues('Offer #1.1')); + self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint() + ->setRecordIdentifier(self::TABLE_Hotel . ':' . self::VALUE_HotelIdFirst)->setRecordField(self::FIELD_HotelOffer) + ->setTable(self::TABLE_Offer)->setField('title')->setValues('Offer #1.2')); + self::assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint() + ->setRecordIdentifier(self::TABLE_Hotel . ':' . self::VALUE_HotelIdSecond)->setRecordField(self::FIELD_HotelOffer) + ->setTable(self::TABLE_Offer)->setField('title')->setValues('Offer #2.1')); + } + /** * @test * See DataSet/createParentContentRecordWithHotelAndOfferChildRecords.csv diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/changeHotelSortingWithOfferNotWorkspaceAware.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/changeHotelSortingWithOfferNotWorkspaceAware.csv new file mode 100644 index 000000000000..ae70412f29b3 --- /dev/null +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/changeHotelSortingWithOfferNotWorkspaceAware.csv @@ -0,0 +1,27 @@ +"tt_content",,,,,,,,,,,,,,,, +,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","tx_irretutorial_1nff_hotels",,, +,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1",2,,, +,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,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 +,6,89,1,0,0,0,1,4,0,3,0,"Hotel #1",297,"tt_content",,2 +,7,89,258,0,0,0,1,3,0,0,3,"[MOVE-TO PLACEHOLDER for #3, WS#1]",297,"tt_content",,0 +"tx_irretutorial_1nff_offer",,,,,,,,,,,,,,,, +,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","title","parentid","parenttable","parentidentifier","prices" +,5,89,1,0,0,0,0,0,0,0,0,"Offer #1.1",3,"tx_irretutorial_1nff_hotel",,3 +,6,89,2,0,0,0,0,0,0,0,0,"Offer #1.2",3,"tx_irretutorial_1nff_hotel",,2 +,7,89,1,0,0,0,0,0,0,0,0,"Offer #2.1",4,"tx_irretutorial_1nff_hotel",,1 +,8,89,1,0,0,0,0,0,0,0,0,"Offer #1.1",5,"tx_irretutorial_1nff_hotel",,1 +"tx_irretutorial_1nff_price",,,,,,,,,,,,,,,, +,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","title","parentid","parenttable","parentidentifier", +,7,89,1,0,0,0,0,0,0,0,0,"Price #1.1.1",5,"tx_irretutorial_1nff_offer",, +,8,89,2,0,0,0,0,0,0,0,0,"Price #1.1.2",5,"tx_irretutorial_1nff_offer",, +,9,89,3,0,0,0,0,0,0,0,0,"Price #1.1.3",5,"tx_irretutorial_1nff_offer",, +,10,89,1,0,0,0,0,0,0,0,0,"Price #1.2.1",6,"tx_irretutorial_1nff_offer",, +,11,89,2,0,0,0,0,0,0,0,0,"Price #1.2.2",6,"tx_irretutorial_1nff_offer",, +,12,89,1,0,0,0,0,0,0,0,0,"Price #2.1.1",7,"tx_irretutorial_1nff_offer",, +,13,89,1,0,0,0,0,0,0,0,0,"Price #1.1.1",8,"tx_irretutorial_1nff_offer",,