From d0970e4586426cc944395900d67c45f95d374484 Mon Sep 17 00:00:00 2001
From: Benni Mack <benni@typo3.org>
Date: Sun, 28 Nov 2021 13:43:07 +0100
Subject: [PATCH] [!!!][TASK] Remove 2nd argument of cObj->getATagParams
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Globally configured ATagParams via config.ATagParams
are now always added.

Resolves: #96119
Related: #95219
Releases: master
Change-Id: Id862c7790c8a509f604278bd1323ad0b262b2c83
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72339
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 ...g-96107-DeprecatedFunctionalityRemoved.rst |  1 +
 .../ContentObject/ContentObjectRenderer.php   | 19 ++++++-------------
 .../Php/PropertyPublicMatcher.php             |  1 +
 3 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst b/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst
index dd060944545c..25e196943948 100644
--- a/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst
+++ b/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst
@@ -34,6 +34,7 @@ The following PHP static class methods that have previously been marked as depre
 
 The following methods changed signature according to previous deprecations in v11 at the end of the argument list:
 
+- :php:`\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->ATagParams` (argument 2 is removed)
 - :php:`\Full\Class\Name->methodName` (argument 42 is now an integer)
 
 The following public class properties have been dropped:
diff --git a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
index 92809a9ee7c1..84183ce03e3e 100644
--- a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
+++ b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
@@ -1187,25 +1187,18 @@ class ContentObjectRenderer implements LoggerAwareInterface
 
     /**
      * An abstraction method to add parameters to an A tag.
-     * Uses the ATagParams property.
+     * Uses the ATagParams property, also includes the global TypoScript config.ATagParams
      *
      * @param array $conf TypoScript configuration properties
-     * @param bool|int|null $addGlobal If set, will add the global config.ATagParams to the link. @deprecated will be removed in TYPO3 v12.0.
      * @return string String containing the parameters to the A tag (if non empty, with a leading space)
      * @see typolink()
      */
-    public function getATagParams($conf, $addGlobal = null)
+    public function getATagParams($conf)
     {
-        $aTagParams = ' ' . $this->stdWrapValue('ATagParams', $conf ?? []);
-        if ($addGlobal !== null) {
-            trigger_error('Setting the second argument $addGlobal of $cObj->getATagParams will have no effect in TYPO3 v12.0 anymore.', E_USER_DEPRECATED);
-        }
-        // Add the global config.ATagParams if $addGlobal is NULL (default) or set to TRUE.
-        // @deprecated The if clause can be removed in v12
-        if ($addGlobal === null || $addGlobal) {
-            $globalParams = trim($this->getTypoScriptFrontendController()->config['config']['ATagParams'] ?? '');
-            $aTagParams = ' ' . trim($globalParams . $aTagParams);
-        }
+        $aTagParams = $this->stdWrapValue('ATagParams', $conf ?? []);
+        // Add the global config.ATagParams
+        $globalParams = trim($this->getTypoScriptFrontendController()->config['config']['ATagParams'] ?? '');
+        $aTagParams = ' ' . trim($globalParams . ' ' . $aTagParams);
         // Extend params
         $_params = [
             'conf' => &$conf,
diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php
index a5a5f5d05f4d..6b2ca911e234 100644
--- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php
+++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php
@@ -918,6 +918,7 @@ return [
     'TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->ATagParams' => [
         'restFiles' => [
             'Deprecation-95219-TypoScriptFrontendController-ATagParams.rst',
+            'Breaking-96107-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
 ];
-- 
GitLab