Bug #80944
openInline records are duplicated upon saving the master record
0%
Description
Context:
- Locations records (localized)
- Having Offices are inline relation, may be (externally) localized as well
TCA:
'offices' => [ 'exclude' => 1, 'l10n_mode' => 'exclude', 'label' => 'Offices', 'config' => [ 'type' => 'inline', 'foreign_table' => 'tx_myext_domain_model_office', 'foreign_field' => 'location', 'foreign_label' => 'name', 'foreign_sortby' => 'sorting', 'maxitems' => 20, 'appearance' => [ 'collapseAll' => 1, 'expandSingle' => 1, 'newRecordLinkAddTitle' => 1, 'newRecordLinkTitle' => 'New Office', ], ], ],
Since commit e7217da45d1528101aaa2577940a489f45b3029e (#80141), following problem happens:
- I edit a Location having 2 offices, one of them being "disabled"/"hidden"
- Doing nothing else than showing the edit form, not expanding either the Offices records
- Saving
- Upon form reloading:
- Disabled Office is still there
- Visible Office has been duplicated 8 times
Sample extension and data has been shared with Olly for further investigation.
Updated by Xavier Perseguers over 7 years ago
- Due date set to 2017-03-06
- Start date changed from 2017-04-21 to 2017-03-06
- Follows Bug #80141: Add allowLanguageSynchronization chain resolving added
Updated by Oliver Hader over 7 years ago
- Category set to Localization
- Assignee set to Oliver Hader
- PHP Version set to 7.0
- Complexity set to medium
Updated by Oliver Hader over 7 years ago
- Status changed from New to Needs Feedback
The basic challenge with the extension I received can be expressed as a "It's your turn" dilemma, when nested entities additionally point to each other with misleading semantic.
Written in an abstract way, we have the following TCA:
parent columns children l10n_mode=exclude config type=inline foreign_table=child foreign_field=parentid child columns parentid l10n_mode=exclude config type=select foreign_table=parent
Since the following behavior has been integrated into TYPO3 8.6, l10n_mode "exclude" and "mergeIfNotBlank" are handled differently and the values of the ancestor language source (e.g. "default language") are copied(!) to according translations. Find further details of that change here: https://docs.typo3.org/typo3cms/extensions/core/8-dev/Changelog/8.6/Feature-51291-SynchronizedFieldValuesInLocalizedRecords.html
Lets assume we have the following entities and record ids:parent:1
- default languagechild:11
- default languagechild:11.parentid
is1
child:12
- default languagechild:12.parentid
is1
parent:2
- translation ofparent:1
parent
entity is modified:
- all children of
parent:1
are copied/synchronized toparent:2
by creating localizations if they don't exist yet- localized
parent:11
toparent:21
- localized
parent:12
toparent:22
- localized
- the field values of
child.parentid
of the default language are copied to the their dependent translation recordschild:11.parentId
is copied tochild:21.parentid
, value is1
child:12.parentId
is copied tochild:22.parentid
, value is1
- now both translated children point back to the
parent
record of the default language - that's the mentioned misbehavior
- reconsider all
l10n_mode=exclude
andl10n_mode=mergeIfNotBlank
(later will be migrated automatically toallowLanguageSynchronization=true
- replace
l10n_mode=exclude
settings from child references, used in back-selectors to ancestor bydisplayCond
- these are thechild.parentid
fields from the example above
child columns parentid displayCond=FIELD:sys_language_uid:<=:0 config type=select foreign_table=parentThere was a similiar issue in powermail when upgrading to TYPO3 CMS 8, see the commit and initial pull-request for details:
- https://github.com/einpraegsam/powermail/commit/01b2fd4884b1dd9cefd1b7ae1dc501d338b46dd5
- https://github.com/einpraegsam/powermail/pull/56
- walk down the path of possible nested child references
- determine back-pointers that would be overridden
- throw an exception with more explanation
- this mechanism would have to consider all possible relations of the whole system
Updated by Oliver Hader over 7 years ago
- Related to Bug #80311: IRRE shows default + translated records added
Updated by Oliver Hader over 7 years ago
- Related to Feature #79658: Introduce allowLanguageSynchronization added
Updated by Lorenz Ulrich almost 6 years ago
The link to documentation is broken, see here:
https://docs.typo3.org/typo3cms/extensions/core/latest/Changelog/8.6/Feature-79658-SynchronizedFieldValuesInLocalizedRecords.html
Updated by Oliver Hader almost 6 years ago
- Related to Bug #87640: Keep language reference for associated l10n_mode=exclude children added
Updated by Thomas Scholze over 5 years ago
I'm able to reproduce this behavior if the parent field is 'exclude' => true and the editor has no access to this field. The child is configured this way:
child columns parentid config type=passthrough
Updated by Susanne Moog over 4 years ago
- Status changed from Needs Feedback to New
Updated by Riccardo De Contardi 6 months ago
- Related to Bug #93572: Inline Relational Records are multiplicated at multiple simultaneous translations added