From 50e4b8a6bcbe5b6ce28ef3f33163fc150aa0b7bb Mon Sep 17 00:00:00 2001
From: Frank Naegler <frank.naegler@typo3.org>
Date: Fri, 27 Mar 2020 14:06:29 +0100
Subject: [PATCH] [TASK] Deprecate <f:widget.autocomplete> ViewHelper

The Fluid ViewHelper `<f:widget.autocomplete>` has been
marked as deprecated and will be removed in TYPO3 v11.

Resolves: #90856
Releases: master
Change-Id: I4088f235f03a2545d90bf7abacc18afc174de7bd
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63954
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
---
 ...-DeprecateWidgetAutocompleteViewHelper.rst | 45 +++++++++++++++++++
 .../Widget/AutocompleteViewHelper.php         |  6 +++
 .../Controller/AutocompleteController.php     |  6 +++
 3 files changed, 57 insertions(+)
 create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Deprecation-90856-DeprecateWidgetAutocompleteViewHelper.rst

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-90856-DeprecateWidgetAutocompleteViewHelper.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-90856-DeprecateWidgetAutocompleteViewHelper.rst
new file mode 100644
index 000000000000..0f674d45171a
--- /dev/null
+++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-90856-DeprecateWidgetAutocompleteViewHelper.rst
@@ -0,0 +1,45 @@
+.. include:: ../../Includes.txt
+
+==============================================================
+Deprecation: #90856 - Deprecate Widget AutoComplete ViewHelper
+==============================================================
+
+See :issue:`90856`
+
+Description
+===========
+
+The Fluid ViewHelper :html:`<f:widget.autocomplete>` and the related controller
+:php:`TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\AutocompleteController`
+have been marked as deprecated and will be removed in TYPO3 v11.
+
+The widget depends on third-party libraries that cannot be
+maintained for a full LTS release lifecycle.
+
+
+Impact
+======
+
+Any usage of this ViewHelper or extending one of the following classes will trigger a PHP :php:`E_USER_DEPRECATED` error.
+
+* :php:`TYPO3\CMS\Fluid\ViewHelpers\Widget\AutocompleteViewHelper`
+* :php:`TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\AutocompleteController`
+
+
+Affected Installations
+======================
+
+Any TYPO3 installation with custom templates which contains this ViewHelper.
+
+
+Migration
+=========
+
+Remove any usages within the Fluid templates. There is no replacement provided by the core.
+If you need this widget, you have to provide your own implementation of this widget with your
+own frontend libraries for the handling.
+
+If you still need it, copy the ViewHelper and Controller into an own extension.
+
+
+.. index:: Fluid, PHP-API, NotScanned, ext:fluid
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/AutocompleteViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/AutocompleteViewHelper.php
index c5dd171d097b..03a4bad86d17 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/AutocompleteViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/AutocompleteViewHelper.php
@@ -44,6 +44,7 @@ use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
  * The storeSession attribute can be used in any widget
  * and will prevent cookie creation / session storage for the widget.
  * See Resources/Private/Templates/ViewHelpers/Widget/Autocomplete/Index.html
+ * @deprecated since TYPO3 v10.4, will be removed in TYPO3 v11.0.
  */
 class AutocompleteViewHelper extends \TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetViewHelper
 {
@@ -57,6 +58,11 @@ class AutocompleteViewHelper extends \TYPO3\CMS\Fluid\Core\Widget\AbstractWidget
      */
     protected $controller;
 
+    public function __construct()
+    {
+        trigger_error(__CLASS__ . ' will be removed in TYPO3 v11.', E_USER_DEPRECATED);
+    }
+
     /**
      * Initialize arguments
      */
diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/AutocompleteController.php b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/AutocompleteController.php
index b324133b0a95..690c9fd4be97 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/AutocompleteController.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/AutocompleteController.php
@@ -16,9 +16,15 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller;
 
 /**
  * Class AutocompleteController
+ * @deprecated since TYPO3 v10.4, will be removed in TYPO3 v11.0.
  */
 class AutocompleteController extends \TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController
 {
+    public function __construct()
+    {
+        trigger_error(__CLASS__ . ' will be removed in TYPO3 v11.', E_USER_DEPRECATED);
+    }
+
     /**
      * Simply assigns the ID of the widget.
      */
-- 
GitLab