[BUGFIX] Follow up foreign_match_fields not fully supported 30/29430/2
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Wed, 8 Jan 2014 17:13:22 +0000 (18:13 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 12 Apr 2014 13:34:56 +0000 (15:34 +0200)
On detaching related objects the foreign_match_fields needs
to be cleared.

Resolves: #47694
Relates: #45337
Releases: 6.2, 6.1
Change-Id: I6d74201afc437a2b0e2a73022bc71ed0cd1dd2d4
Reviewed-on: https://review.typo3.org/29430
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php

index 414439d..b97d6d5 100644 (file)
@@ -626,6 +626,10 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
                                if ($parentTableFieldName !== NULL) {
                                        $row[$parentTableFieldName] = '';
                                }
+                               $relationTableMatchFields = $parentColumnMap->getRelationTableMatchFields();
+                               if (is_array($relationTableMatchFields) && count($relationTableMatchFields)) {
+                                       $row = array_merge(array_fill_keys(array_keys($relationTableMatchFields), ''), $row);
+                               }
                        }
                        $childSortByFieldName = $parentColumnMap->getChildSortByFieldName();
                        if (!empty($childSortByFieldName)) {