Skip to content

Commit

Permalink
[BUGFIX] RootlineUtility only resolves defined relation fields
Browse files Browse the repository at this point in the history
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/56015
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
  • Loading branch information
bmack authored and Jigal van Hemert committed Mar 6, 2018
1 parent 7ef3270 commit d3c12b7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion typo3/sysext/core/Classes/Utility/RootlineUtility.php
Expand Up @@ -284,7 +284,8 @@ protected function enrichWithRelationFields($uid, array $pageRecord)

// @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 */
Expand Down
@@ -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

0 comments on commit d3c12b7

Please sign in to comment.