[TASK] TCA tree refactoring 00/50700/8
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 17 Nov 2016 17:51:13 +0000 (18:51 +0100)
committerTymoteusz Motylewski <t.motylewski@gmail.com>
Fri, 18 Nov 2016 14:53:25 +0000 (15:53 +0100)
commitdf0dcddf8a4954e0075f6f5ed0cf355c39ba6d26
treebe37d95b2f1df13bc0d9066a96a574ac72491acf
parent20a82fc0d633e92c620bebefa91aa44777ab0009
[TASK] TCA tree refactoring

The patch refactors the TCA tree form engine data calculation.

The tree now works with "new" (not yet persisted) records, even if
the record has types in combination with flex forms. For instance,
a new ext:news tt_content element now renders the category tree
within flex forms, even in new tt_content records that have not been
saved.

The TCA tree no longer fetches all items when opening a record initially,
but defers that to the ajax request. This gives a massive performance
improvement on initial load of a record if the displayed TCA tree is bigger.

The ajax request itself now compiles only data of the requested TCA field,
also resulting in a significant performance improvement.

As example, ext:styleguide "elements select" is now rendered much quicker
and the single ajax calls per tree are reduced from about 4 seconds to less
than a second each with my test data.

Change-Id: If3c4c1779f5fe1510ffc13d1c9f1151bddab13e9
Resolves: #78744
Releases: master
Reviewed-on: https://review.typo3.org/50700
Reviewed-by: Thomas Maroschik <tmaroschik@dfau.de>
Tested-by: Thomas Maroschik <tmaroschik@dfau.de>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
16 files changed:
typo3/sysext/backend/Classes/Controller/SelectTreeController.php
typo3/sysext/backend/Classes/Form/Container/FlexFormElementContainer.php
typo3/sysext/backend/Classes/Form/Element/SelectTreeElement.php
typo3/sysext/backend/Classes/Form/FormDataCompiler.php
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseRecordTypeValue.php
typo3/sysext/backend/Classes/Form/FormDataProvider/InitializeProcessedTca.php
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaFlexPrepare.php
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaFlexProcess.php
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectTreeItems.php
typo3/sysext/backend/Resources/Public/JavaScript/FormEngine/Element/SelectTreeElement.js
typo3/sysext/backend/Tests/Unit/Controller/SelectTreeControllerTest.php [new file with mode: 0644]
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseRecordTypeValueTest.php
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/InitializeProcessedTcaTest.php
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaFlexPrepareTest.php
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectTreeItemsTest.php
typo3/sysext/core/Tests/Acceptance/Backend/Page/AddPageInPageModuleCest.php