[TASK] Deprecate form mixins 75/62375/2
authorMathias Brodala <mbrodala@pagemachine.de>
Fri, 22 Nov 2019 14:35:27 +0000 (15:35 +0100)
committerRalf Zimmermann <ralf.zimmermann@tritum.de>
Fri, 22 Nov 2019 16:32:06 +0000 (17:32 +0100)
Resolves: #89742
Releases: master
Change-Id: Iedb8b23b5faf47a23dc2b0147c6cb4c620b3d74f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62375
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Ralf Zimmermann <ralf.zimmermann@tritum.de>
Reviewed-by: Ralf Zimmermann <ralf.zimmermann@tritum.de>
typo3/sysext/core/Documentation/Changelog/master/Deprecation-89742-FormMixins.rst [new file with mode: 0644]
typo3/sysext/form/Classes/Mvc/Configuration/InheritancesResolverService.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-89742-FormMixins.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-89742-FormMixins.rst
new file mode 100644 (file)
index 0000000..048042f
--- /dev/null
@@ -0,0 +1,36 @@
+.. include:: ../../Includes.txt
+
+=================================
+Deprecation: #89742 - Form mixins
+=================================
+
+See :issue:`89742`
+
+Description
+===========
+
+All mixins in the "form" extension have been deprecated and should not be used anymore. This affects all inheritances from :yaml:`TYPO3.CMS.Form.mixins.*`.
+
+The mixins have been deprecated with TYPO3v10 and will be removed with TYPO3v11.
+
+
+Impact
+======
+
+Form setup inheriting mixins from :yaml:`TYPO3.CMS.Form.mixins.*` will trigger a deprecation warning in TYPO3v10.
+
+With TYPO3v11 these mixins will be removed which will lead to an error.
+
+
+Affected Installations
+======================
+
+Instances using the "form" extension and inheriting from :yaml:`TYPO3.CMS.Form.mixins.*` in their form setup.
+
+
+Migration
+=========
+
+Embed the essential parts from :yaml:`TYPO3.CMS.Form.mixins.*` or migrate them to custom mixins.
+
+.. index:: Backend, Frontend, NotScanned, ext:form
\ No newline at end of file
index d16c69a..fa7c56c 100644 (file)
@@ -18,6 +18,7 @@ namespace TYPO3\CMS\Form\Mvc\Configuration;
 use TYPO3\CMS\Core\Utility\ArrayUtility;
 use TYPO3\CMS\Core\Utility\Exception\MissingArrayPathException;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Core\Utility\StringUtility;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Form\Mvc\Configuration\Exception\CycleInheritancesException;
 
@@ -190,6 +191,21 @@ class InheritancesResolverService
 
                     //and replace the __inheritance operator by the respective partial
                     if (is_array($inheritances)) {
+                        $deprecatedMixinInheritances = array_filter(
+                            $inheritances,
+                            function (string $inheritance): bool {
+                                return StringUtility::beginsWith($inheritance, 'TYPO3.CMS.Form.mixins.');
+                            }
+                        );
+
+                        if (!empty($deprecatedMixinInheritances)) {
+                            trigger_error(sprintf(
+                                'Deprecated form mixins used in "%s": %s',
+                                $path,
+                                implode(', ', $deprecatedMixinInheritances)
+                            ), E_USER_DEPRECATED);
+                        }
+
                         $inheritedConfigurations = $this->resolveInheritancesRecursive($inheritances);
                         $configuration[$key] = array_replace_recursive($inheritedConfigurations, $configuration[$key]);
                     }