[BUGFIX] Wrong usage of array_unique() 91/18691/4
authorAndreas Lingott <lingott@gmail.com>
Tue, 5 Mar 2013 07:31:16 +0000 (08:31 +0100)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Tue, 5 Mar 2013 13:03:46 +0000 (14:03 +0100)
RootlineUtility.php does not use return value of array_unique() call,
which makes the call ineffective.

This causes some huge SQL queries and increases page load time heavily.

Resolves: #46000
Releases: 6.1, 6.0
Change-Id: Ic614a22a97927cc433eab9e5bf1b6125d53b5882
Reviewed-on: https://review.typo3.org/18691
Reviewed-by: Michael Stucki
Tested-by: Michael Stucki
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
typo3/sysext/core/Classes/Utility/RootlineUtility.php

index 90a31f2..591ccb8 100644 (file)
@@ -160,7 +160,7 @@ class RootlineUtility {
                        self::$cache = $GLOBALS['typo3CacheManager']->getCache('cache_rootline');
                }
                self::$rootlineFields = array_merge(self::$rootlineFields, \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'], TRUE));
-               array_unique(self::$rootlineFields);
+               self::$rootlineFields = array_unique(self::$rootlineFields);
                $this->databaseConnection = $GLOBALS['TYPO3_DB'];
        }