mirror of
https://github.com/FriendsOfTYPO3/feedit.git
synced 2024-11-22 06:26:09 +01:00
[TASK] Deprecate FrontendEditingController
The class is not in use anymore, only feedit instantiates the class for legacy reasons. Also FrontendBackendUserAuthentication->frontendEdit which holds an instance of that, is deprecated. Resolves: #86110 Releases: master Change-Id: I3ff2ae529dd920d2abf9908f2ae94ae4c2bf9c15 Reviewed-on: https://review.typo3.org/58067 Reviewed-by: Georg Ringer <georg.ringer@gmail.com> Tested-by: TYPO3com <no-reply@typo3.com> Reviewed-by: Jörg Bösche <typo3@joergboesche.de> Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org> Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de> Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by: Georg Ringer <georg.ringer@gmail.com>
This commit is contained in:
parent
13a74ad9aa
commit
c79ca8afaf
1 changed files with 9 additions and 8 deletions
|
@ -21,7 +21,6 @@ use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Http\Server\MiddlewareInterface;
|
use Psr\Http\Server\MiddlewareInterface;
|
||||||
use Psr\Http\Server\RequestHandlerInterface;
|
use Psr\Http\Server\RequestHandlerInterface;
|
||||||
use TYPO3\CMS\Backend\FrontendBackendUserAuthentication;
|
use TYPO3\CMS\Backend\FrontendBackendUserAuthentication;
|
||||||
use TYPO3\CMS\Core\FrontendEditing\FrontendEditingController;
|
|
||||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||||
use TYPO3\CMS\Feedit\DataHandling\FrontendEditDataHandler;
|
use TYPO3\CMS\Feedit\DataHandling\FrontendEditDataHandler;
|
||||||
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
|
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
|
||||||
|
@ -45,9 +44,12 @@ class FrontendEditInitiator implements MiddlewareInterface
|
||||||
if (isset($GLOBALS['BE_USER']) && $GLOBALS['BE_USER'] instanceof FrontendBackendUserAuthentication) {
|
if (isset($GLOBALS['BE_USER']) && $GLOBALS['BE_USER'] instanceof FrontendBackendUserAuthentication) {
|
||||||
$config = $GLOBALS['BE_USER']->getTSConfig()['admPanel.'] ?? [];
|
$config = $GLOBALS['BE_USER']->getTSConfig()['admPanel.'] ?? [];
|
||||||
$active = (int)$GLOBALS['TSFE']->displayEditIcons === 1 || (int)$GLOBALS['TSFE']->displayFieldEditIcons === 1;
|
$active = (int)$GLOBALS['TSFE']->displayEditIcons === 1 || (int)$GLOBALS['TSFE']->displayFieldEditIcons === 1;
|
||||||
|
// Include classes for editing IF editing module in Admin Panel is open
|
||||||
if ($active && isset($config['enable.'])) {
|
if ($active && isset($config['enable.'])) {
|
||||||
foreach ($config['enable.'] as $value) {
|
foreach ($config['enable.'] as $value) {
|
||||||
if ($value) {
|
if ($value) {
|
||||||
|
$parameters = $request->getParsedBody()['TSFE_EDIT'] ?? $request->getQueryParams()['TSFE_EDIT'] ?? null;
|
||||||
|
$isValidEditAction = $this->isValidEditAction($parameters);
|
||||||
if ($GLOBALS['TSFE'] instanceof TypoScriptFrontendController) {
|
if ($GLOBALS['TSFE'] instanceof TypoScriptFrontendController) {
|
||||||
// Grab the Page TSConfig property that determines which controller to use.
|
// Grab the Page TSConfig property that determines which controller to use.
|
||||||
$pageTSConfig = $GLOBALS['TSFE']->getPagesTSconfig();
|
$pageTSConfig = $GLOBALS['TSFE']->getPagesTSconfig();
|
||||||
|
@ -55,18 +57,17 @@ class FrontendEditInitiator implements MiddlewareInterface
|
||||||
} else {
|
} else {
|
||||||
$controllerKey = 'default';
|
$controllerKey = 'default';
|
||||||
}
|
}
|
||||||
$controllerClassName = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController'][$controllerKey] ?? '';
|
/** @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)) {
|
if (!empty($controllerClassName)) {
|
||||||
$parameters = $request->getParsedBody()['TSFE_EDIT'] ?? $request->getQueryParams()['TSFE_EDIT'] ?? null;
|
/** @deprecated will be removed in TYPO3 v10.0. */
|
||||||
$isValidEditAction = $this->isValidEditAction($parameters);
|
|
||||||
$GLOBALS['BE_USER']->frontendEdit = GeneralUtility::makeInstance(
|
$GLOBALS['BE_USER']->frontendEdit = GeneralUtility::makeInstance(
|
||||||
$controllerClassName,
|
$controllerClassName,
|
||||||
$parameters
|
$parameters
|
||||||
);
|
);
|
||||||
// Include classes for editing IF editing module in Admin Panel is open
|
}
|
||||||
if ($GLOBALS['BE_USER']->frontendEdit instanceof FrontendEditingController && $isValidEditAction) {
|
if ($isValidEditAction) {
|
||||||
GeneralUtility::makeInstance(FrontendEditDataHandler::class, $parameters)->editAction();
|
GeneralUtility::makeInstance(FrontendEditDataHandler::class, $parameters)->editAction();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue