[TASK] Protect methods in TaskModuleController 12/58212/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 7 Sep 2018 11:14:31 +0000 (13:14 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 7 Sep 2018 17:00:29 +0000 (19:00 +0200)
Resolves: #86182
Releases: master
Change-Id: I80b8b519ad530d5d98e284e0666cd6c2eb3f5603
Reviewed-on: https://review.typo3.org/58212
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
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>
typo3/sysext/core/Documentation/Changelog/master/Deprecation-86182-ProtectedMethodsInTaskModuleController.rst [new file with mode: 0644]
typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php
typo3/sysext/taskcenter/Classes/Controller/TaskModuleController.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-86182-ProtectedMethodsInTaskModuleController.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-86182-ProtectedMethodsInTaskModuleController.rst
new file mode 100644 (file)
index 0000000..a3af460
--- /dev/null
@@ -0,0 +1,37 @@
+.. include:: ../../Includes.txt
+
+===============================================================
+Deprecation: #86182 - Protected methods in TaskModuleController
+===============================================================
+
+See :issue:`86182`
+
+Description
+===========
+
+The following methods of class :php:`TYPO3\CMS\Taskcenter\Controller\TaskModuleController`
+changed their visibility from public to protected and should not be called any longer:
+
+* [not scanned] :php:`main()`
+* :php:`urlInIframe()` Will be removed in TYPO3 v10
+
+Impact
+======
+
+Calling one of the above methods from an external object triggers a PHP :php:`E_USER_DEPRECATED` error.
+
+
+Affected Installations
+======================
+
+The :php:`main()` methods is usually called internally only, extensions should not be affected by this.
+Method :php:`urlInIframe()` has been used by extensions that delivered task center tasks that have
+not been updated for a long time, the method is deprecated and usage should be removed.
+
+
+Migration
+=========
+
+No migration possible.
+
+.. index:: Backend, PHP-API, PartiallyScanned, ext:taskcenter
\ No newline at end of file
index b7be207..c309c59 100644 (file)
@@ -3257,4 +3257,11 @@ return [
             'Deprecation-86180-ProtectedMethodsInSetupModuleController.rst',
         ],
     ],
+    'TYPO3\CMS\Taskcenter\Controller\TaskModuleController->urlInIframe' => [
+        'numberOfMandatoryArguments' => 1,
+        'maximumNumberOfArguments' => 1,
+        'restFiles' => [
+            'Deprecation-86182-ProtectedMethodsInTaskModuleController.rst',
+        ],
+    ],
 ];
index 641f6c1..c99ba17 100644 (file)
@@ -19,6 +19,7 @@ use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Module\BaseScriptClass;
 use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait;
 use TYPO3\CMS\Core\Http\HtmlResponse;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -31,6 +32,16 @@ use TYPO3\CMS\Taskcenter\TaskInterface;
  */
 class TaskModuleController extends BaseScriptClass
 {
+    use PublicMethodDeprecationTrait;
+
+    /**
+     * @var array
+     */
+    private $deprecatedPublicMethods = [
+        'main' => 'Using TaskModuleController::main() is deprecated and will not be possible anymore in TYPO3 v10.',
+        'urlInIframe' => 'Using SetupModuleController::urlInIframe() is deprecated. The method will be removed in TYPO3 v10.',
+    ];
+
     /**
      * @var array
      */
@@ -139,7 +150,7 @@ class TaskModuleController extends BaseScriptClass
      * Creates the module's content. In this case it rather acts as a kind of #
      * dispatcher redirecting requests to specific tasks.
      */
-    public function main()
+    protected function main()
     {
         $this->getButtons();
         $this->generateMenu();
@@ -445,8 +456,9 @@ class TaskModuleController extends BaseScriptClass
      *
      * @param string $url Url to display
      * @return string Code that inserts the iframe (HTML)
+     * @deprecated since TYPO3 v9, will be removed in TYPO3 v10. Remember to remove the fluid template, too.
      */
-    public function urlInIframe($url)
+    protected function urlInIframe($url)
     {
         $urlView = GeneralUtility::makeInstance(StandaloneView::class);
         $urlView->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName(