Project

General

Profile

Actions

Bug #80944

open

Inline records are duplicated upon saving the master record

Added by Xavier Perseguers over 7 years ago. Updated over 4 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2017-03-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
hard
Is Regression:
Sprint Focus:

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.


Related issues 5 (1 open4 closed)

Related to TYPO3 Core - Bug #80311: IRRE shows default + translated recordsClosedOliver Hader2017-03-16

Actions
Related to TYPO3 Core - Feature #79658: Introduce allowLanguageSynchronizationClosed2017-02-07

Actions
Related to TYPO3 Core - Bug #87640: Keep language reference for associated l10n_mode=exclude childrenClosed2019-02-04

Actions
Related to TYPO3 Core - Bug #93572: Inline Relational Records are multiplicated at multiple simultaneous translationsNew2021-02-23

Actions
Follows TYPO3 Core - Bug #80141: Add allowLanguageSynchronization chain resolvingClosedOliver Hader2017-03-04

Actions
Actions #1

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
Actions #2

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
Actions #3

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 language
    • child:11 - default language
      • child:11.parentid is 1
    • child:12 - default language
      • child:12.parentid is 1
  • parent:2 - translation of parent:1
Now, let's have a look on what happens, when the default language version of the parent entity is modified:
  • all children of parent:1 are copied/synchronized to parent:2 by creating localizations if they don't exist yet
    • localized parent:11 to parent:21
    • localized parent:12 to parent:22
  • the field values of child.parentid of the default language are copied to the their dependent translation records
    • child:11.parentId is copied to child:21.parentid, value is 1
    • child:12.parentId is copied to child:22.parentid, value is 1
    • now both translated children point back to the parent record of the default language - that's the mentioned misbehavior
How to solve this:
  • reconsider all l10n_mode=exclude and l10n_mode=mergeIfNotBlank (later will be migrated automatically to allowLanguageSynchronization=true
  • replace l10n_mode=exclude settings from child references, used in back-selectors to ancestor by displayCond - these are the child.parentid fields from the example above
child
  columns
    parentid
      displayCond=FIELD:sys_language_uid:<=:0
      config
        type=select
        foreign_table=parent
There was a similiar issue in powermail when upgrading to TYPO3 CMS 8, see the commit and initial pull-request for details: The only thing the Core could do here would be:
  • 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
Actions #4

Updated by Oliver Hader over 7 years ago

  • Complexity changed from medium to hard
Actions #5

Updated by Oliver Hader over 7 years ago

  • Related to Bug #80311: IRRE shows default + translated records added
Actions #6

Updated by Oliver Hader over 7 years ago

  • Related to Feature #79658: Introduce allowLanguageSynchronization added
Actions #7

Updated by Oliver Hader over 7 years ago

  • Due date deleted (2017-03-06)
Actions #9

Updated by Oliver Hader almost 6 years ago

  • Related to Bug #87640: Keep language reference for associated l10n_mode=exclude children added
Actions #10

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
Actions #11

Updated by Susanne Moog over 4 years ago

  • Status changed from Needs Feedback to New
Actions #12

Updated by Oliver Hader over 4 years ago

  • Assignee deleted (Oliver Hader)
Actions #13

Updated by Riccardo De Contardi 6 months ago

  • Related to Bug #93572: Inline Relational Records are multiplicated at multiple simultaneous translations added
Actions

Also available in: Atom PDF