[TASK] Move arguments to initializeArguments() in ActionMenuVH in ext:fluid 08/49008/4
authorRoberto Torresani <erreti@gmail.com>
Sat, 16 Jul 2016 20:35:33 +0000 (22:35 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Tue, 19 Jul 2016 07:22:55 +0000 (09:22 +0200)
Move the argument registrations away from the render() method
to initializeArguments(), to prevent any errors with PHP7 and
subclassed ViewHelpers if/when render() method signatures change.

Resolves: #77131
Releases: master
Change-Id: I4c49ba9fa609e21b7792c673807647c75c4542cd
Reviewed-on: https://review.typo3.org/49008
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Tested-by: Joerg Boesche <typo3@joergboesche.de>
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
typo3/sysext/fluid/Classes/ViewHelpers/Be/Menus/ActionMenuViewHelper.php

index 19869fe..9f643c7 100644 (file)
@@ -72,12 +72,23 @@ class ActionMenuViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagB
     }
 
     /**
+     * Initialize arguments.
+     *
+     * @api
+     * @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
+     */
+    public function initializeArguments()
+    {
+        parent::initializeArguments();
+        $this->registerArgument('defaultController', 'string', 'defaultController');
+    }
+
+    /**
      * Render FunctionMenu
      *
-     * @param string $defaultController
      * @return string
      */
-    public function render($defaultController = null)
+    public function render()
     {
         $this->tag->addAttribute('onchange', 'jumpToUrl(this.options[this.selectedIndex].value, this);');
         $options = '';