[TASK] Deprecate FrontendEditingController 67/58067/11
authorBenni Mack <benni@typo3.org>
Wed, 29 Aug 2018 07:59:57 +0000 (09:59 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Wed, 5 Sep 2018 08:03:29 +0000 (10:03 +0200)
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>
typo3/sysext/backend/Classes/FrontendBackendUserAuthentication.php
typo3/sysext/backend/ext_localconf.php
typo3/sysext/core/Classes/FrontendEditing/FrontendEditingController.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-86110-FrontendEditingController.rst [new file with mode: 0644]
typo3/sysext/feedit/Classes/Middleware/FrontendEditInitiator.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyProtectedMatcher.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php

index 9e47fbb..dbaca5d 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend;
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
-use TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait;
 use TYPO3\CMS\Core\Context\Context;
 use TYPO3\CMS\Core\Context\LanguageAspect;
 use TYPO3\CMS\Core\Database\ConnectionPool;
@@ -33,18 +32,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
  */
 class FrontendBackendUserAuthentication extends BackendUserAuthentication
 {
-    use PublicPropertyDeprecationTrait;
-
-    /**
-     * Properties which have been moved to protected status from public
-     *
-     * @var array
-     */
-    protected $deprecatedPublicProperties = [
-        'extAdmEnabled' => 'Using $extAdmEnabled of class FrontendBackendUserAuthentication from the outside is discouraged, as this variable is only used for internal storage.',
-        'adminPanel' => 'Using $adminPanel of class FrontendBackendUserAuthentication from the outside is discouraged, as this variable is only used for internal storage.',
-        'extAdminConfig' => 'Using $extAdminConfig of class FrontendBackendUserAuthentication from the outside is discouraged, as this variable is only used for internal storage.',
-    ];
 
     /**
      * Form field with login name.
@@ -98,6 +85,7 @@ class FrontendBackendUserAuthentication extends BackendUserAuthentication
 
     /**
      * @var \TYPO3\CMS\Core\FrontendEditing\FrontendEditingController
+     * @deprecated since TYPO3 v9, property will be removed in TYPO3 v10 - see extension "feedit" how the functionality could be used.
      */
     public $frontendEdit;
 
index 073da8d..c6a2e4c 100644 (file)
@@ -33,8 +33,6 @@ $GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1460321142] = [
     'class' => \TYPO3\CMS\Backend\View\Wizard\Element\BackendLayoutWizardElement::class,
 ];
 
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default'] = \TYPO3\CMS\Core\FrontendEditing\FrontendEditingController::class;
-
 // Register search key shortcuts
 $GLOBALS['TYPO3_CONF_VARS']['SYS']['livesearch']['page'] = 'pages';
 
index 4e58944..fd82c57 100644 (file)
@@ -31,6 +31,8 @@ use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
 
 /**
  * Controller class for frontend editing.
+ *
+ * @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0. Functionality has been moved to EXT:feedit, FrontendBackendUserAuthentication and ContentObjectRenderer.
  */
 class FrontendEditingController
 {
@@ -42,6 +44,11 @@ class FrontendEditingController
      */
     public $TSFE_EDIT;
 
+    public function __construct()
+    {
+        trigger_error(__CLASS__ . ' will be removed in TYPO3 v10.0. Functionality has been moved to EXT:feedit, FrontendBackendUserAuthentication and ContentObjectRenderer.', E_USER_DEPRECATED);
+    }
+
     /**
      * Initializes configuration options.
      */
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-86110-FrontendEditingController.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-86110-FrontendEditingController.rst
new file mode 100644 (file)
index 0000000..a8f8838
--- /dev/null
@@ -0,0 +1,36 @@
+.. include:: ../../Includes.txt
+
+===============================================
+Deprecation: #86110 - FrontendEditingController
+===============================================
+
+See :issue:`86110`
+
+Description
+===========
+
+The class :php:`\TYPO3\CMS\Core\FrontendEditing\FrontendEditingController` is not in use anymore, only feedit instantiates the class for legacy reasons.
+
+Also, property :php:`FrontendBackendUserAuthentication->frontendEdit` which holds an instance of
+it, has been marked as deprecated.
+
+
+Impact
+======
+
+The functionality of this class has been moved into ext:feedit.
+If an instance needs access to frontend editing, it can be accessed from there.
+
+
+Affected Installations
+======================
+
+Instances accessing the deprecated class or function will **NOT** trigger a PHP :php:`E_USER_DEPRECATED` error,
+
+
+Migration
+=========
+
+Refer to ext:feedit for inspiration.
+
+.. index:: PHP-API, FullyScanned, ext:feedit
index fc958ca..8c0b77b 100644 (file)
@@ -21,7 +21,6 @@ use Psr\Http\Message\ServerRequestInterface;
 use Psr\Http\Server\MiddlewareInterface;
 use Psr\Http\Server\RequestHandlerInterface;
 use TYPO3\CMS\Backend\FrontendBackendUserAuthentication;
-use TYPO3\CMS\Core\FrontendEditing\FrontendEditingController;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Feedit\DataHandling\FrontendEditDataHandler;
 use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
@@ -45,9 +44,12 @@ class FrontendEditInitiator implements MiddlewareInterface
         if (isset($GLOBALS['BE_USER']) && $GLOBALS['BE_USER'] instanceof FrontendBackendUserAuthentication) {
             $config = $GLOBALS['BE_USER']->getTSConfig()['admPanel.'] ?? [];
             $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.'])) {
                 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();
@@ -55,18 +57,17 @@ class FrontendEditInitiator implements MiddlewareInterface
                         } else {
                             $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)) {
-                            $parameters = $request->getParsedBody()['TSFE_EDIT'] ?? $request->getQueryParams()['TSFE_EDIT'] ?? null;
-                            $isValidEditAction = $this->isValidEditAction($parameters);
+                            /** @deprecated will be removed in TYPO3 v10.0. */
                             $GLOBALS['BE_USER']->frontendEdit = GeneralUtility::makeInstance(
                                 $controllerClassName,
                                 $parameters
                             );
-                            // Include classes for editing IF editing module in Admin Panel is open
-                            if ($GLOBALS['BE_USER']->frontendEdit instanceof FrontendEditingController && $isValidEditAction) {
-                                GeneralUtility::makeInstance(FrontendEditDataHandler::class, $parameters)->editAction();
-                            }
+                        }
+                        if ($isValidEditAction) {
+                            GeneralUtility::makeInstance(FrontendEditDataHandler::class, $parameters)->editAction();
                         }
                         break;
                     }
