[TASK] Protect methods in AbstractLinkBrowserController 23/58223/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 7 Sep 2018 17:47:43 +0000 (19:47 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Sun, 9 Sep 2018 16:46:42 +0000 (18:46 +0200)
Some public -> protected changes for AbstractLinkBrowserController
and BrowseLinksController

Resolves: #86193
Releases: master
Change-Id: I349dd5961ac2d90ede36a17c4d4ca550171e315e
Reviewed-on: https://review.typo3.org/58223
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Documentation/Changelog/master/Deprecation-86193-ProtectMethodsInAbstractLinkBrowserController.rst [new file with mode: 0644]
typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php
typo3/sysext/recordlist/Classes/Controller/AbstractLinkBrowserController.php
typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-86193-ProtectMethodsInAbstractLinkBrowserController.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-86193-ProtectMethodsInAbstractLinkBrowserController.rst
new file mode 100644 (file)
index 0000000..4b67a3f
--- /dev/null
@@ -0,0 +1,40 @@
+.. include:: ../../Includes.txt
+
+======================================================================
+Deprecation: #86193 - Protect methods in AbstractLinkBrowserController
+======================================================================
+
+See :issue:`86193`
+
+Description
+===========
+
+The following methods changed their visibility from public to protected and
+should not be called any longer:
+
+* :php:`TYPO3\CMS\Recordlist\Controller\AbstractLinkBrowserController->renderLinkAttributeFields()`
+* :php:`TYPO3\CMS\Recordlist\Controller\AbstractLinkBrowserController->getDisplayedLinkHandlerId()`
+* :php:`TYPO3\CMS\RteCKEditor\Controller\BrowseLinksController->renderLinkAttributeFields()`
+* :php:`TYPO3\CMS\RteCKEditor\Controller\BrowseLinksController->getPageConfigLabel()`
+* :php:`TYPO3\CMS\RteCKEditor\Controller\BrowseLinksController->getDisplayedLinkHandlerId()`
+
+
+Impact
+======
+
+Calling one of the above methods from an external object triggers a PHP :php:`E_USER_DEPRECATED` error.
+
+
+Affected Installations
+======================
+
+These link browser specific methods are usually not used by extensions externally. The extension
+scanner will reveal possible usages.
+
+
+Migration
+=========
+
+No migration possible.
+
+.. index:: Backend, PHP-API, FullyScanned, ext:reports
\ No newline at end of file
index c309c59..dead62c 100644 (file)
@@ -3264,4 +3264,39 @@ return [
             'Deprecation-86182-ProtectedMethodsInTaskModuleController.rst',
         ],
     ],
+    'TYPO3\CMS\Recordlist\Controller\AbstractLinkBrowserController->renderLinkAttributeFields' => [
+        'numberOfMandatoryArguments' => 0,
+        'maximumNumberOfArguments' => 0,
+        'restFiles' => [
+            'Deprecation-86193-ProtectMethodsInAbstractLinkBrowserController.rst',
+        ],
+    ],
+    'TYPO3\CMS\Recordlist\Controller\AbstractLinkBrowserController->getDisplayedLinkHandlerId' => [
+        'numberOfMandatoryArguments' => 0,
+        'maximumNumberOfArguments' => 0,
+        'restFiles' => [
+            'Deprecation-86193-ProtectMethodsInAbstractLinkBrowserController.rst',
+        ],
+    ],
+    'TYPO3\CMS\RteCKEditor\Controller\BrowseLinksController->renderLinkAttributeFields' => [
+        'numberOfMandatoryArguments' => 0,
+        'maximumNumberOfArguments' => 0,
+        'restFiles' => [
+            'Deprecation-86193-ProtectMethodsInAbstractLinkBrowserController.rst',
+        ],
+    ],
+    'TYPO3\CMS\RteCKEditor\Controller\BrowseLinksController->getPageConfigLabel' => [
+        'numberOfMandatoryArguments' => 1,
+        'maximumNumberOfArguments' => 2,
+        'restFiles' => [
+            'Deprecation-86193-ProtectMethodsInAbstractLinkBrowserController.rst',
+        ],
+    ],
+    'TYPO3\CMS\RteCKEditor\Controller\BrowseLinksController->getDisplayedLinkHandlerId' => [
+        'numberOfMandatoryArguments' => 0,
+        'maximumNumberOfArguments' => 0,
+        'restFiles' => [
+            'Deprecation-86193-ProtectMethodsInAbstractLinkBrowserController.rst',
+        ],
+    ],
 ];
