[TASK] Move arguments to initializeArguments() in ActionMenuItemGroupVH in ext:fluid 09/49009/4
authorRoberto Torresani <erreti@gmail.com>
Sat, 16 Jul 2016 20:39:36 +0000 (22:39 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Tue, 19 Jul 2016 06:30:20 +0000 (08:30 +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: #77132
Releases: master
Change-Id: I8242ce8bb81dfe4a415f321f101e6cd692863f9e
Reviewed-on: https://review.typo3.org/49009
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/ActionMenuItemGroupViewHelper.php

index 0f45c7c..600cc7e 100644 (file)
@@ -43,11 +43,24 @@ class ActionMenuItemGroupViewHelper extends ActionMenuViewHelper
     protected $tagName = 'optgroup';
 
     /**
-     * @param string $label
+     * Initialize arguments.
+     *
+     * @api
+     * @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
+     */
+    public function initializeArguments()
+    {
+        parent::initializeArguments();
+        $this->registerArgument('label', 'string', 'label', false, '');
+    }
+
+    /**
      * @return string
      */
-    public function render($label = '')
+    public function render()
     {
+        $label = $this->arguments['label'];
+
         $this->tag->addAttribute('label', $label);
         $options = '';
         foreach ($this->childNodes as $childNode) {