Commit d0970e45 authored by Benni Mack's avatar Benni Mack Committed by Christian Kuhn
Browse files

[!!!][TASK] Remove 2nd argument of cObj->getATagParams

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's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 57734b33
...@@ -34,6 +34,7 @@ The following PHP static class methods that have previously been marked as depre ...@@ -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: 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) - :php:`\Full\Class\Name->methodName` (argument 42 is now an integer)
The following public class properties have been dropped: The following public class properties have been dropped:
......
...@@ -1187,25 +1187,18 @@ class ContentObjectRenderer implements LoggerAwareInterface ...@@ -1187,25 +1187,18 @@ class ContentObjectRenderer implements LoggerAwareInterface
/** /**
* An abstraction method to add parameters to an A tag. * 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 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) * @return string String containing the parameters to the A tag (if non empty, with a leading space)
* @see typolink() * @see typolink()
*/ */
public function getATagParams($conf, $addGlobal = null) public function getATagParams($conf)
{ {
$aTagParams = ' ' . $this->stdWrapValue('ATagParams', $conf ?? []); $aTagParams = $this->stdWrapValue('ATagParams', $conf ?? []);
if ($addGlobal !== null) { // Add the global config.ATagParams
trigger_error('Setting the second argument $addGlobal of $cObj->getATagParams will have no effect in TYPO3 v12.0 anymore.', E_USER_DEPRECATED); $globalParams = trim($this->getTypoScriptFrontendController()->config['config']['ATagParams'] ?? '');
} $aTagParams = ' ' . trim($globalParams . ' ' . $aTagParams);
// 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);
}
// Extend params // Extend params
$_params = [ $_params = [
'conf' => &$conf, 'conf' => &$conf,
......
...@@ -918,6 +918,7 @@ return [ ...@@ -918,6 +918,7 @@ return [
'TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->ATagParams' => [ 'TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->ATagParams' => [
'restFiles' => [ 'restFiles' => [
'Deprecation-95219-TypoScriptFrontendController-ATagParams.rst', 'Deprecation-95219-TypoScriptFrontendController-ATagParams.rst',
'Breaking-96107-DeprecatedFunctionalityRemoved.rst',
], ],
], ],
]; ];
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment