[!!!][TASK] TCA: Remove "parentPageTca" FormDataProvider 07/61207/4
authorBenni Mack <benni@typo3.org>
Mon, 1 Jul 2019 15:08:21 +0000 (17:08 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sun, 14 Jul 2019 10:52:06 +0000 (12:52 +0200)
The property "vanillaParentPageTca " inside FormEngine
is never used - also documented that it was never used before.

The property is therefore removed.

Resolves: #88669
Releases: master
Change-Id: I71166ea44764d8bdc4b0c309a43f45f46309780f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61207
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Björn Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Classes/Form/FormDataCompiler.php
typo3/sysext/backend/Classes/Form/FormDataProvider/ParentPageTca.php [deleted file]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/ParentPageTcaTest.php [deleted file]
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-88669-FormEngineFormDataProviderParentPageTcaRemoved.rst [new file with mode: 0644]

index 01dcab8..addf13a 100644 (file)
@@ -182,8 +182,6 @@ class FormDataCompiler
             // of handled record was determined, record type specific settings [TCEFORM.][tableName.][field.][types.][type.]
             // are merged into [TCEFORM.][tableName.][field.]. Array keys still contain the concatenation dots.
             'pageTsConfig' => [],
-            // Not changed TCA of parent page row if record is edited or added below a page and not root node
-            'vanillaParentPageTca' => null,
             // List of available system languages. Array key is the system language uid, value array
             // contains details of the record, with iso code resolved. Key is the sys_language_uid uid.
             'systemLanguageRows' => [],
diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/ParentPageTca.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/ParentPageTca.php
deleted file mode 100644 (file)
index 78ee0e8..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-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;
-
-/**
- * Add vanilla TCA of parent page
- *
- * @todo: maybe not needed?
- */
-class ParentPageTca implements FormDataProviderInterface
-{
-    /**
-     * vanillaParentPageTca will stay NULL if record is added or edited below root node.
-     *
-     * @param array $result
-     * @return array
-     */
-    public function addData(array $result)
-    {
-        if (is_array($result['parentPageRow'])) {
-            $result['vanillaParentPageTca'] = $GLOBALS['TCA']['pages'];
-        }
-        return $result;
-    }
-}
diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/ParentPageTcaTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/ParentPageTcaTest.php
deleted file mode 100644 (file)
index 784f9d8..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-namespace TYPO3\CMS\Backend\Tests\Unit\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\FormDataProvider\ParentPageTca;
-use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
-
-/**
- * Test case
- */
-class ParentPageTcaTest extends UnitTestCase
-{
-    /**
-     * @var ParentPageTca
-     */
-    protected $subject;
-
-    protected function setUp(): void
-    {
-        parent::setUp();
-        $this->subject = new ParentPageTca();
-    }
-
-    /**
-     * @test
-     */
-    public function addDataSetsTableTcaFromGlobalsPagesTcaInResult()
-    {
-        $input = [
-            'tableName' => 'aTable',
-            'parentPageRow' => [],
-        ];
-        $expected = ['foo'];
-        $GLOBALS['TCA']['pages'] = $expected;
-        $result = $this->subject->addData($input);
-        $this->assertEquals($expected, $result['vanillaParentPageTca']);
-    }
-}
index a5ddee1..68dd1b7 100644 (file)
@@ -380,18 +380,13 @@ return [
                             \TYPO3\CMS\Backend\Form\FormDataProvider\PageTsConfig::class,
                         ],
                     ],
-                    \TYPO3\CMS\Backend\Form\FormDataProvider\ParentPageTca::class => [
-                        'depends' => [
-                            \TYPO3\CMS\Backend\Form\FormDataProvider\InlineOverrideChildTca::class
-                        ],
-                    ],
                     \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRowInitializeNew::class => [
                         'depends' => [
                             \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseUserPermissionCheck::class,
                             \TYPO3\CMS\Backend\Form\FormDataProvider\UserTsConfig::class,
                             \TYPO3\CMS\Backend\Form\FormDataProvider\PageTsConfig::class,
                             \TYPO3\CMS\Backend\Form\FormDataProvider\InitializeProcessedTca::class,
-                            \TYPO3\CMS\Backend\Form\FormDataProvider\ParentPageTca::class,
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\InlineOverrideChildTca::class,
                         ],
                     ],
                     \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseUniqueUidNewRow::class => [
@@ -634,17 +629,11 @@ return [
                             \TYPO3\CMS\Backend\Form\FormDataProvider\UserTsConfig::class
                         ],
                     ],
-                    \TYPO3\CMS\Backend\Form\FormDataProvider\ParentPageTca::class => [
-                        'depends' => [
-                            \TYPO3\CMS\Backend\Form\FormDataProvider\PageTsConfig::class,
-                        ],
-                    ],
                     \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRowInitializeNew::class => [
                         'depends' => [
                             \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseUserPermissionCheck::class,
                             \TYPO3\CMS\Backend\Form\FormDataProvider\UserTsConfig::class,
                             \TYPO3\CMS\Backend\Form\FormDataProvider\PageTsConfig::class,
-                            \TYPO3\CMS\Backend\Form\FormDataProvider\ParentPageTca::class,
                         ],
                     ],
                     \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseUniqueUidNewRow::class => [
@@ -885,18 +874,13 @@ return [
                             \TYPO3\CMS\Backend\Form\FormDataProvider\PageTsConfig::class,
                         ],
                     ],
-                    \TYPO3\CMS\Backend\Form\FormDataProvider\ParentPageTca::class => [
-                        'depends' => [
-                            \TYPO3\CMS\Backend\Form\FormDataProvider\InlineOverrideChildTca::class
-                        ],
-                    ],
                     \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRowInitializeNew::class => [
                         'depends' => [
                             \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseUserPermissionCheck::class,
                             \TYPO3\CMS\Backend\Form\FormDataProvider\UserTsConfig::class,
                             \TYPO3\CMS\Backend\Form\FormDataProvider\PageTsConfig::class,
                             \TYPO3\CMS\Backend\Form\FormDataProvider\InitializeProcessedTca::class,
-                            \TYPO3\CMS\Backend\Form\FormDataProvider\ParentPageTca::class,
+                            \TYPO3\CMS\Backend\Form\FormDataProvider\InlineOverrideChildTca::class,
                         ],
                     ],
                     \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseUniqueUidNewRow::class => [
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-88669-FormEngineFormDataProviderParentPageTcaRemoved.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-88669-FormEngineFormDataProviderParentPageTcaRemoved.rst
new file mode 100644 (file)
index 0000000..20e31cf
--- /dev/null
@@ -0,0 +1,40 @@
+.. include:: ../../Includes.txt
+
+======================================================================
+Breaking: #88669 - FormEngine FormDataProvider "parentPageTca" removed
+======================================================================
+
+See :issue:`88669`
+
+Description
+===========
+
+FormEngine added "parentPageTca" by default to the result object. It was added in TYPO3 v7 during
+refactoring, but already commented that it wasn't used at all in Core, and might not be necessary.
+
+It contained a copy of :php:`$GLOBALS['TCA']['pages']`, which can be obtained directly as well.
+
+The DataProvider and the value within the result key has been removed.
+
+
+Impact
+======
+
+When accessing the `parentPageTca` key within a FormDataProvider or Node (FormEngine-related only),
+a PHP notice is given due to a non-existing array key.
+
+
+Affected Installations
+======================
+
+TYPO3 installations with custom FormDataProviders for FormEngine relying on the "parentPageTca"
+DataProvider, which is highly unlikely.
+
+
+Migration
+=========
+
+Instead of accessing `$result['parentPageTca'] within a custom FormDataProvider or FormRenderNode,
+:php:`$GLOBALS['TCA']['pages']` can be accessed directly.
+
+.. index:: TCA, NotScanned
\ No newline at end of file