[TASK] Protect render() method in BackendController 09/58209/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 7 Sep 2018 09:41:02 +0000 (11:41 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 7 Sep 2018 15:13:19 +0000 (17:13 +0200)
Resolves: #86179
Releases: master
Change-Id: Ie61ab04889e36b5290a0d8f4fc1fb68dd95a87ac
Reviewed-on: https://review.typo3.org/58209
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: rolandgolla <rolandgolla@gmail.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-86179-ProtectedRenderMethodInBackendController.rst [new file with mode: 0644]

index 62b713f..60c3f15 100644 (file)
@@ -20,6 +20,7 @@ use TYPO3\CMS\Backend\Module\ModuleLoader;
 use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait;
 use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction;
@@ -40,6 +41,15 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
  */
 class BackendController
 {
+    use PublicMethodDeprecationTrait;
+
+    /**
+     * @var array
+     */
+    private $deprecatedPublicMethods = [
+        'render' => 'Using BackendController::render() is deprecated and will not be possible anymore in TYPO3 v10.',
+    ];
+
     /**
      * @var string
      */
@@ -235,7 +245,7 @@ class BackendController
     /**
      * Main function generating the BE scaffolding
      */
-    public function render()
+    protected function render()
     {
         $this->executeHook('renderPreProcess');
 
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-86179-ProtectedRenderMethodInBackendController.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-86179-ProtectedRenderMethodInBackendController.rst
new file mode 100644 (file)
index 0000000..f5a9aa2
--- /dev/null
@@ -0,0 +1,36 @@
+.. include:: ../../Includes.txt
+
+====================================================================
+Deprecation: #86179 - Protected render() method in BackendController
+====================================================================
+
+See :issue:`86179`
+
+Description
+===========
+
+Method :php:`TYPO3\CMS\Backend\Controller\BackendController->render()` has been set from
+public to protected and should not be called any longer.
+
+
+Impact
+======
+
+Calling the method from an external object triggers a PHP :php:`E_USER_DEPRECATED` error.
+
+
+Affected Installations
+======================
+
+This internal method is usually not called by extensions directly. Since the method name
+is so generic, the extension scanner is not configured to search for usages, it would
+trigger far too many false positives.
+
+
+Migration
+=========
+
+Use route target :php:`main` instead that calls method :php:`mainAction` and returns a
+proper PSR-7 Response object.
+
+.. index:: Backend, PHP-API, NotScanned
\ No newline at end of file