[TASK] FormEngine: remove array entry inlineOverruleTypesArray 84/43984/3
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Sun, 11 Oct 2015 14:18:08 +0000 (16:18 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 11 Oct 2015 16:49:56 +0000 (18:49 +0200)
The information stored in this subarray have been merged into
inlineParentConfig, so the subarray is not needed anymore.
All operations have been adjusted to use the new location.

Change-Id: I1c99b2c8735bbd5c0755f2b543f12bc2b8bf550f
Resolves: #70585
Releases: master
Reviewed-on: http://review.typo3.org/43984
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Controller/FormInlineAjaxController.php
typo3/sysext/backend/Classes/Form/FormDataCompiler.php
typo3/sysext/backend/Classes/Form/FormDataProvider/InlineOverruleTypesArray.php
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInline.php
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/InlineOverruleTypesArrayTest.php

index 1e02420..25e8474 100644 (file)
@@ -104,10 +104,6 @@ class FormInlineAjaxController
         }
 
         $childTableName = $parentConfig['foreign_table'];
-        $inlineOverruleTypesArray = [];
-        if (isset($parentConfig['foreign_types'])) {
-            $inlineOverruleTypesArray = $parentConfig['foreign_types'];
-        }
         /** @var TcaDatabaseRecord $formDataGroup */
         $formDataGroup = GeneralUtility::makeInstance(TcaDatabaseRecord::class);
         /** @var FormDataCompiler $formDataCompiler */
@@ -117,7 +113,6 @@ class FormInlineAjaxController
             'tableName' => $childTableName,
             'vanillaUid' => $childVanillaUid,
             'inlineFirstPid' => $inlineFirstPid,
