[TASK] Do not use ObjectManager to instantiate PageTitleProviderManager 52/59752/3
authorBenjamin Franzke <bfr@qbus.de>
Mon, 18 Feb 2019 22:38:07 +0000 (23:38 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Tue, 19 Feb 2019 23:57:35 +0000 (00:57 +0100)
PageTitleProviderManager is public API in EXT:core and should therefore
not depend on initialization through the EXT:extbase ObjectManager.

PageTitleProviderManager actually does not use any ObjectManager features,
so the current instantiation in TypoScriptFrontendController can simply be
replaced by GeneralUtility::makeInstance().

Releases: master, 9.5
Resolves: #87735
Change-Id: I56231f834b6cf40d613bea84334eb48d03ca6094
Reviewed-on: https://review.typo3.org/c/59752
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index ca097ac..ad341b3 100644 (file)
@@ -61,7 +61,6 @@ use TYPO3\CMS\Core\Utility\HttpUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Core\Utility\PathUtility;
 use TYPO3\CMS\Core\Utility\RootlineUtility;
-use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
 use TYPO3\CMS\Frontend\Page\PageAccessFailureReasons;
@@ -2795,7 +2794,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             }
         }
 
-        $titleProvider = GeneralUtility::makeInstance(ObjectManager::class)->get(PageTitleProviderManager::class);
+        $titleProvider = GeneralUtility::makeInstance(PageTitleProviderManager::class);
         $pageTitle = $titleProvider->getTitle();
 
         $titleTagContent = $this->printTitle(