Project

General

Profile

Bug #101936

Updated by Philipp Kitzberger 10 months ago

For Since TYPO3 11 (and 12) records with a bidirectional MM relations to themselves have duplicate MM records after copying them via DataHandler. 

 A prominent example would be EXT:news with its two columns @related@ and @related_from@ (stripped down to relevant parts): 

 EXT:news/Configuration/TCA/tx_news_domain_model_news.php: 
 <pre> 
         'related' => [ 
             'config' => [ 
                 'type' => 'group', 
                 'allowed' => 'tx_news_domain_model_news', 
                 'foreign_table' => 'tx_news_domain_model_news', 
                 'MM_opposite_field' => 'related_from', 
                 'MM' => 'tx_news_domain_model_news_related_mm', 
             ], 
         ], 
         'related_from' => [ 
             'config' => [ 
                 'type' => 'group', 
                 'foreign_table' => 'tx_news_domain_model_news', 
                 'allowed' => 'tx_news_domain_model_news', 
                 'MM' => 'tx_news_domain_model_news_related_mm', 
                 'readOnly' => 1, 
             ], 
         ], 
 </pre> 

 Scenario: 
 * Install EXT:news 
 * Create a folder with 2 news records, one refering to the other (via @related@ column) 
 * Copy that folder 

 |_.Original folder |_.Copied folder | 
 |!Bildschirmfoto%20vom%202023-09-17%2023-35-14.png! | !Bildschirmfoto%20vom%202023-09-17%2023-35-35.png! | 
 |    |    | 

 **Expected result:** 2nd folder with 2 news records, one refering **one time** to the other 
 **Actual result:** 2nd folder with 2 news records one refering **three times** to the other 

 With TYPO3 10 this worked as expected. And since the TCA in news hadn't changed, I assume it's a TYPO3 core issue. Plus I can reproduce it with pages records as well. 

 Hint: when unsetting the TCA for the @related_from@ field, it's working flawlessly. 

Back