#61835Copying IRRE child records behaviour differs with certain TCA settings
Description
Having a parent record, that has child records via TCA type inline with foreign_field usage in the parent record table, the child records get duplicated on copying a parent record (which I would call an expectable behaviour from the editors point of view):
'children' => array(
'exclude' => 0,
'label' => 'LLL:EXT:test/Resources/Private/Language/locallang_db.xlf:tx_test_domain_model_testparent.children',
'config' => array(
'type' => 'inline',
'foreign_table' => 'tx_test_domain_model_testchild',
'foreign_field' => 'testparent',
'maxitems' => 9999,
'appearance' => array(
'collapseAll' => 0,
'levelLinksPosition' => 'top',
'showSynchronizationLink' => 1,
'showPossibleLocalizationRecords' => 1,
'showAllLocalizationLink' => 1
),
),
),
If this inline field is used without foreign_field, but with an MM table like in the following example, the child records do not get duplicated on copying the parent record. They are associated as references in sync with the original parent record. So if one edits a child record in the copy of the parent record, the child changes as well in the orignal parent record. This what I would not call an expected behaviour:
'children' => array(
'exclude' => 0,
'label' => 'LLL:EXT:test/Resources/Private/Language/locallang_db.xlf:tx_test_domain_model_testparent.children',
'config' => array(
'type' => 'inline',
'foreign_table' => 'tx_test_domain_model_testchild',
'MM' => 'tx_test_domain_model_testparent_children_mm',
'maxitems' => 9999,
'appearance' => array(
'collapseAll' => 0,
'levelLinksPosition' => 'top',
'showSynchronizationLink' => 1,
'showPossibleLocalizationRecords' => 1,
'showAllLocalizationLink' => 1
),
),
),
So, to my mind there should be a unified and of course configurable behaviour in this aspect, rather than an unconfigurable and kind of random / unpredictable behavior.
See also:
http://stackoverflow.com/questions/17234135/typo3-copying-irre-child-records
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch
- Commit message
-
[BUGFIX] Copying IRRE child records behaviour differs with certain TCA settings Resolves: #61835 Releases: main
Related issues 1
History 4
-
Benni Mack commented and changed status
NewAccepted <span data-processor="relativetime" data-value="2020-03-08T11:27:46+00:00" > 03/08/20, 11:27 </span>By definition (and in all our tests) – the relation of an “inline foreign field” means that it’s cascading, where as “MM” relations (which could be editable from both sides) are loose relations. This could be streamlined, but just so you know – right now this is as is. I will keep the issue open as this hopefully might get addressed in the near future.
-
Mathias Brodala changed Related to #58611 <span data-processor="relativetime" data-value="2020-05-05T14:42:08+00:00" > 05/05/20, 14:42 </span>
-
Benni Mack commented <span data-processor="relativetime" data-value="2026-10-23T07:44:43+00:00" > 10/23/26, 07:44 </span>
Still valid: copying a parent record duplicates its inline children when the field uses foreign_field. When the field uses MM instead, the copy points at the same child records as the original.
I have to make up my mind if we want this configurable or if “foreign_field” vs. “MM” is already the toggle.
Any update on this issue?