[BUGFIX] FormEngine: Keep columns from overruleTypesArray for processing
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Tests / Unit / Form / FormDataProvider / TcaColumnsProcessShowitemTest.php
index 8096835..201901e 100644 (file)
@@ -68,6 +68,47 @@ class TcaColumnsProcessShowitemTest extends UnitTestCase
         $this->assertSame($expected, $this->subject->addData($input));
     }
 
+    /**
+     * @test
+     */
+    public function addDataRegistersColumnsFieldReferencedInOverruledShowitems()
+    {
+        $input = [
+            'columnsToProcess' => [],
+            'databaseRow' => [],
+            'recordTypeValue' => 'aType',
+            'overruleTypesArray' => [
+                'aType' => [
+                    'showitem' => 'keepMe'
+                ]
+            ],
+            'processedTca' => [
+                'types' => [
+                    'aType' => [
+                        'showitem' => 'aField'
+                    ],
+                ],
+                'columns' => [
+                    'keepMe' => [
+                        'config' => [
+                            'type' => 'input',
+                        ]
+                    ],
+                    'aField' => [
+                        'config' => [
+                            'type' => 'input',
+                        ]
+                    ]
+                ]
+            ]
+        ];
+
+        $expected = $input;
+        $expected['columnsToProcess'] = ['keepMe'];
+
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
+
     /**
      * @test
      */