From 358f7d3a1a28bf99907b1e3bd8a82f599ef04c98 Mon Sep 17 00:00:00 2001
From: Benni Mack <benni@typo3.org>
Date: Mon, 30 Mar 2020 21:31:51 +0200
Subject: [PATCH] [BUGFIX] Use direct calls to BackendLayoutView

Instead of using "callUserFunction" which hands in an instance
of the current object for BackendLayoutView, which is never needed,
this change uses the method calls directly.

Resolves: #90896
Releases: master
Change-Id: I2746b7b6d3ce856379bcbad4e94eec14b5521ccc
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64019
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
---
 typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php b/typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php
index ea260e738794..311b69352f60 100644
--- a/typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php
+++ b/typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php
@@ -16,6 +16,7 @@ namespace TYPO3\CMS\Backend\Tree\View;
 
 use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Backend\View\BackendLayoutView;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction;
@@ -411,7 +412,8 @@ class PagePositionMap
     public function printRecordMap($lines, $colPosArray, $pid = 0)
     {
         $count = MathUtility::forceIntegerInRange(count($colPosArray), 1);
-        $backendLayout = GeneralUtility::callUserFunction(\TYPO3\CMS\Backend\View\BackendLayoutView::class . '->getSelectedBackendLayout', $pid, $this);
+        $backendLayoutProvider = GeneralUtility::makeInstance(BackendLayoutView::class);
+        $backendLayout = $backendLayoutProvider->getSelectedBackendLayout($pid);
         if (isset($backendLayout['__config']['backend_layout.'])) {
             $this->getLanguageService()->includeLLFile('EXT:backend/Resources/Private/Language/locallang_layout.xlf');
             $table = '<div class="table-fit"><table class="table table-condensed table-bordered table-vertical-top">';
@@ -423,7 +425,7 @@ class PagePositionMap
             }
             $table .= '</colgroup>';
             $table .= '<tbody>';
-            $tcaItems = GeneralUtility::callUserFunction(\TYPO3\CMS\Backend\View\BackendLayoutView::class . '->getColPosListItemsParsed', $pid, $this);
+            $tcaItems = $backendLayoutProvider->getColPosListItemsParsed($pid);
             // Cycle through rows
             for ($row = 1; $row <= $rowCount; $row++) {
                 $rowConfig = $backendLayout['__config']['backend_layout.']['rows.'][$row . '.'];
-- 
GitLab