Issue Bug Under Review Quiet

#81176IRRE + useCombination: overrideChildTca not working for ChildChild

Ralf Hettinger 05/10/17, 12:52 updated 10/14/26, 15:26

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);
     }

Reviews 2

History 57

  1. Gerrit Code Review pushed patch set 1 for master to change 52744 status New Under Review <span data-processor="relativetime" data-value="2017-05-10T14:11:16+00:00" > 05/10/17, 14:11 </span>

  2. Sascha Egerer commented <span data-processor="relativetime" data-value="2022-02-08T10:49:05+00:00" > 02/08/22, 10:49 </span>

    I think the mentioned change is also not a proper solution.
    This would require something like `overrideChildChildTca` as `overrideChildTca` should only overwrite the TCA of the `child` table but not the TCA of the `child-child` table or am i wrong?