From f2d64c49f21e9271f901b610f06d6dfb283cd0fe Mon Sep 17 00:00:00 2001 From: Benni Mack Date: Wed, 19 Dec 2018 09:59:28 +0100 Subject: [PATCH] [!!!][TASK] Remove deprecated adminpanel/feedit code The following previously deprecated classes/interfaces have been removed: * TYPO3\CMS\Adminpanel\View\AdminPanelView * TYPO3\CMS\Adminpanel\View\AdminPanelViewHookInterface * TYPO3\CMS\Core\FrontendEditing\FrontendEditingController The following methods have been removed: * TYPO3\CMS\Backend\FrontendBackendUserAuthentication->initializeAdminPanel() * TYPO3\CMS\Backend\FrontendBackendUserAuthentication->initializeFrontendEdit() * TYPO3\CMS\Backend\FrontendBackendUserAuthentication->isFrontendEditingActive() * TYPO3\CMS\Backend\FrontendBackendUserAuthentication->displayAdminPanel() * TYPO3\CMS\Backend\FrontendBackendUserAuthentication->isAdminPanelVisible() * TYPO3\CMS\Backend\FrontendBackendUserAuthentication->checkBackendAccessSettingsFromInitPhp() * TYPO3\CMS\Backend\FrontendBackendUserAuthentication->extPageReadAccess() * TYPO3\CMS\Backend\FrontendBackendUserAuthentication->extGetTreeList() * TYPO3\CMS\Backend\FrontendBackendUserAuthentication->extGetLL() The following public properties have been removed * TYPO3\CMS\Backend\FrontendBackendUserAuthentication->extAdmEnabled * TYPO3\CMS\Backend\FrontendBackendUserAuthentication->adminPanel * TYPO3\CMS\Backend\FrontendBackendUserAuthentication->frontendEdit * TYPO3\CMS\Backend\FrontendBackendUserAuthentication->extAdminConfig The following PageTSconfig option has no effect anymore: * TSFE.frontendEditingController Resolves: #87231 Releases: master Change-Id: I88cc3ac18077f054cc8895f5ccfb65291e94defa Reviewed-on: https://review.typo3.org/59205 Tested-by: TYPO3com Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn Reviewed-by: Anja Leichsenring Tested-by: Anja Leichsenring --- .../DataHandling/FrontendEditDataHandler.php | 5 +++-- Classes/Middleware/FrontendEditInitiator.php | 20 +------------------ 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/Classes/DataHandling/FrontendEditDataHandler.php b/Classes/DataHandling/FrontendEditDataHandler.php index f40a8d1..0529cf2 100644 --- a/Classes/DataHandling/FrontendEditDataHandler.php +++ b/Classes/DataHandling/FrontendEditDataHandler.php @@ -16,7 +16,9 @@ namespace TYPO3\CMS\Feedit\DataHandling; * The TYPO3 project - inspiring people to share! */ +use TYPO3\CMS\Adminpanel\Utility\StateUtility; use TYPO3\CMS\Backend\FrontendBackendUserAuthentication; +use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\Restriction\EndTimeRestriction; use TYPO3\CMS\Core\Database\Query\Restriction\FrontendGroupRestriction; @@ -24,7 +26,6 @@ use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction; use TYPO3\CMS\Core\Database\Query\Restriction\StartTimeRestriction; use TYPO3\CMS\Core\DataHandling\DataHandler; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Frontend\View\AdminPanelView; /** * Calls DataHandler and stores data @@ -208,7 +209,7 @@ class FrontendEditDataHandler ->setMaxResults(2); // Disable the default restrictions (but not all) if the admin panel is in preview mode - if ($this->user->adminPanel instanceof AdminPanelView && $this->user->adminPanel->extGetFeAdminValue('preview')) { + if (StateUtility::isActivatedForUser() && GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('visibility', 'includeHiddenContent')) { $queryBuilder->getRestrictions() ->removeByType(StartTimeRestriction::class) ->removeByType(EndTimeRestriction::class) diff --git a/Classes/Middleware/FrontendEditInitiator.php b/Classes/Middleware/FrontendEditInitiator.php index e450c43..c50fef6 100644 --- a/Classes/Middleware/FrontendEditInitiator.php +++ b/Classes/Middleware/FrontendEditInitiator.php @@ -23,7 +23,6 @@ use Psr\Http\Server\RequestHandlerInterface; use TYPO3\CMS\Backend\FrontendBackendUserAuthentication; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Feedit\DataHandling\FrontendEditDataHandler; -use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; /** * PSR-15 middleware initializing frontend editing @@ -51,24 +50,7 @@ class FrontendEditInitiator implements MiddlewareInterface foreach ($config['enable.'] as $value) { if ($value) { $parameters = $request->getParsedBody()['TSFE_EDIT'] ?? $request->getQueryParams()['TSFE_EDIT'] ?? null; - $isValidEditAction = $this->isValidEditAction($parameters); - if ($GLOBALS['TSFE'] instanceof TypoScriptFrontendController) { - // Grab the Page TSConfig property that determines which controller to use. - $pageTSConfig = $GLOBALS['TSFE']->getPagesTSconfig(); - $controllerKey = $pageTSConfig['TSFE.']['frontendEditingController'] ?? 'default'; - } else { - $controllerKey = 'default'; - } - /** @deprecated will be removed in TYPO3 v10.0. */ - $controllerClassName = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController'][$controllerKey] ?? \TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::class; - if (!empty($controllerClassName)) { - /** @deprecated will be removed in TYPO3 v10.0. */ - $GLOBALS['BE_USER']->frontendEdit = GeneralUtility::makeInstance( - $controllerClassName, - $parameters - ); - } - if ($isValidEditAction) { + if ($this->isValidEditAction($parameters)) { GeneralUtility::makeInstance(FrontendEditDataHandler::class, $parameters)->editAction(); } break;