[TASK] Protect methods in ElementBrowserController 22/58222/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 7 Sep 2018 17:04:28 +0000 (19:04 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sun, 9 Sep 2018 16:34:04 +0000 (18:34 +0200)
Resolves: #86192
Releases: master
Change-Id: Id7076427c911af750748e47902e87c1c48b2d2d7
Reviewed-on: https://review.typo3.org/58222
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Documentation/Changelog/master/Deprecation-86192-ProtectedMethodsInElementBrowserController.rst [new file with mode: 0644]
typo3/sysext/recordlist/Classes/Controller/ElementBrowserController.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-86192-ProtectedMethodsInElementBrowserController.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-86192-ProtectedMethodsInElementBrowserController.rst
new file mode 100644 (file)
index 0000000..8aaecab
--- /dev/null
@@ -0,0 +1,35 @@
+.. include:: ../../Includes.txt
+
+===================================================================
+Deprecation: #86192 - Protected methods in ElementBrowserController
+===================================================================
+
+See :issue:`86192`
+
+Description
+===========
+
+The following methods of class :php:`TYPO3\CMS\Recordlist\Controller\ElementBrowserController`
+changed their visibility from public to protected and should not be called any longer:
+
+* :php:`main()`
+
+
+Impact
+======
+
+Calling the above method from an external object triggers a PHP :php:`E_USER_DEPRECATED` error.
+
+
+Affected Installations
+======================
+
+The method is called internally only. Extensions are usually not affected by this.
+
+
+Migration
+=========
+
+Use the entry method :php:`mainAction()` that returns a PSR-7 response object.
+
+.. index:: Backend, PHP-API, NotScanned, ext:recordlist
\ No newline at end of file
index 9a8daac..7a147a6 100644 (file)
@@ -19,6 +19,7 @@ use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
+use TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait;
 use TYPO3\CMS\Core\Http\HtmlResponse;
 use TYPO3\CMS\Core\Http\RedirectResponse;
 use TYPO3\CMS\Core\Localization\LanguageService;
@@ -30,6 +31,15 @@ use TYPO3\CMS\Recordlist\Browser\ElementBrowserInterface;
  */
 class ElementBrowserController
 {
+    use PublicMethodDeprecationTrait;
+
+    /**
+     * @var array
+     */
+    private $deprecatedPublicMethods = [
+        'main' => 'Using ElementBrowserController::main() is deprecated and will not be possible anymore in TYPO3 v10.',
+    ];
+
     /**
      * The mode determines the main kind of output of the element browser.
      *
@@ -96,7 +106,7 @@ class ElementBrowserController
      *
      * @return string HTML content
      */
-    public function main()
+    protected function main()
     {
         $content = '';