[FOLLOWUP][TASK] Deprecate render method arguments on ViewHelpers 99/53199/2
authorClaus Due <claus@namelesscoder.net>
Tue, 13 Jun 2017 12:33:59 +0000 (14:33 +0200)
committerBenni Mack <benni@typo3.org>
Thu, 15 Jun 2017 14:17:09 +0000 (16:17 +0200)
Followup patch to migrate f:widget.autocomplete which
had been missed by the previous patch.

Change-Id: I9e2552925df84f225144b1120a93bf65d9874047
Resolves: #81213
Releases: master
Reviewed-on: https://review.typo3.org/53199
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
Tested-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/fluid/Classes/ViewHelpers/Widget/AutocompleteViewHelper.php

index 47322a6..e926384 100644 (file)
@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Widget;
  *
  * The TYPO3 project - inspiring people to share!
  */
+use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
 
 /**
  * Simple paginate widget
@@ -49,6 +50,17 @@ class AutocompleteViewHelper extends \TYPO3\CMS\Fluid\Core\Widget\AbstractWidget
     protected $controller;
 
     /**
+     * Initialize arguments
+     */
+    public function initializeArguments()
+    {
+        parent::initializeArguments();
+        $this->registerArgument('objects', QueryResultInterface::class, 'Objects to auto-complete', true);
+        $this->registerArgument('for', 'string', 'Property to fill', true);
+        $this->registerArgument('searchProperty', 'string', 'Property to search within when filtering list', true);
+    }
+
+    /**
      * @param \TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\AutocompleteController $controller
      */
     public function injectAutocompleteController(\TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\AutocompleteController $controller)
@@ -57,12 +69,9 @@ class AutocompleteViewHelper extends \TYPO3\CMS\Fluid\Core\Widget\AbstractWidget
     }
 
     /**
-     * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $objects
-     * @param string $for
-     * @param string $searchProperty
      * @return string
      */
-    public function render(\TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $objects, $for, $searchProperty)
+    public function render()
     {
         return $this->initiateSubRequest();
     }