[BUGFIX] RootlineUtility only resolves defined relation fields 19/56019/3
authorBenni Mack <benni@typo3.org>
Mon, 5 Mar 2018 18:49:50 +0000 (19:49 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Tue, 6 Mar 2018 07:10:06 +0000 (08:10 +0100)
The RootlineUtility first selects all fields, which have been added
via the config option "addRootLineFields". After that, it iterates
over all(!) columns that are defined as relation.

The change modifies the loop so that only relations are resolved for
field pages.media (predefined) and those fields that have been added
to $GLOBALS[TYPO3_CONF_VARS][FE][addRootLineFields].

Resolves: #84144
Releases: master, 8.7
Change-Id: I3150f7cdd14aff3f25d5070f4ce190d510ba3614
Reviewed-on: https://review.typo3.org/56019
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Classes/Utility/RootlineUtility.php
typo3/sysext/core/Documentation/Changelog/8.7.x/Important-84144-RootlineUtilityIsEnrichingOnlyProperlySelectedRelationalDatabaseFields.rst\t [new file with mode: 0644]

index 5dba704..faf46bf 100644 (file)
@@ -284,7 +284,8 @@ class RootlineUtility
 
         // @todo Remove this special interpretation of relations by consequently using RelationHandler
         foreach ($GLOBALS['TCA']['pages']['columns'] as $column => $configuration) {
-            if ($this->columnHasRelationToResolve($configuration)) {
+            // Ensure that only fields defined in $rootlineFields (and "addRootLineFields") are actually evaluated
+            if (array_key_exists($column, $pageRecord) && $this->columnHasRelationToResolve($configuration)) {
                 $configuration = $configuration['config'];
                 if ($configuration['MM']) {
                     /** @var $loadDBGroup \TYPO3\CMS\Core\Database\RelationHandler */
diff --git a/typo3/sysext/core/Documentation/Changelog/8.7.x/Important-84144-RootlineUtilityIsEnrichingOnlyProperlySelectedRelationalDatabaseFields.rst\t b/typo3/sysext/core/Documentation/Changelog/8.7.x/Important-84144-RootlineUtilityIsEnrichingOnlyProperlySelectedRelationalDatabaseFields.rst\t
new file mode 100644 (file)
index 0000000..55daecf
--- /dev/null
@@ -0,0 +1,20 @@
+.. include:: ../../Includes.txt
+
+==================================================================================================
+Important: #84144 - RootlineUtility is enriching only properly selected relational database fields
+==================================================================================================
+
+See :issue:`84144`
+
+Description
+===========
+
+The main functionality for fetching the whole rootline of a page previously fetched all relational
+fields defined in TCA of a page record. This led to massive performance problems with large menus,
+as not all fields are necessary in root line records.
+
+Now, the rootline fetching only looks up relational data of fields which have been added to
+:php:`$GLOBALS[TYPO3_CONF_VARS][FE][addRootLineFields]`. The field `pages.media` is added per
+default since it is a predefined value.
+
+.. index:: Frontend, ext:frontend