From fae113b55cd8a127a46e44f1f5d75b630315f09e Mon Sep 17 00:00:00 2001
From: Benni Mack <benni@typo3.org>
Date: Thu, 30 Jan 2020 08:33:53 +0100
Subject: [PATCH] [BUGFIX] Use direct method calls for backend layouts in Page
 Module

Within all refactorings, fetching the correct backend layout and relevant colPos
information was still called via callUserFunction which is not needed at all,
as it is a static information (class + method name) so a regular method call
via PHP works just fine.

Resolves: #90254
Releases: master
Change-Id: I712e86b3a5d343bad3b4752a21dac9cbdc510f46
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63073
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
---
 .../backend/Classes/Controller/PageLayoutController.php     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php
index 8a4905ab643c..e9f80ab6604f 100644
--- a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php
+++ b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php
@@ -680,7 +680,8 @@ class PageLayoutController
             ');
 
             // Find backend layout / columns
-            $backendLayout = GeneralUtility::callUserFunction(BackendLayoutView::class . '->getSelectedBackendLayout', $this->id, $this);
+            $backendLayoutContainer = GeneralUtility::makeInstance(BackendLayoutView::class);
+            $backendLayout = $backendLayoutContainer->getSelectedBackendLayout($this->id);
             if (!empty($backendLayout['__colPosList'])) {
                 $this->colPosList = implode(',', $backendLayout['__colPosList']);
             }
@@ -765,6 +766,8 @@ class PageLayoutController
         // Initialize other variables:
         $tableOutput = [];
         $CMcounter = 0;
+        $backendLayoutContainer = GeneralUtility::makeInstance(BackendLayoutView::class);
+        $tcaItems = $backendLayoutContainer->getColPosListItemsParsed($this->id);
         // Traverse the list of table names which has records on this page (that array is populated
         // by the $dblist object during the function getTableMenu()):
         foreach ($dbList->activeTables as $table => $value) {
@@ -778,7 +781,6 @@ class PageLayoutController
                 // Setting up the tt_content columns to show:
                 if (is_array($GLOBALS['TCA']['tt_content']['columns']['colPos']['config']['items'])) {
                     $colList = [];
-                    $tcaItems = GeneralUtility::callUserFunction(BackendLayoutView::class . '->getColPosListItemsParsed', $this->id, $this);
                     foreach ($tcaItems as $temp) {
                         $colList[] = $temp[1];
                     }
-- 
GitLab