93028[BUGFIX] Apply request language to new child records
Commit message
Review
-
Code review CR -1
- Benni Mack -1
-
Verified V 0
- core-ci +1 CI
Issues 1
Files 40
- typo3/sysext/core/Classes/Database/RelationHandler.php+25 −2
- typo3/sysext/core/Classes/DataHandling/DataHandler.php+33 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/Modify/DataSet/createParentWithAllLangsAndAddFileReferenceBeforeFirstSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/Modify/DataSet/createParentWithNonDefaultLanguageAndAddFileReferenceBeforeFirstSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/Modify/DataSet/modifyParentChangeLanguageBetweenNonDefaultLangsAndAddFileReferenceBeforeSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/Modify/DataSet/modifyParentChangeLanguageFromAllLangsToNonDefaultAndAddFileReferenceBeforeSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/Modify/DataSet/modifyParentChangeLanguageFromDefaultToAllLangsAndAddFileReferenceBeforeSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/Modify/DataSet/modifyParentChangeLanguageFromDefaultToNonDefaultAndAddFileReferenceBeforeSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/Modify/DataSet/modifyParentChangeLanguageFromNonDefaultToAllLangsAndAddFileReferenceBeforeSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/Modify/DataSet/switchParentFromAllLangsToDefaultAfterFirstSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/Modify/DataSet/switchParentFromDefaultToAllLangsAfterFirstSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/Modify/DataSet/switchParentFromDefaultToAllLangsAfterFirstSaveKeepLocalizedChildLang.csvnew+13 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/Modify/DataSet/switchParentFromDefaultToNonDefaultAfterFirstSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/Modify/DataSet/switchParentFromDefaultToNonDefaultAfterFirstSaveKeepLocalizedChildLang.csvnew+13 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/Modify/DataSet/switchParentFromNonDefaultToAllLangsAfterFirstSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/Modify/ActionTest.php+98 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/WorkspacesModify/DataSet/switchParentDefToNonDefAfterFirstSaveKeepLocChildInWs.csvnew+13 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/WorkspacesModify/DataSet/switchParentFromNonDefaultToAllLangsAfterFirstSaveInWorkspace.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/WorkspacesModify/ActionTest.php+14 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/AbstractActionTestCase.php+415 −0
Show 20 more files
- typo3/sysext/core/Tests/Functional/DataScenarios/FAL/AbstractActionWorkspacesTestCase.php+10 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/Modify/DataSet/createParentWithAllLangsAndAddHotelChildBeforeFirstSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/Modify/DataSet/createParentWithNonDefaultLanguageAndAddHotelChildBeforeFirstSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/Modify/DataSet/modifyParentChangeLangBetweenNonDefaultLangsAndAddChildBeforeSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/Modify/DataSet/modifyParentChangeLangFromAllLangsToNonDefaultAndAddChildBeforeSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/Modify/DataSet/modifyParentChangeLangFromDefaultToAllLangsAndAddChildBeforeSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/Modify/DataSet/modifyParentChangeLangFromDefaultToNonDefaultAndAddChildBeforeSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/Modify/DataSet/modifyParentChangeLangFromNonDefaultToAllLangsAndAddChildBeforeSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/Modify/DataSet/switchParentFromAllLangsToDefaultAfterFirstSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/Modify/DataSet/switchParentFromDefaultToAllLangsAfterFirstSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/Modify/DataSet/switchParentFromDefaultToAllLangsAfterFirstSaveKeepLocalizedChildLang.csvnew+13 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/Modify/DataSet/switchParentFromDefaultToNonDefaultAfterFirstSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/Modify/DataSet/switchParentFromDefaultToNonDefaultAfterFirstSaveKeepLocalizedChildLang.csvnew+13 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/Modify/DataSet/switchParentFromNonDefaultToAllLangsAfterFirstSave.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/Modify/ActionTest.php+98 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/WorkspacesModify/DataSet/switchParentDefToNonDefAfterFirstSaveKeepLocChildInWs.csvnew+13 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/WorkspacesModify/DataSet/switchParentFromNonDefaultToAllLangsAfterFirstSaveInWs.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/WorkspacesModify/ActionTest.php+14 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/AbstractActionTestCase.php+395 −0
- typo3/sysext/core/Tests/Functional/DataScenarios/IrreForeignField/AbstractActionWorkspacesTestCase.php+10 −0
Review log 1319
-
Eric Harrer uploaded patch set 1 02/27/26, 16:59
-
core-ci voted on patch set 1 V +1 02/27/26, 17:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96983
-
Eric Harrer commented on patch set 1 CR -1 V -1 03/02/26, 08:58
Upon further examination, I noticed that the problem is more widespread. In general, it can be said that if the language of a parent record is changed and a child record is created before saving, the child record will receive the previous language of the parent record instead of the newly set language when saved. I’m on it. -
Eric Harrer uploaded patch set 2
CR -1V +103/02/26, 12:18 -
Eric Harrer commented on patch set 2 03/02/26, 12:22
The fix now covers the broader issue I pointed out: if a parent record changes `sys_language_uid` and child relations are created before the parent is persisted, child records now use the incoming parent language from the same request. Implementation-wise, `DataHandler` forwards the incoming parent language for `foreign_field` relations, and `RelationHandler` applies it only to new untranslated child rows (`l10n_parent = 0`), so existing localized child rows remain unchanged. Functional coverage was expanded for both FAL and IRRE scenarios (new parent + existing parent with language changes before save) -
core-ci voted on patch set 2 V -1 03/02/26, 12:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97100
-
Eric Harrer uploaded patch set 3
V -103/02/26, 12:40 -
core-ci voted on patch set 3 V +1 03/02/26, 12:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97102
-
Eric Harrer uploaded patch set 4
V +103/04/26, 21:56 -
core-ci voted on patch set 4 V +1 03/04/26, 22:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97367
-
André Buchmann voted on patch set 4 CR +1 V +1 03/06/26, 21:32
-
Benni Mack updated the commit message in patch set 5
CR +1V +104/22/26, 06:41 -
core-ci voted on patch set 5 V -1 04/22/26, 10:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100763
-
Eric Harrer rebased onto patch set 6
V -104/23/26, 10:48 -
core-ci voted on patch set 6 V +1 04/23/26, 11:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101028
-
Benni Mack commented on patch set 6 CR -1 11/08/26, 19:47
I don't think we need this change anymore... can you please re-check? I took Sybille's work back then and finalized it: https://review.typo3.org/c/Packages/TYPO3.CMS/+/87595 -
André Buchmann commented on patch set 6 11/09/26, 08:45
Reply
@info@eric-harrer.de I ran the tests from this patch against new main without the DH/RelationHandler changes of this test. Result: 26 pass, 6 fail. - Passing: all childInheritsTargetLanguage* and childFollowsTargetLanguage* tests - Failing: all localizedChildKeepsLanguage* tests Claude: These go against what 87595 deliberately decided. The setup attaches a child with sys_language_uid=1, l10n_parent=130 to a default-language parent, then switches the parent's language. 93028 expects the child to keep language 1, leaving one parent with children in two languages. 87595 says children always take their parent's language, and that children moved to the default language or to "all languages" get their translation pointers reset. Main therefore gives sys_language_uid=2 (or -1), l10n_parent=0. 87595's commit message calls the old behavior a bug. Side note: in those failing setups, main stores image=1 on the parent even though both file references still point to it. The setup is a parent/child state 87595 treats as invalid. -- My conclusion: As #87595 made the decision to change the behavior, I think this patch is obsolete. -
Eric Harrer commented on patch set 6 11/11/26, 11:21
Reply
You're right, this patch is obsolete now. I'll abandon it. I deliberately kept its scope narrow to make it easier to review, but Sybille's solution goes further and is closer to our original goal. -
Eric Harrer abandoned the change 11/11/26, 11:22
This is fixed by https://review.typo3.org/c/Packages/TYPO3.CMS/+/87595