[BUGFIX] Ensure "pid" and "parentid" of pages - inline fields are correct 32/54632/6
authorBenni Mack <benni@typo3.org>
Mon, 13 Nov 2017 19:33:53 +0000 (20:33 +0100)
committerSusanne Moog <susanne.moog@typo3.org>
Wed, 15 Nov 2017 06:18:19 +0000 (07:18 +0100)
commit4770e0b787682dd5d3f18326834604dad370604b
tree8224d4bf257cd01de28601b73b6e5435a0ed9795
parentf6953bda186c1cb10d01b37a1e3071148b87b16c
[BUGFIX] Ensure "pid" and "parentid" of pages - inline fields are correct

When doing translations with pages and inline elements (e.g. pages.media),
there is an inconsistency when an additional inline element is added to the
TRANSLATED page (e.g. language=1).

Current (wrong) when adding a translation to a page
- localized IRRE children get pid = default page ID (correct)
- localized IRRE children only localization get parentid = default page ID (should be translated page ID)

Current (wrong) behaviour when adding a IRRE child only available in a translation:
- parentid gets localized page => correct
- pid gets set to localized page => must be default language

The patch corrects this behaviour by always set
- the relation (parentid) to the localized page ID
- the page ID (pid) to the default language page ID

Additionally, when adding an Inline element (IRRE) via AJAX
on page properties, the PID gets resolved correctly to be sent
to DataHandler.

Resolves: #82983
Releases: master
Change-Id: Id8bf39524ee608acf452e2b7103087d4299c1e28
Reviewed-on: https://review.typo3.org/54632
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Daniel Gorges <daniel.gorges@b13.de>
Tested-by: Daniel Gorges <daniel.gorges@b13.de>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInline.php
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/AbstractActionTestCase.php
typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php
typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/localizePageWithSynchronizationAndCustomLocalizedHotel.csv [new file with mode: 0644]