[TASK] Unify configuration for overriding child TCA 30/52130/9
authorHelmut Hummel <typo3@helhum.io>
Wed, 22 Mar 2017 21:43:10 +0000 (22:43 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Sat, 25 Mar 2017 05:56:38 +0000 (06:56 +0100)
The configuration possibilities to override child TCA
from the TCA of an inline parent

foreign_types
foreign_record_defaults
foreign_selector_fieldTcaOverride
overrideCropVariants

Are now replaced with a new generic one

overrideChildTca

The old TCA is migrated to the new version.

Resolves: #80000
Releases: master
Change-Id: Iebe4e0794517bc51f8bb2406aec80d95dfcb374e
Reviewed-on: https://review.typo3.org/52130
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
16 files changed:
typo3/sysext/backend/Classes/Form/Element/ImageManipulationElement.php
typo3/sysext/backend/Classes/Form/FormDataProvider/InlineOverrideChildTca.php
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInlineConfiguration.php
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaOverrideChildCroppingConfiguration.php [deleted file]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/InlineOverrrideChildTcaTest.php
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaInlineConfigurationTest.php
typo3/sysext/core/Classes/Migrations/TcaMigration.php
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/core/Configuration/TCA/pages.php
typo3/sysext/core/Documentation/Changelog/8.6/Feature-75880-ImplementMultipleCroppingVariantsInImageManipulationTool.rst
typo3/sysext/core/Documentation/Changelog/master/Deprecation-80000-InlineOverrideChildTca.rst [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Migrations/TcaMigrationTest.php
typo3/sysext/frontend/Configuration/TCA/pages_language_overlay.php
typo3/sysext/frontend/Configuration/TCA/tt_content.php
typo3/sysext/workspaces/Classes/Controller/Remote/RemoteServer.php

index 3d2b9ff..b87eb48 100644 (file)
@@ -257,13 +257,20 @@ class ImageManipulationElement extends AbstractFormElement
             throw new InvalidConfigurationException('Crop variants configuration must be an array', 1485377267);
         }
 
-        foreach ($config['cropVariants'] as &$cropVariant) {
+        $cropVariants = [];
+        foreach ($config['cropVariants'] as $id => $cropVariant) {
+            // Ignore disabled crop variants
+            if (!empty($cropVariant['disabled'])) {
+                continue;
+            }
             // Enforce a crop area (default is full image)
             if (empty($cropVariant['cropArea'])) {
                 $cropVariant['cropArea'] = Area::createEmpty()->asArray();
             }
+            $cropVariants[$id] = $cropVariant;
         }
-        unset($cropVariant);
+
+        $config['cropVariants'] = $cropVariants;
 
         // By default we allow all image extensions that can be handled by the GFX functionality
         if ($config['allowedExtensions'] === null) {
index 4373ab4..996929f 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 namespace TYPO3\CMS\Backend\Form\FormDataProvider;
 
 /*
@@ -15,80 +16,126 @@ namespace TYPO3\CMS\Backend\Form\FormDataProvider;
  */
 
 use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
-use TYPO3\CMS\Core\Utility\ArrayUtility;
 
 /**
- * Override some child TCA in an inline parent child relation.
+ * Override child TCA in an inline parent child relation.
+ *
+ * This basically merges the inline property ['overrideChildTca'] from
+ * parent TCA over given child TCA.
  */
 class InlineOverrideChildTca implements FormDataProviderInterface
 {
     /**
+     * ['columns'] section child TCA field names that can not be overridden
+     * by overrideChildTca from parent.
+     *
+     * @var array
+     */
+    protected $notSettableFields = [
+        'uid',
+        'pid',
+        't3ver_oid',
+        't3ver_id',
+        't3ver_label',
+        't3ver_wsid',
+        't3ver_state',
+        't3ver_stage',
+        't3ver_count',
+        't3ver_tstamp',
+        't3ver_move_id',
+    ];
+
+    /**
+     * Configuration fields in ctrl section. Their values are field names and if the
+     * keys are set in ['ctrl'] section, they are added to the $notSettableFields list
+     * and can not be overridden, too.
+     *
+     * @var array
+     */
+    protected $configurationKeysForNotSettableFields = [
+        'crdate',
+        'cruser_id',
+        'delete',
+        'origUid',
+        'transOrigDiffSourceField',
+        'transOrigPointerField',
+        'tstamp',
+    ];
+
+    /**
      * Inline parent TCA may override some TCA of children.
      *
-     * @param array $result
-     * @return array
+     * @param array $result Main result array
+     * @return array Modified result array
      */
-    public function addData(array $result)
+    public function addData(array $result): array
     {
-        // Replace types definition of inline child if foreign_types is defined in inlineParentConfig
-        if (isset($result['inlineParentConfig']['foreign_types'])) {
-            foreach ($result['inlineParentConfig']['foreign_types'] as $type => $config) {
-                $result['processedTca']['types'][$type] = $config;
-            }
-        }
+        $result = $this->overrideTypes($result);
+        return $this->overrideColumns($result);
+    }
 
-        // Override config section of foreign_selector field pointer if given
-        if (isset($result['inlineParentConfig']['foreign_selector'])
-            && is_string($result['inlineParentConfig']['foreign_selector'])
-            && isset($result['inlineParentConfig']['foreign_selector_fieldTcaOverride'])
-            && is_array($result['inlineParentConfig']['foreign_selector_fieldTcaOverride'])
-            && isset($result['processedTca']['columns'][$result['inlineParentConfig']['foreign_selector']])
-            && is_array($result['processedTca']['columns'][$result['inlineParentConfig']['foreign_selector']])
-        ) {
-            ArrayUtility::mergeRecursiveWithOverrule(
-                $result['processedTca']['columns'][$result['inlineParentConfig']['foreign_selector']],
-                $result['inlineParentConfig']['foreign_selector_fieldTcaOverride']
-            );
+    /**
+     * Override ['types'] configuration in child TCA
+     *
+     * @param array $result Main result array
+     * @return array Modified result array
+     */
+    protected function overrideTypes(array $result): array
+    {
+        if (!isset($result['inlineParentConfig']['overrideChildTca']['types'])) {
+            return $result;
         }
+        $result['processedTca']['types'] = array_replace_recursive(
+            $result['processedTca']['types'],
+            $result['inlineParentConfig']['overrideChildTca']['types']
+        );
+        return $result;
+    }
 
-        // Set default values for (new) child if foreign_record_defaults is defined in inlineParentConfig
-        if (isset($result['inlineParentConfig']['foreign_record_defaults']) && is_array($result['inlineParentConfig']['foreign_record_defaults'])) {
-            $foreignTableConfig = $GLOBALS['TCA'][$result['inlineParentConfig']['foreign_table']];
-            // The following system relevant fields can't be set by foreign_record_defaults
-            $notSetableFields = [
-                'uid',
-                'pid',
-                't3ver_oid',
-                't3ver_id',
-                't3ver_label',
-                't3ver_wsid',
-                't3ver_state',
-                't3ver_stage',
-                't3ver_count',
-                't3ver_tstamp',
-                't3ver_move_id',
-            ];
-            // Optional configuration fields used in child table. If set, they must not be overridden, either
-            $configurationKeysForNotSettableFields = [
-                'crdate',
-                'cruser_id',
-                'delete',
-                'origUid',
-                'transOrigDiffSourceField',
-                'transOrigPointerField',
-                'tstamp',
-            ];
-            foreach ($configurationKeysForNotSettableFields as $configurationKey) {
-                if (isset($foreignTableConfig['ctrl'][$configurationKey])) {
-                    $notSetableFields[] = $foreignTableConfig['ctrl'][$configurationKey];
-                }
-            }
-            foreach ($result['inlineParentConfig']['foreign_record_defaults'] as $fieldName => $defaultValue) {
-                if (isset($foreignTableConfig['columns'][$fieldName]) && !in_array($fieldName, $notSetableFields, true)) {
-                    $result['processedTca']['columns'][$fieldName]['config']['default'] = $defaultValue;
-                }
+    /**
+     * Override ['columns'] configuration in child TCA.
+     * Sanitizes that various hard dependencies can not be changed.
+     *
+     * @param array $result Main result array
+     * @return array Modified result array
+     * @throws \RuntimeException
+     */
+    protected function overrideColumns(array $result): array
+    {
+        if (!isset($result['inlineParentConfig']['overrideChildTca']['columns'])) {
+            return $result;
+        }
+        $fieldBlackList = $this->generateFieldBlackList($result);
+        foreach ($fieldBlackList as $notChangeableFieldName) {
+            if (isset($result['inlineParentConfig']['overrideChildTca']['columns'][$notChangeableFieldName])) {
+                throw new \RuntimeException(
+                    'System field \'' . $notChangeableFieldName . '\' can not be overridden in inline config'
+                    . ' \'overrideChildTca\' from parent TCA',
+                    1490371322
+                );
             }
         }
+        $result['processedTca']['columns'] = array_replace_recursive(
+            $result['processedTca']['columns'],
+            $result['inlineParentConfig']['overrideChildTca']['columns']
+        );
         return $result;
     }
+
+    /**
+     * Add field names defined in ctrl section of child table to black list
+     *
+     * @param array $result Main result array
+     * @return array Column field names which can not be changed by parent TCA
+     */
+    protected function generateFieldBlackList(array $result): array
+    {
+        $notSettableFields = $this->notSettableFields;
+        foreach ($this->configurationKeysForNotSettableFields as $configurationKey) {
+            if (isset($result['processedTca']['ctrl'][$configurationKey])) {
+                $notSettableFields[] = $result['processedTca']['ctrl'][$configurationKey];
+            }
+        }
+        return $notSettableFields;
+    }
 }
index a5d3e03..02b41c8 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Backend\Form\FormDataProvider;
  */
 
 use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
-use TYPO3\CMS\Core\Utility\ArrayUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
 
 /**
@@ -201,7 +200,7 @@ class TcaInlineConfiguration implements FormDataProviderInterface
      * table. The InlineControlContainer may render a drop down field or an element browser later from this.
      *
      * Fetch configuration from child table configuration, sanitize and merge with
-     * foreign_selector_fieldTcaOverride that allows overriding this field definition again.
+     * overrideChildTca of foreign_selector if given that allows overriding this field definition again.
      *
      * Final configuration is written to selectorOrUniqueConfiguration of inline config section.
      *
@@ -264,12 +263,11 @@ class TcaInlineConfiguration implements FormDataProviderInterface
             );
         }
 
-        // Merge foreign_selector_fieldTcaOverride if given
-        if (isset($config['foreign_selector'])
-            && isset($config['foreign_selector_fieldTcaOverride']['config'])
-            && is_array($config['foreign_selector_fieldTcaOverride']['config'])
+        // Merge overrideChildTca of foreign_selector if given
+        if (isset($config['foreign_selector'], $config['overrideChildTca']['columns'][$config['foreign_selector']]['config'])
+            && is_array($config['overrideChildTca']['columns'][$config['foreign_selector']]['config'])
         ) {
-            ArrayUtility::mergeRecursiveWithOverrule($selectorOrUniqueConfiguration['config'], $config['foreign_selector_fieldTcaOverride']['config']);
+            $selectorOrUniqueConfiguration['config'] = array_replace_recursive($selectorOrUniqueConfiguration['config'], $config['overrideChildTca']['columns'][$config['foreign_selector']]['config']);
         }
 
         // Add field name to config for easy access later
diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaOverrideChildCroppingConfiguration.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaOverrideChildCroppingConfiguration.php
deleted file mode 100644 (file)
index 3f63e88..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-declare(strict_types=1);
-namespace TYPO3\CMS\Backend\Form\FormDataProvider;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
-
-/**
- * Override cropping configuration of child (mostly sys_file_reference) TCA
- */
-class TcaOverrideChildCroppingConfiguration extends AbstractItemProvider implements FormDataProviderInterface
-{
-    /**
-     * @param array $result
-     * @return array
-     */
-    public function addData(array $result)
-    {
-        if (isset($result['inlineParentConfig']['overrideCropVariants'])
-            && is_array($result['inlineParentConfig']['overrideCropVariants'])) {
-            foreach ($result['inlineParentConfig']['overrideCropVariants'] as $fieldName => $cropVariantsConfig) {
-                if (
-                    isset($result['processedTca']['columns'][$fieldName]['config']['type'])
-                    && $result['processedTca']['columns'][$fieldName]['config']['type'] === 'imageManipulation'
-                ) {
-                    $result['processedTca']['columns'][$fieldName]['config']['cropVariants'] = $cropVariantsConfig;
-                }
-            }
-        }
-        return $result;
-    }
-}
index 77eeb49..2a690e4 100644 (file)
@@ -34,13 +34,15 @@ class InlineOverrrideChildTcaTest extends \TYPO3\TestingFramework\Core\Unit\Unit
     /**
      * @test
      */
-    public function addDataOverrulesShowitemByGivenInlineOverruleTypes()
+    public function addDataOverrulesShowitemByGivenOverrideChildTca()
     {
         $input = [
             'inlineParentConfig' => [
-                'foreign_types' => [
-                    'aType' => [
-                        'showitem' => 'keepMe',
+                'overrideChildTca' => [
+                    'types' => [
+                        'aType' => [
+                            'showitem' => 'keepMe',
+                        ],
                     ],
                 ],
             ],
@@ -65,16 +67,18 @@ class InlineOverrrideChildTcaTest extends \TYPO3\TestingFramework\Core\Unit\Unit
     /**
      * @test
      */
-    public function addDataAddsTypeShowitemByGivenInlineOverruleTypes()
+    public function addDataAddsTypeShowitemByGivenOverrideChildTca()
     {
         $input = [
             'inlineParentConfig' => [
-                'foreign_types' => [
-                    'aType' => [
-                        'showitem' => 'keepMe',
-                    ],
-                    'cType' => [
-                        'showitem' => 'keepMe',
+                'overrideChildTca' => [
+                    'types' => [
+                        'aType' => [
+                            'showitem' => 'keepMe',
+                        ],
+                        'cType' => [
+                            'showitem' => 'keepMe',
+                        ],
                     ],
                 ],
             ],
@@ -105,14 +109,18 @@ class InlineOverrrideChildTcaTest extends \TYPO3\TestingFramework\Core\Unit\Unit
         $input = [
             'inlineParentConfig' => [
                 'foreign_selector' => 'uid_local',
-                'foreign_selector_fieldTcaOverride' => [
-                    'label' => 'aDifferentLabel',
-                    'config' => [
-                        'aGivenSetting' => 'overrideValue',
-                        'aNewSetting' => 'anotherNewValue',
-                        'appearance' => [
-                            'elementBrowserType' => 'file',
-                            'elementBrowserAllowed' => 'jpg,png'
+                'overrideChildTca' => [
+                    'columns' => [
+                        'uid_local' => [
+                            'label' => 'aDifferentLabel',
+                            'config' => [
+                                'aGivenSetting' => 'overrideValue',
+                                'aNewSetting' => 'anotherNewValue',
+                                'appearance' => [
+                                    'elementBrowserType' => 'file',
+                                    'elementBrowserAllowed' => 'jpg,png'
+                                ],
+                            ],
                         ],
                     ],
                 ],
@@ -155,12 +163,16 @@ class InlineOverrrideChildTcaTest extends \TYPO3\TestingFramework\Core\Unit\Unit
      */
     public function addDataSetsDefaultValueForChildRecordColumn()
     {
-        $GLOBALS['TCA']['aTable']['columns']['aType'] = [];
         $input = [
             'inlineParentConfig' => [
-                'foreign_table' => 'aTable',
-                'foreign_record_defaults' => [
-                    'aType' => '42',
+                'overrideChildTca' => [
+                    'columns' => [
+                        'aType' => [
+                            'config' => [
+                                'default' => '42',
+                            ],
+                        ],
+                    ],
                 ],
             ],
             'processedTca' => [
@@ -181,14 +193,18 @@ class InlineOverrrideChildTcaTest extends \TYPO3\TestingFramework\Core\Unit\Unit
     /**
      * @test
      */
-    public function addDataIgnoresDefaultValueForRestrictedField()
+    public function addDataThrowsExceptionForRestrictedField()
     {
-        $GLOBALS['TCA']['aTable']['columns']['pid'] = [];
         $input = [
             'inlineParentConfig' => [
-                'foreign_table' => 'aTable',
-                'foreign_record_defaults' => [
-                    'pid' => '42',
+                'overrideChildTca' => [
+                    'columns' => [
+                        'pid' => [
+                            'config' => [
+                                'default' => '42',
+                            ],
+                        ],
+                    ],
                 ],
             ],
             'processedTca' => [
@@ -200,8 +216,8 @@ class InlineOverrrideChildTcaTest extends \TYPO3\TestingFramework\Core\Unit\Unit
             ],
         ];
 
-        $expected = $input;
-
-        $this->assertSame($expected, $this->subject->addData($input));
+        $this->expectException(\RuntimeException::class);
+        $this->expectExceptionCode(1490371322);
+        $this->subject->addData($input);
     }
 }
index 1c76482..2ffa359 100644 (file)
@@ -795,13 +795,17 @@ class TcaInlineConfigurationTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
                             'type' => 'inline',
                             'foreign_table' => 'aForeignTableName',
                             'foreign_selector' => 'aField',
-                            'foreign_selector_fieldTcaOverride' => [
-                                'config' => [
-                                    'aGivenSetting' => 'aOverrideValue',
-                                    'aNewSetting' => 'aNewSetting',
-                                    'appearance' => [
-                                        'elementBrowserType' => 'file',
-                                        'elementBrowserAllowed' => 'jpg,png',
+                            'overrideChildTca' => [
+                                'columns' => [
+                                    'aField' => [
+                                        'config' => [
+                                            'aGivenSetting' => 'aOverrideValue',
+                                            'aNewSetting' => 'aNewSetting',
+                                            'appearance' => [
+                                                'elementBrowserType' => 'file',
+                                                'elementBrowserAllowed' => 'jpg,png',
+                                            ],
+                                        ],
                                     ],
                                 ],
                             ],
@@ -821,7 +825,7 @@ class TcaInlineConfigurationTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
         $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
         $expected['processedTca']['columns']['aField']['config']['appearance']['levelLinksPosition'] = 'none';
         $expected['processedTca']['columns']['aField']['config']['foreign_selector'] = 'aField';
-        $expected['processedTca']['columns']['aField']['config']['foreign_selector_fieldTcaOverride'] = [
+        $expected['processedTca']['columns']['aField']['config']['overrideChildTca']['columns']['aField'] = [
             'config' => [
                 'aGivenSetting' => 'aOverrideValue',
                 'aNewSetting' => 'aNewSetting',
index 0268d33..b7b67b1 100644 (file)
@@ -86,6 +86,7 @@ class TcaMigration
         $tca = $this->migrateSelectShowIconTable($tca);
         $tca = $this->migrateImageManipulationConfig($tca);
         $tca = $this->migrateinputDateTimeMax($tca);
+        $tca = $this->migrateInlineOverrideChildTca($tca);
         return $tca;
     }
 
@@ -2413,4 +2414,58 @@ class TcaMigration
 
         return $tca;
     }
+
+    /**
+     * Migrate type='inline' properties 'foreign_types', 'foreign_selector_fieldTcaOverride'
+     * and 'foreign_record_defaults' to 'overrideChildTca'
+     *
+     * @param array $tca
+     * @return array
+     */
+    protected function migrateInlineOverrideChildTca(array $tca): array
+    {
+        foreach ($tca as $table => &$tableDefinition) {
+            if (isset($tableDefinition['columns']) && is_array($tableDefinition['columns'])) {
+                foreach ($tableDefinition['columns'] as $fieldName => &$fieldConfig) {
+                    if (isset($fieldConfig['config']['overrideChildTca'])
+                        || $fieldConfig['config']['type'] !== 'inline'
+                    ) {
+                        // The new config is either set intentionally for compatibility
+                        // or accidentally. In any case we keep the new config and skip the migration.
+                        continue;
+                    }
+                    if (isset($fieldConfig['config']['foreign_types']) && is_array($fieldConfig['config']['foreign_types'])) {
+                        $fieldConfig['config']['overrideChildTca']['types'] = $fieldConfig['config']['foreign_types'];
+                        unset($fieldConfig['config']['foreign_types']);
+                        $this->messages[] = 'The \'foreign_types\' property from TCA ' . $table
+                            . '[\'columns\'][\'' . $fieldName . '\'][\'config\']  and has been migrated to '
+                            . $table . '[\'columns\'][\'' . $fieldName . '\'][\'config\'][\'overrideChildTca\'][\'types\']';
+                    }
+                    if (isset($fieldConfig['config']['foreign_selector'], $fieldConfig['config']['foreign_selector_fieldTcaOverride'])
+                        && is_string($fieldConfig['config']['foreign_selector'])
+                        && is_array($fieldConfig['config']['foreign_selector_fieldTcaOverride'])
+                    ) {
+                        $foreignSelectorFieldName = $fieldConfig['config']['foreign_selector'];
+                        $fieldConfig['config']['overrideChildTca']['columns'][$foreignSelectorFieldName]
+                            = $fieldConfig['config']['foreign_selector_fieldTcaOverride'];
+                        unset($fieldConfig['config']['foreign_selector_fieldTcaOverride']);
+                        $this->messages[] = 'The \'foreign_selector_fieldTcaOverride\' property from TCA ' . $table
+                            . '[\'columns\'][\'' . $fieldName . '\'][\'config\']  and has been migrated to ' . $table
+                            . '[\'columns\'][\'' . $fieldName . '\'][\'config\'][\'overrideChildTca\'][\'columns\'][\'' . $foreignSelectorFieldName . '\']';
+                    }
+                    if (isset($fieldConfig['config']['foreign_record_defaults']) && is_array($fieldConfig['config']['foreign_record_defaults'])) {
+                        foreach ($fieldConfig['config']['foreign_record_defaults'] as $childFieldName => $defaultValue) {
+                            $fieldConfig['config']['overrideChildTca']['columns'][$childFieldName]['config']['default'] = $defaultValue;
+                            $this->messages[] = 'The \'foreign_record_defaults\' property from TCA ' . $table
+                                . '[\'columns\'][\'' . $fieldName . '\'][\'config\'][\'' . $childFieldName . '\']  and has been migrated to ' . $table
+                                . '[\'columns\'][\'' . $fieldName . '\'][\'config\'][\'overrideChildTca\'][\'columns\'][\'' . $childFieldName . '\'][\'config\'][\'default\']';
+                        }
+                        unset($fieldConfig['config']['foreign_record_defaults']);
+                    }
+                }
+            }
+        }
+
+        return $tca;
+    }
 }
index a3f4cdb..547c26f 100644 (file)
@@ -570,13 +570,17 @@ class ExtensionManagementUtility
             ],
             'foreign_label' => 'uid_local',
             'foreign_selector' => 'uid_local',
-            'foreign_selector_fieldTcaOverride' => [
-                'config' => [
-                    'appearance' => [
-                        'elementBrowserType' => 'file',
-                        'elementBrowserAllowed' => $allowedFileExtensions
-                    ]
-                ]
+            'overrideChildTca' => [
+                'columns' => [
+                    'uid_local' => [
+                        'config' => [
+                            'appearance' => [
+                                'elementBrowserType' => 'file',
+                                'elementBrowserAllowed' => $allowedFileExtensions
+                            ],
+                        ],
+                    ],
+                ],
             ],
             'filter' => [
                 [
index 9f553dc..eedcc06 100644 (file)
@@ -546,14 +546,6 @@ return [
                             \TYPO3\CMS\Backend\Form\FormDataProvider\TcaInlineConfiguration::class,
                         ],
                     ],
-                    \TYPO3\CMS\Backend\Form\FormDataProvider\TcaOverrideChildCroppingConfiguration::class => [
-                        'depends' => [
-                            \TYPO3\CMS\Backend\Form\FormDataProvider\InlineOverrideChildTca::class,
-                        ],
-                        'before' => [
-                            \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRowDefaultValues::class,
-                        ],
-                    ],
                     \TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders::class => [
                         'depends' => [
                             \TYPO3\CMS\Backend\Form\FormDataProvider\TcaInlineConfiguration::class,
index 35b0cca..a6128be 100644 (file)
@@ -612,38 +612,40 @@ return [
             'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.media',
             'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('media', [
                     // Use the imageoverlayPalette instead of the basicoverlayPalette
-                    'foreign_types' => [
-                        '0' => [
-                            'showitem' => '
-                                                               --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
-                                                               --palette--;;filePalette'
+                    'overrideChildTca' => [
+                        'types' => [
+                            '0' => [
+                                'showitem' => '
+                                    --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                    --palette--;;filePalette'
+                            ],
+                            \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
+                                'showitem' => '
+                                    --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                    --palette--;;filePalette'
+                            ],
+                            \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
+                                'showitem' => '
+                                    --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                    --palette--;;filePalette'
+                            ],
+                            \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
+                                'showitem' => '
+                                    --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.audioOverlayPalette;audioOverlayPalette,
+                                    --palette--;;filePalette'
+                            ],
+                            \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
+                                'showitem' => '
+                                    --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.videoOverlayPalette;videoOverlayPalette,
+                                    --palette--;;filePalette'
+                            ],
+                            \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
+                                'showitem' => '
+                                    --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                    --palette--;;filePalette'
+                            ]
                         ],
-                        \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
-                            'showitem' => '
-                                                               --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
-                                                               --palette--;;filePalette'
-                        ],
-                        \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
-                            'showitem' => '
-                                                               --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
-                                                               --palette--;;filePalette'
-                        ],
-                        \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
-                            'showitem' => '
-                                                               --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.audioOverlayPalette;audioOverlayPalette,
-                                                               --palette--;;filePalette'
-                        ],
-                        \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
-                            'showitem' => '
-                                                               --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.videoOverlayPalette;videoOverlayPalette,
-                                                               --palette--;;filePalette'
-                        ],
-                        \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
-                            'showitem' => '
-                                                               --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
-                                                               --palette--;;filePalette'
-                        ]
-                    ]
+                    ],
                 ]
             )
         ],
index ff2edbe..f972e27 100644 (file)
@@ -138,19 +138,21 @@ cropping configuration for tt_content images, then you can add the following to
 .. code-block:: php
 
     'config' => [
-         'overrideCropVariants' => [
-            'crop' => [
-               'mobile' => [
-                   'title' => 'LLL:EXT:ext_key/Resources/Private/Language/locallang.xlf:imageManipulation.mobile',
-                   'cropArea' => [
-                       'x' => 0.1,
-                       'y' => 0.1,
-                       'width' => 0.8,
-                       'height' => 0.8,
-                   ],
-               ],
+        'overrideChildTca' => [
+            'columns' => [
+                'crop' => [
+                    'mobile' => [
+                        'title' => 'LLL:EXT:ext_key/Resources/Private/Language/locallang.xlf:imageManipulation.mobile',
+                        'cropArea' => [
+                            'x' => 0.1,
+                            'y' => 0.1,
+                            'width' => 0.8,
+                            'height' => 0.8,
+                        ],
+                    ],
+                ],
             ],
-         ],
+        ],
     ]
 
 Please note, that you need to specify the target column name as array key. Most of the time this will be `crop`
@@ -159,8 +161,11 @@ as this is the default field name for image manipulation in `sys_file_reference`
 It is also possible to set the cropping configuration only for a specific tt_content element type by using the
 `columnOverrides` feature:
 
-    $GLOBALS['TCA']['tt_content']['types']['textmedia']['columnsOverrides']['assets']['config']['overrideCropVariants'] = [
+    $GLOBALS['TCA']['tt_content']['types']['textmedia']['columnsOverrides']['assets']['config']['overrideChildTca']['columns'] = [
         'crop' => [
+           'default' => [
+               'disabled' => true,
+           ],
            'mobile' => [
                'title' => 'LLL:EXT:ext_key/Resources/Private/Language/locallang.xlf:imageManipulation.mobile',
                'cropArea' => [
@@ -183,6 +188,9 @@ It is also possible to set the cropping configuration only for a specific tt_con
         ],
     ];
 
+Please note, that the array for ``overrideChildTca`` is merged with the child TCA, so are the crop variants that are defined
+in the child TCA (most likely sys_file_reference). Because you cannot remove crop variants easily, it is possible to disable them
+for certain field types by setting the array key for a crop variant ``disabled`` to the value ``true``
 
 To render crop variants, the variants can be specified as argument to the image view helper:
 
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80000-InlineOverrideChildTca.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80000-InlineOverrideChildTca.rst
new file mode 100644 (file)
index 0000000..a4489db
--- /dev/null
@@ -0,0 +1,166 @@
+.. include:: ../../Includes.txt
+
+============================================
+Deprecation: #80000 - InlineOverrideChildTca
+============================================
+
+See :issue:`80000`
+
+Description
+===========
+
+These :php:`TCA` :php:`type=inline` properties have been deprecated and superseded with the more
+general property :php:`overrideChildTca`:
+
+* foreign_types
+* foreign_selector_fieldTcaOverride
+* foreign_record_defaults
+
+
+Impact
+======
+
+It is now possible to override display (FormEngine) related columns properties and the types section of
+child :php:`TCA` from within the parent :php:`TCA`. This is also allowed in a
+parents :php:`['types']['columnsOverrides']` section.
+
+
+Affected Installations
+======================
+
+Instances using one of the above inline properties should adapt to the new :php:`overrideChildTca` property.
+
+
+Migration
+=========
+
+A :php:`TCA` auto-migration is in place. It will transfer the old settings to the new property as
+shown below and logs deprecation entries if there is no :php:`overrideChildTca` defined. This allows extension
+authors to keep both the old and the new settings to support CMS v7 and v8 at the same time without
+having deprecations logged.
+
+foreign_types before and after transition to overrideChildTca:
+
+.. code-block:: php
+
+    'columns' => [
+        'aField' => [
+            'config' => [
+                'type' => 'inline',
+                'foreign_types' => [
+                    'aForeignType' => [
+                        'showitem' => 'aChildField',
+                    ],
+                ],
+                ...
+            ],
+        ],
+        ...
+    ],
+
+.. code-block:: php
+
+    'columns' => [
+        'aField' => [
+            'config' => [
+                'type' => 'inline',
+                'overrideChildTca => [
+                    'types' => [
+                        'aForeignType' => [
+                            'showitem' => 'aChildField',
+                        ],
+                    ],
+                ],
+                ...
+            ],
+        ],
+        ...
+    ],
+
+foreign_selector_fieldTcaOverride before and after transition to overrideChildTca:
+
+.. code-block:: php
+
+    'columns' => [
+        'aField' => [
+            'config' => [
+                'type' => 'inline',
+                'foreign_selector' => 'uid_local',
+                'foreign_selector_fieldTcaOverride' => [
+                    'config' => [
+                        'appearance' => [
+                            'elementBrowserType' => 'file',
+                        ],
+                    ],
+                ],
+                ...
+            ],
+        ],
+        ...
+    ],
+
+.. code-block:: php
+
+    'columns' => [
+        'aField' => [
+            'config' => [
+                'type' => 'inline',
+                'foreign_selector' => 'uid_local',
+                'overrideChildTca => [
+                    'columns' => [
+                        'uid_local' => [
+                            'config' => [
+                                'appearance' => [
+                                    'elementBrowserType' => 'file',
+                                ],
+                            ],
+                        ],
+                    ],
+                ],
+                ...
+            ],
+        ],
+        ...
+    ],
+
+
+foreign_record_defaults before and after transition to overrideChildTca:
+
+.. code-block:: php
+
+    'columns' => [
+        'aField' => [
+            'config' => [
+                'type' => 'inline',
+                'foreign_record_defaults' => [
+                    'aChildField' => 42,
+                ],
+                ...
+            ],
+        ],
+        ...
+    ],
+
+.. code-block:: php
+
+    'columns' => [
+        'aField' => [
+            'config' => [
+                'type' => 'inline',
+                'overrideChildTca' => [
+                    'columns' => [
+                        'aChildField' => [
+                            'config' => [
+                                'default' => 42,
+                            ],
+                        ],
+                    ],
+                ],
+                ...
+            ],
+        ],
+        ...
+    ],
+
+
+.. index:: Backend, TCA
\ No newline at end of file
index 28e98fb..6e11ad0 100644 (file)
@@ -6111,4 +6111,188 @@ class TcaMigrationTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
         $subject = new TcaMigration();
         $this->assertEquals($expected, $subject->migrate($input));
     }
+
+    /**
+     * @test
+     */
+    public function migrateForeignTypesOverride()
+    {
+        $input = [
+            'aTable' => [
+                'columns' => [
+                    'foo' => [
+                        'config' => [
+                            'type' => 'inline',
+                            'foreign_types' => [
+                                '0' => [
+                                    'showitem' => 'bar'
+                                ],
+                            ],
+                        ],
+                    ],
+                ],
+            ],
+        ];
+        $expected = [
+            'aTable' => [
+                'columns' => [
+                    'foo' => [
+                        'config' => [
+                            'type' => 'inline',
+                            'overrideChildTca' => [
+                                'types' => [
+                                    '0' => [
+                                        'showitem' => 'bar'
+                                    ],
+                                ],
+                            ],
+                        ],
+                    ],
+                ],
+            ],
+        ];
+        $subject = new TcaMigration();
+        $this->assertEquals($expected, $subject->migrate($input));
+    }
+
+    /**
+     * @test
+     */
+    public function migrateOfChildOverrideIsSkippedWhenNewConfigIsFound()
+    {
+        $input = [
+            'aTable' => [
+                'columns' => [
+                    'foo' => [
+                        'config' => [
+                            'type' => 'inline',
+                            'foreign_types' => [
+                                '0' => [
+                                    'showitem' => 'bar'
+                                ],
+                            ],
+                            'overrideChildTca' => [
+                                'types' => [
+                                    '0' => [
+                                        'showitem' => 'baz'
+                                    ],
+                                ],
+                            ],
+                        ],
+                    ],
+                ],
+            ],
+        ];
+        $expected = $input;
+        $subject = new TcaMigration();
+        $this->assertEquals($expected, $subject->migrate($input));
+    }
+
+    /**
+     * @test
+     */
+    public function migrateForeignDefaultsOverride()
+    {
+        $input = [
+            'aTable' => [
+                'columns' => [
+                    'foo' => [
+                        'config' => [
+                            'type' => 'inline',
+                            'foreign_record_defaults' => [
+                                'aField' => 'overriddenValue',
+                                'bField' => 'overriddenValue',
+                            ],
+                        ],
+                    ],
+                ],
+            ],
+        ];
+        $expected = [
+            'aTable' => [
+                'columns' => [
+                    'foo' => [
+                        'config' => [
+                            'type' => 'inline',
+                            'overrideChildTca' => [
+                                'columns' => [
+                                    'aField' => [
+                                        'config' => [
+                                            'default' => 'overriddenValue'
+                                        ],
+                                    ],
+                                    'bField' => [
+                                        'config' => [
+                                            'default' => 'overriddenValue'
+                                        ],
+                                    ],
+                                ],
+                            ],
+                        ],
+                    ],
+                ],
+            ],
+        ];
+        $subject = new TcaMigration();
+        $this->assertEquals($expected, $subject->migrate($input));
+    }
+
+    /**
+     * @test
+     */
+    public function migrateForeignSelectorOverrides()
+    {
+        $input = [
+            'aTable' => [
+                'columns' => [
+                    'foo' => [
+                        'config' => [
+                            'type' => 'inline',
+                            'foreign_selector' => 'uid_local',
+                            'foreign_selector_fieldTcaOverride' => [
+                                'label' => 'aDifferentLabel',
+                                'config' => [
+                                    'aGivenSetting' => 'overrideValue',
+                                    'aNewSetting' => 'anotherNewValue',
+                                    'appearance' => [
+                                        'elementBrowserType' => 'file',
+                                        'elementBrowserAllowed' => 'jpg,png'
+                                    ],
+                                ],
+                            ],
+                        ],
+                    ],
+                ],
+            ],
+        ];
+        $expected = [
+            'aTable' => [
+                'columns' => [
+                    'foo' => [
+                        'config' => [
+                            'type' => 'inline',
+                            'foreign_selector' => 'uid_local',
+                            'overrideChildTca' => [
+                                'columns' => [
+                                    'uid_local' => [
+                                        'label' => 'aDifferentLabel',
+                                        'config' => [
+                                            'aGivenSetting' => 'overrideValue',
+                                            'aNewSetting' => 'anotherNewValue',
+                                            'appearance' => [
+                                                'elementBrowserType' => 'file',
+                                                'elementBrowserAllowed' => 'jpg,png'
+                                            ],
+                                        ],
+                                    ],
+                                ],
+                            ],
+                        ],
+                    ],
+                ],
+            ],
+        ];
+        $subject = new TcaMigration();
+        $this->assertEquals($expected, $subject->migrate($input));
+    }
 }
index f98d931..8f1c88a 100644 (file)
@@ -150,38 +150,40 @@ return [
             'label' => $GLOBALS['TCA']['pages']['columns']['media']['label'],
             'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('media', [
                     // Use the imageoverlayPalette instead of the basicoverlayPalette
-                    'foreign_types' => [
-                        '0' => [
-                            'showitem' => '
-                                                               --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
-                                                               --palette--;;filePalette'
+                    'overrideChildTca' => [
+                        'types' => [
+                            '0' => [
+                                'showitem' => '
+                                    --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                    --palette--;;filePalette'
+                            ],
+                            \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
+                                'showitem' => '
+                                    --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                    --palette--;;filePalette'
+                            ],
+                            \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
+                                'showitem' => '
+                                    --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                    --palette--;;filePalette'
+                            ],
+                            \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
+                                'showitem' => '
+                                    --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.audioOverlayPalette;audioOverlayPalette,
+                                    --palette--;;filePalette'
+                            ],
+                            \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
+                                'showitem' => '
+                                    --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.videoOverlayPalette;videoOverlayPalette,
+                                    --palette--;;filePalette'
+                            ],
+                            \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
+                                'showitem' => '
+                                    --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                    --palette--;;filePalette'
+                            ]
                         ],
-                        \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
-                            'showitem' => '
-                                                               --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
-                                                               --palette--;;filePalette'
-                        ],
-                        \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
-                            'showitem' => '
-                                                               --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
-                                                               --palette--;;filePalette'
-                        ],
-                        \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
-                            'showitem' => '
-                                                               --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.audioOverlayPalette;audioOverlayPalette,
-                                                               --palette--;;filePalette'
-                        ],
-                        \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
-                            'showitem' => '
-                                                               --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.videoOverlayPalette;videoOverlayPalette,
-                                                               --palette--;;filePalette'
-                        ],
-                        \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
-                            'showitem' => '
-                                                               --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
-                                                               --palette--;;filePalette'
-                        ]
-                    ]
+                    ],
                 ]
             )
         ],
index d10fd44..2d22708 100644 (file)
@@ -592,38 +592,40 @@ return [
                 ],
                 // custom configuration for displaying fields in the overlay/reference table
                 // to use the imageoverlayPalette instead of the basicoverlayPalette
-                'foreign_types' => [
-                    '0' => [
-                        'showitem' => '
-                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
-                            --palette--;;filePalette'
-                    ],
-                    \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
-                        'showitem' => '
-                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
-                            --palette--;;filePalette'
-                    ],
-                    \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
-                        'showitem' => '
-                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
-                            --palette--;;filePalette'
-                    ],
-                    \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
-                        'showitem' => '
-                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.audioOverlayPalette;audioOverlayPalette,
-                            --palette--;;filePalette'
-                    ],
-                    \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
-                        'showitem' => '
-                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.videoOverlayPalette;videoOverlayPalette,
-                            --palette--;;filePalette'
-                    ],
-                    \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
-                        'showitem' => '
-                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
-                            --palette--;;filePalette'
-                    ]
-                ]
+                'overrideChildTca' => [
+                    'types' => [
+                        '0' => [
+                            'showitem' => '
+                                --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                --palette--;;filePalette'
+                        ],
+                        \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
+                            'showitem' => '
+                                --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                --palette--;;filePalette'
+                        ],
+                        \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
+                            'showitem' => '
+                                --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                --palette--;;filePalette'
+                        ],
+                        \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
+                            'showitem' => '
+                                --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.audioOverlayPalette;audioOverlayPalette,
+                                --palette--;;filePalette'
+                        ],
+                        \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
+                            'showitem' => '
+                                --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.videoOverlayPalette;videoOverlayPalette,
+                                --palette--;;filePalette'
+                        ],
+                        \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
+                            'showitem' => '
+                                --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                --palette--;;filePalette'
+                        ]
+                    ],
+                ],
             ], $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'])
         ],
         'assets' => [
@@ -634,38 +636,40 @@ return [
                 ],
                 // custom configuration for displaying fields in the overlay/reference table
                 // behaves the same as the image field.
-                'foreign_types' => [
-                    '0' => [
-                        'showitem' => '
-                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
-                            --palette--;;filePalette'
-                    ],
-                    \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
-                        'showitem' => '
-                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
-                            --palette--;;filePalette'
-                    ],
-                    \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
-                        'showitem' => '
-                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
-                            --palette--;;filePalette'
-                    ],
-                    \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
-                        'showitem' => '
-                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.audioOverlayPalette;audioOverlayPalette,
-                            --palette--;;filePalette'
-                    ],
-                    \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
-                        'showitem' => '
-                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.videoOverlayPalette;videoOverlayPalette,
-                            --palette--;;filePalette'
-                    ],
-                    \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
-                        'showitem' => '
-                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
-                            --palette--;;filePalette'
-                    ]
-                ]
+                'overrideChildTca' => [
+                    'types' => [
+                        '0' => [
+                            'showitem' => '
+                                --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                --palette--;;filePalette'
+                        ],
+                        \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
+                            'showitem' => '
+                                --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                --palette--;;filePalette'
+                        ],
+                        \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
+                            'showitem' => '
+                                --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                --palette--;;filePalette'
+                        ],
+                        \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
+                            'showitem' => '
+                                --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.audioOverlayPalette;audioOverlayPalette,
+                                --palette--;;filePalette'
+                        ],
+                        \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
+                            'showitem' => '
+                                --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.videoOverlayPalette;videoOverlayPalette,
+                                --palette--;;filePalette'
+                        ],
+                        \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
+                            'showitem' => '
+                                --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                --palette--;;filePalette'
+                        ]
+                    ],
+                ],
             ], $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext'])
         ],
         'imagewidth' => [
index 6f638a9..c0067df 100644 (file)
@@ -151,9 +151,9 @@ class RemoteServer extends AbstractHandler
                 // call diff class only if there is a difference
                 if ($configuration['type'] === 'inline' && $configuration['foreign_table'] === 'sys_file_reference') {
                     $useThumbnails = false;
-                    if (!empty($configuration['foreign_selector_fieldTcaOverride']['config']['appearance']['elementBrowserAllowed']) && !empty($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'])) {
+                    if (!empty($configuration['overrideChildTca']['columns']['uid_local']['config']['appearance']['elementBrowserAllowed']) && !empty($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'])) {
                         $fileExtensions = GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], true);
-                        $allowedExtensions = GeneralUtility::trimExplode(',', $configuration['foreign_selector_fieldTcaOverride']['config']['appearance']['elementBrowserAllowed'], true);
+                        $allowedExtensions = GeneralUtility::trimExplode(',', $configuration['overrideChildTca']['columns']['uid_local']['config']['appearance']['elementBrowserAllowed'], true);
                         $differentExtensions = array_diff($allowedExtensions, $fileExtensions);
                         $useThumbnails = empty($differentExtensions);
                     }