index dae0ad6..afc4eac 100644 (file)
@@ -359,6 +359,11 @@ return [
             'Important-82229-FluidImplementationOfCmsVariableProviderRemoved.rst',
         ],
     ],
+    'TYPO3\CMS\Core\FrontendEditing\FrontendEditingController' => [
+        'restFiles' => [
+            'Deprecation-86110-FrontendEditingController.rst',
+        ],
+    ],
     'TYPO3\CMS\Core\ExtDirect\ExtDirectDebug' => [
         'restFiles' => [
             'Breaking-37180-RemovedExtDirectDebugAndGLOBALSerror.rst',
index abcf9aa..249caae 100644 (file)
@@ -842,4 +842,24 @@ return [
             'Deprecation-85902-IMGMENUGMENU.rst',
         ],
     ],
+    'TYPO3\CMS\Backend\FrontendBackendUserAuthentication->adminPanel' => [
+        'restFiles' => [
+            'Deprecation-84641-DeprecatedAdminPanelRelatedMethods.rst',
+        ],
+    ],
+    'TYPO3\CMS\Backend\FrontendBackendUserAuthentication->extAdminConfig' => [
+        'restFiles' => [
+            'Deprecation-84641-DeprecatedAdminPanelRelatedMethods.rst',
+        ],
+    ],
+    'TYPO3\CMS\Backend\FrontendBackendUserAuthentication->extAdmEnabled' => [
+        'restFiles' => [
+            'Deprecation-84641-DeprecatedAdminPanelRelatedMethods.rst',
+        ],
+    ],
+    'TYPO3\CMS\Backend\FrontendBackendUserAuthentication->frontendEdit' => [
+        'restFiles' => [
+            'Deprecation-86110-FrontendEditingController.rst',
+        ],
+    ],
 ];
index 1c8dce1..cba54ef 100644 (file)
@@ -376,21 +376,6 @@ return [
             'Deprecation-84295-UseServerRequestInterfaceInFileEditFileController.rst',
         ],
     ],
-    'TYPO3\CMS\Backend\FrontendBackendUserAuthentication->adminPanel' => [
-        'restFiles' => [
-            'Deprecation-84641-DeprecatedAdminPanelRelatedMethods.rst',
-        ],
-    ],
-    'TYPO3\CMS\Backend\FrontendBackendUserAuthentication->extAdminConfig' => [
-        'restFiles' => [
-            'Deprecation-84641-DeprecatedAdminPanelRelatedMethods.rst',
-        ],
-    ],
-    'TYPO3\CMS\Backend\FrontendBackendUserAuthentication->extAdmEnabled' => [
-        'restFiles' => [
-            'Deprecation-84641-DeprecatedAdminPanelRelatedMethods.rst',
-        ],
-    ],
     'TYPO3\CMS\Core\Charset\CharsetConverter->synonyms' => [
         'restFiles' => [
             'Deprecation-85122-FunctionalityInCharsetConverter.rst'