Commit d824d89f authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[!!!][TASK] Remove last arguments of wrapClickMenuOnIcon()

Since unrelated functionality was moved to a
dedicated method, the corresponding arguments
are now removed. Therefore, the method does
now always return `string`.

Resolves: #96210
Related: #92583
Releases: main
Change-Id: I498738d37b0fcafda529c119ada7f5ea63c5d663
parent 35ad5989
Pipeline #20443 passed with stages
in 11 minutes and 48 seconds
...@@ -2161,34 +2161,12 @@ class BackendUtility ...@@ -2161,34 +2161,12 @@ class BackendUtility
* @param int|string $uid If icon is for database record this is the UID for the * @param int|string $uid If icon is for database record this is the UID for the
* record from $table or identifier for sys_file record * record from $table or identifier for sys_file record
* @param string $context Set tree if menu is called from tree view * @param string $context Set tree if menu is called from tree view
* @param string $_addParams NOT IN USE Deprecated since TYPO3 11, will be removed in TYPO3 12.
* @param string $_enDisItems NOT IN USE Deprecated since TYPO3 11, will be removed in TYPO3 12.
* @param bool $returnTagParameters If set, will return only the onclick
* JavaScript, not the whole link. Deprecated since TYPO3 11, will be removed in TYPO3 12.
* *
* @return string|array The link wrapped input string. * @return string The link wrapped input string.
*/ */
public static function wrapClickMenuOnIcon( public static function wrapClickMenuOnIcon($content, $table, $uid = 0, $context = ''): string
$content, {
$table,
$uid = 0,
$context = '',
$_addParams = '',
$_enDisItems = '',
$returnTagParameters = false
) {
$tagParameters = self::getClickMenuOnIconTagParameters((string)$table, $uid, (string)$context); $tagParameters = self::getClickMenuOnIconTagParameters((string)$table, $uid, (string)$context);
if ($_addParams !== '') {
trigger_error('Calling BackendUtility::wrapClickMenuOnIcon() with unused 5th parameter is deprecated and will be removed in v12.', E_USER_DEPRECATED);
}
if ($_enDisItems !== '') {
trigger_error('Calling BackendUtility::wrapClickMenuOnIcon() with unused 6th parameter is deprecated and will be removed in v12.', E_USER_DEPRECATED);
}
if ($returnTagParameters) {
trigger_error('Calling BackendUtility::wrapClickMenuOnIcon() with 7th parameter set to true is deprecated and will be removed in v12. Please use BackendUtility::getClickMenuOnIconTagParameters() instead.', E_USER_DEPRECATED);
return $tagParameters;
}
return '<a href="#" ' . GeneralUtility::implodeAttributes($tagParameters, true) . '>' . $content . '</a>'; return '<a href="#" ' . GeneralUtility::implodeAttributes($tagParameters, true) . '>' . $content . '</a>';
} }
......
...@@ -133,6 +133,7 @@ The following PHP class methods changed signature according to previous deprecat ...@@ -133,6 +133,7 @@ The following PHP class methods changed signature according to previous deprecat
The following PHP static class methods changed signature according to previous deprecations in v11 at the end of the argument list: The following PHP static class methods changed signature according to previous deprecations in v11 at the end of the argument list:
- :php:`\TYPO3\CMS\Backend\Utility\BackendUtility::wrapClickMenuOnIcon()` (arguments 5, 6 and 7 are removed)
- :php:`\TYPO3\CMS\Core\Utility\ArrayUtility::arrayDiffAssocRecursive()` (argument 3 is removed) - :php:`\TYPO3\CMS\Core\Utility\ArrayUtility::arrayDiffAssocRecursive()` (argument 3 is removed)
The following PHP class methods changed signature according to previous deprecations in v11 and are now type hinted: The following PHP class methods changed signature according to previous deprecations in v11 and are now type hinted:
......
...@@ -535,7 +535,7 @@ class FileList ...@@ -535,7 +535,7 @@ class FileList
$theData[$field] = htmlspecialchars($this->getLanguageService()->getLL('folder')); $theData[$field] = htmlspecialchars($this->getLanguageService()->getLL('folder'));
break; break;
case 'icon': case 'icon':
$theData[$field] = (string)BackendUtility::wrapClickMenuOnIcon($theIcon, 'sys_file', $folderObject->getCombinedIdentifier()); $theData[$field] = BackendUtility::wrapClickMenuOnIcon($theIcon, 'sys_file', $folderObject->getCombinedIdentifier());
break; break;
case 'name': case 'name':
$theData[$field] = $this->linkWrapDir($displayName, $folderObject); $theData[$field] = $this->linkWrapDir($displayName, $folderObject);
...@@ -678,7 +678,7 @@ class FileList ...@@ -678,7 +678,7 @@ class FileList
$theData[$field] = $this->makePath($fileObject); $theData[$field] = $this->makePath($fileObject);
break; break;
case 'icon': case 'icon':
$theData[$field] = (string)BackendUtility::wrapClickMenuOnIcon($this->getFileOrFolderIcon($fileName, $fileObject), 'sys_file', $fileObject->getCombinedIdentifier()); $theData[$field] = BackendUtility::wrapClickMenuOnIcon($this->getFileOrFolderIcon($fileName, $fileObject), 'sys_file', $fileObject->getCombinedIdentifier());
break; break;
case 'name': case 'name':
// Edit metadata of file // Edit metadata of file
......
...@@ -501,7 +501,7 @@ class PageInformationController ...@@ -501,7 +501,7 @@ class PageInformationController
$icon = '<span ' . $toolTip . '>' . $this->iconFactory->getIconForRecord('pages', $row, Icon::SIZE_SMALL)->render() . '</span>'; $icon = '<span ' . $toolTip . '>' . $this->iconFactory->getIconForRecord('pages', $row, Icon::SIZE_SMALL)->render() . '</span>';
// The icon with link // The icon with link
if ($this->getBackendUser()->recordEditAccessInternals('pages', $row)) { if ($this->getBackendUser()->recordEditAccessInternals('pages', $row)) {
$icon = (string)BackendUtility::wrapClickMenuOnIcon($icon, 'pages', $row['uid']); $icon = BackendUtility::wrapClickMenuOnIcon($icon, 'pages', $row['uid']);
} }
return $icon; return $icon;
} }
......
...@@ -247,6 +247,7 @@ return [ ...@@ -247,6 +247,7 @@ return [
'maximumNumberOfArguments' => 4, 'maximumNumberOfArguments' => 4,
'restFiles' => [ 'restFiles' => [
'Deprecation-92583-DeprecateLastArgumentsOfWrapClickMenuOnIcon.rst', 'Deprecation-92583-DeprecateLastArgumentsOfWrapClickMenuOnIcon.rst',
'Breaking-96107-DeprecatedFunctionalityRemoved.rst',
], ],
], ],
'TYPO3\CMS\Core\Page\PageRenderer->render' => [ 'TYPO3\CMS\Core\Page\PageRenderer->render' => [
......
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