index e4dba74..a95e819 100644 (file)
@@ -20,6 +20,7 @@ use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
+use TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait;
 use TYPO3\CMS\Core\Http\HtmlResponse;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Service\DependencyOrderingService;
@@ -31,6 +32,16 @@ use TYPO3\CMS\Recordlist\LinkHandler\LinkHandlerInterface;
  */
 abstract class AbstractLinkBrowserController
 {
+    use PublicMethodDeprecationTrait;
+
+    /**
+     * @var array
+     */
+    protected $deprecatedPublicMethods = [
+        'renderLinkAttributeFields' => 'Using AbstractLinkBrowserController::renderLinkAttributeFields() is deprecated and will not be possible anymore in TYPO3 v10.',
+        'getDisplayedLinkHandlerId' => 'Using AbstractLinkBrowzerController::getDisplayedLinkHandlerId() is deprecated and will not be possible anymore in TYPO3 v10.',
+    ];
+
     /**
      * @var DocumentTemplate
      */
@@ -451,7 +462,7 @@ abstract class AbstractLinkBrowserController
      *
      * @return string
      */
-    public function renderLinkAttributeFields()
+    protected function renderLinkAttributeFields()
     {
         $fieldRenderingDefinitions = $this->getLinkAttributeFieldDefinitions();
 
@@ -618,7 +629,7 @@ abstract class AbstractLinkBrowserController
     /**
      * @return string
      */
-    public function getDisplayedLinkHandlerId()
+    protected function getDisplayedLinkHandlerId()
     {
         return $this->displayedLinkHandlerId;
     }
index fd8d7a7..149e85c 100644 (file)
@@ -16,6 +16,7 @@ namespace TYPO3\CMS\RteCKEditor\Controller;
  */
 
 use Psr\Http\Message\ServerRequestInterface;
+use TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait;
 use TYPO3\CMS\Core\Configuration\Richtext;
 use TYPO3\CMS\Core\LinkHandling\LinkService;
 use TYPO3\CMS\Core\Localization\LanguageService;
@@ -28,6 +29,17 @@ use TYPO3\CMS\Recordlist\Controller\AbstractLinkBrowserController;
  */
 class BrowseLinksController extends AbstractLinkBrowserController
 {
+    use PublicMethodDeprecationTrait;
+
+    /**
+     * @var array
+     */
+    protected $deprecatedPublicMethods = [
+        'renderLinkAttributeFields' => 'Using BrowseLinksController::renderLinkAttributeFields() is deprecated and will not be possible anymore in TYPO3 v10.',
+        'getPageConfigLabel' => 'Using BrowseLinksController::getPageConfigLabel() is deprecated and will not be possible anymore in TYPO3 v10.',
+        'getDisplayedLinkHandlerId' => 'Using BrowseLinksController::getDisplayedLinkHandlerId() is deprecated and will not be possible anymore in TYPO3 v10.',
+    ];
+
     /**
      * @var string
      */
@@ -186,7 +198,7 @@ class BrowseLinksController extends AbstractLinkBrowserController
      *
      * @return string
      */
-    public function renderLinkAttributeFields()
+    protected function renderLinkAttributeFields()
     {
         // Processing the classes configuration
         if (!empty($this->buttonConfig['properties']['class']['allowedClasses'])) {
@@ -276,7 +288,7 @@ class BrowseLinksController extends AbstractLinkBrowserController
      * @param bool $JScharCode If needs to be converted to an array of char numbers
      * @return string Localized string
      */
-    public function getPageConfigLabel($string, $JScharCode = true)
+    protected function getPageConfigLabel($string, $JScharCode = true)
     {
         if (strpos($string, 'LLL:') !== 0) {
             $label = $string;