-            'inlineOverruleTypesArray' => $inlineOverruleTypesArray,
             'inlineParentConfig' => $parentConfig,
         ];
         if ($childChildUid) {
@@ -127,7 +122,7 @@ class FormInlineAjaxController
 
         // Set default values for new created records
         // @todo: This should be moved over to some data provider? foreign_record_defaults is currently not handled
-        // @todo: at all, but also not used in core itself. Bonus question: There is "inlineOverruleTypesArray", there is this
+        // @todo: at all, but also not used in core itself. Bonus question: There is "foreign_types", there is this
         // @todo: default setting stuff ... why can't just "all" TCA be overwritten by parent similar to TCA type
         // @todo: related columnsOverrides? Another gem: foreign_selector_fieldTcaOverride overwrites TCA of foreign_selector
         // @todo: depending on parent ...
@@ -542,10 +537,6 @@ class FormInlineAjaxController
     {
         $parentConfig = $parentData['processedTca']['columns'][$parentFieldName]['config'];
         $childTableName = $parentConfig['foreign_table'];
-        $inlineOverruleTypesArray = [];
-        if (isset($parentConfig['foreign_types'])) {
-            $inlineOverruleTypesArray = $parentConfig['foreign_types'];
-        }
         /** @var TcaDatabaseRecord $formDataGroup */
         $formDataGroup = GeneralUtility::makeInstance(TcaDatabaseRecord::class);
         /** @var FormDataCompiler $formDataCompiler */
@@ -556,7 +547,6 @@ class FormInlineAjaxController
             'vanillaUid' => (int)$childUid,
             'inlineFirstPid' => $parentData['inlineFirstPid'],
             'inlineParentConfig' => $parentConfig,
-            'inlineOverruleTypesArray' => $inlineOverruleTypesArray,
         ];
         // For foreign_selector with useCombination $mainChild is the mm record
         // and $combinationChild is the child-child. For "normal" relations, $mainChild
index a04237c..1454350 100644 (file)
@@ -34,7 +34,6 @@ class FormDataCompiler
      * @var array
      */
     protected $removeKeysFromFinalResultArray = [
-        'inlineOverruleTypesArray',
     ];
 
     /**
@@ -212,9 +211,6 @@ class FormDataCompiler
             // configuration - of the new intermediate sys_file_reference record. Data provider that are called later
             // will then use this relation to resolve for instance input placeholder relation values.
             'inlineChildChildUid' => null,
-            // This is the "foreign_types" section of a parent inline configuration that can be used to
-            // overrule the types TCA section of a child element.
-            'inlineOverruleTypesArray' => [],
             // Inline scenario: A localized parent record is handled and localizationMode is set to "select", so inline
             // parents can have localized children. This value is set to TRUE if this array represents a localized child
             // overlay record that has no default language record.
@@ -239,4 +235,4 @@ class FormDataCompiler
 
         ];
     }
-}
\ No newline at end of file
+}
index eab96b5..98dd1df 100644 (file)
@@ -32,8 +32,8 @@ class InlineOverruleTypesArray implements FormDataProviderInterface
      */
     public function addData(array $result)
     {
-        if (!empty($result['inlineOverruleTypesArray'])) {
-            foreach ($result['inlineOverruleTypesArray'] as $type => $config) {
+        if (isset($result['inlineParentConfig']['foreign_types'])) {
+            foreach ($result['inlineParentConfig']['foreign_types'] as $type => $config) {
                 $result['processedTca']['types'][$type] = $config;
             }
         }
index c628a44..afa8d53 100644 (file)
@@ -208,10 +208,6 @@ class TcaInline extends AbstractDatabaseRecordProvider implements FormDataProvid
     {
         $parentConfig = $result['processedTca']['columns'][$parentFieldName]['config'];
         $childTableName = $parentConfig['foreign_table'];
-        $inlineOverruleTypesArray = [];
-        if (isset($parentConfig['foreign_types'])) {
-            $inlineOverruleTypesArray = $parentConfig['foreign_types'];
-        }
         /** @var TcaDatabaseRecord $formDataGroup */
         $formDataGroup = GeneralUtility::makeInstance(TcaDatabaseRecord::class);
         /** @var FormDataCompiler $formDataCompiler */
@@ -221,7 +217,6 @@ class TcaInline extends AbstractDatabaseRecordProvider implements FormDataProvid
             'tableName' => $childTableName,
             'vanillaUid' => (int)$childUid,
             'inlineFirstPid' => $result['inlineFirstPid'],
-            'inlineOverruleTypesArray' => $inlineOverruleTypesArray,
             'inlineParentConfig' => $parentConfig,
         ];
         // For foreign_selector with useCombination $mainChild is the mm record
index 5d05ac0..27dc7f3 100644 (file)
@@ -38,10 +38,12 @@ class InlineOverruleTypesArrayTest extends UnitTestCase
     public function addDataOverrulesShowitemsByGivenInlineOverruleTypes()
     {
         $input = [
-            'inlineOverruleTypesArray' => [
-                'aType' => [
-                    'showitem' => 'keepMe'
-                ]
+            'inlineParentConfig' => [
+                'foreign_types' => [
+                    'aType' => [
+                        'showitem' => 'keepMe',
+                    ],
+                ],
             ],
             'processedTca' => [
                 'types' => [
@@ -52,7 +54,7 @@ class InlineOverruleTypesArrayTest extends UnitTestCase
                         'showitem' => 'keepMe, aField',
                     ],
                 ],
-            ]
+            ],
         ];
 
         $expected = $input;
@@ -67,12 +69,14 @@ class InlineOverruleTypesArrayTest extends UnitTestCase
     public function addDataAddsTypeShowitemsByGivenInlineOverruleTypes()
     {
         $input = [
-            'inlineOverruleTypesArray' => [
-                'aType' => [
-                    'showitem' => 'keepMe'
-                ],
-                'cType' => [
-                    'showitem' => 'keepMe'
+            'inlineParentConfig' => [
+                'foreign_types' => [
+                    'aType' => [
+                        'showitem' => 'keepMe',
+                    ],
+                    'cType' => [
+                        'showitem' => 'keepMe',
+                    ],
                 ],
             ],
             'processedTca' => [
@@ -84,7 +88,7 @@ class InlineOverruleTypesArrayTest extends UnitTestCase
                         'showitem' => 'keepMe, aField',
                     ],
                 ],
-            ]
+            ],
         ];
 
         $expected = $input;
@@ -93,5 +97,4 @@ class InlineOverruleTypesArrayTest extends UnitTestCase
 
         $this->assertSame($expected, $this->subject->addData($input));
     }
-
 }