Bug #81176

IRRE + useCombination: overrideChildTca not working for ChildChild

Added by Ralf Hettinger over 2 years ago. Updated 11 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2017-05-10
Due date:
% Done:

0%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

It isn't possible to use the overrideChildTca feature on childChild inline records as created by the useCombination feature.

Demo Configuration

// parent record
$GLOBALS['TCA']['parent']['columns']['inline_top_most_parent']['config'] = [
 'type' => 'inline',
 'foreign_table' => 'child_table_mm',
 'foreign_selector' => 'uid_local',
 'foreign_unique' => 'uid_local',
 'foreign_field' => 'uid_foreign',
 'foreign_table_field' => 'tablenames',
 'appearance' => [
  'useCombination' => TRUE,
 ]
];

// child record
$GLOBALS['TCA']['child_table_mm']['columns']['uid_local']['config'] = [
 'type' => 'select',
 'renderType' => 'selectSingle',
 'foreign_table' => 'child_child_table',
 'size' => 1,
 'minitems' => 0,
 'maxitems' => 1,

  // overrideChildTca is not passed to formDataCompiler
 'overrideChildTca' => [
  'columns' => [ 'items' => [ 'config' => [ 'type' => 'passthrough' ] ] ]
 ]
],

// child child record
$GLOBALS['TCA']['child_child_table']['columns']['items']['config'] = [

  // overrideChildTca is not respected for field items if child_child_table is rendered as inline record 
 'type' => 'group',
  // [...]
],

Possible Solution
Set key 'inlineParentConfig' to the child's field column configuration (defined by foreign_selector), before creating the form for childChild

--- typo3_src/typo3/sysext/backend/Classes/Controller/FormInlineAjaxController.php      2017-04-18 17:03:50.000000000 +0000
+++ typo3_src-8.7.1.stage/typo3/sysext/backend/Classes/Controller/FormInlineAjaxController.php  2017-05-10 10:49:22.172000000 +0000
@@ -136,6 +136,7 @@
                     'isInlineAjaxOpeningContext' => true,
                     'inlineStructure' => $inlineStackProcessor->getStructure(),
                     'inlineFirstPid' => (int)$inlineFirstPid,
+                    'inlineParentConfig' => $childData['processedTca']['columns'][$parentConfig['foreign_selector']]['config']
                 ];
                 $childData['combinationChild'] = $formDataCompiler->compile($formDataCompilerInput);
             }
@@ -557,6 +558,7 @@
             'inlineTopMostParentUid' => $child['inlineTopMostParentUid'],
             'inlineTopMostParentTableName' => $child['inlineTopMostParentTableName'],
             'inlineTopMostParentFieldName' => $child['inlineTopMostParentFieldName'],
+            'inlineParentConfig' => $child['processedTca']['columns'][$parentConfig['foreign_selector']]['config']
         ];
         return $formDataCompiler->compile($formDataCompilerInput);
     }

History

#1 Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52744

#2 Updated by Benni Mack 11 months ago

  • Status changed from Under Review to New

Also available in: Atom PDF