diff --git a/typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php b/typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php index 33f19a4111227c34a56883fe350ba2dfbce3ae2a..ea4bc710bac609a588d4d64d5404b7c7f0240751 100644 --- a/typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php +++ b/typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php @@ -93,7 +93,7 @@ class MoveElementController // Headerline: Icon, record title: $assigns['table'] = $this->table; $assigns['elRow'] = $elRow; - $assigns['recordTooltip'] = BackendUtility::getRecordToolTip($elRow, $this->table); + $assigns['recordTooltip'] = BackendUtility::getRecordIconAltText($elRow, $this->table); $assigns['recordTitle'] = BackendUtility::getRecordTitle($this->table, $elRow, true); // Make-copy checkbox (clicking this will reload the page with the GET var makeCopy set differently): $assigns['makeCopyChecked'] = (bool)$this->makeCopy; @@ -137,7 +137,7 @@ class MoveElementController $contentPositionMap->cur_sys_language = $this->sys_language; $contentPositionMap->R_URI = $this->R_URI; // Headerline for the parent page: Icon, record title: - $assigns['ttContent']['recordTooltip'] = BackendUtility::getRecordToolTip($pageInfo); + $assigns['ttContent']['recordTooltip'] = BackendUtility::getRecordIconAltText($pageInfo, 'pages'); $assigns['ttContent']['recordTitle'] = BackendUtility::getRecordTitle('pages', $pageInfo, true); // Adding parent page-header and the content element columns from position-map: $assigns['contentElementColumns'] = $contentPositionMap->printContentElementColumns($this->page_id); diff --git a/typo3/sysext/backend/Classes/RecordList/DatabaseRecordList.php b/typo3/sysext/backend/Classes/RecordList/DatabaseRecordList.php index 2ace33a83b6b2d7b07990a0299891d5147648605..b0bd4a8abcb90ddedb2f7e7664e6f918cb2f3d62 100644 --- a/typo3/sysext/backend/Classes/RecordList/DatabaseRecordList.php +++ b/typo3/sysext/backend/Classes/RecordList/DatabaseRecordList.php @@ -1024,7 +1024,7 @@ class DatabaseRecordList } } elseif ($fCol === 'icon') { $iconImg = ' - <span ' . BackendUtility::getRecordToolTip($row, $table) . ' ' . ($indent ? ' style="margin-left: ' . $indent . 'px;"' : '') . '> + <span title="' . BackendUtility::getRecordIconAltText($row, $table) . '" ' . ($indent ? ' style="margin-left: ' . $indent . 'px;"' : '') . '> ' . $this->iconFactory->getIconForRecord($table, $row, Icon::SIZE_SMALL)->render() . ' </span>'; $theData[$fCol] = ($this->clickMenuEnabled && !$this->isRecordDeletePlaceholder($row)) ? BackendUtility::wrapClickMenuOnIcon($iconImg, $table, $row['uid']) : $iconImg; diff --git a/typo3/sysext/backend/Classes/Template/Components/MetaInformation.php b/typo3/sysext/backend/Classes/Template/Components/MetaInformation.php index 33e0f5769ed979d1510c5bfc527c977c7815d3ab..61279b1830e45bbc621082e2d2b7a24381a4fd4d 100644 --- a/typo3/sysext/backend/Classes/Template/Components/MetaInformation.php +++ b/typo3/sysext/backend/Classes/Template/Components/MetaInformation.php @@ -225,8 +225,7 @@ class MetaInformation } } elseif (is_array($pageRecord) && !empty($pageRecord['uid'])) { // If there IS a real page - $toolTip = BackendUtility::getRecordToolTip($pageRecord, 'pages'); - $theIcon = '<span ' . $toolTip . '>' . $iconFactory->getIconForRecord('pages', $pageRecord, Icon::SIZE_SMALL)->render() . '</span>'; + $theIcon = '<span title="' . BackendUtility::getRecordIconAltText($pageRecord) . '">' . $iconFactory->getIconForRecord('pages', $pageRecord, Icon::SIZE_SMALL)->render() . '</span>'; // Make Icon: $theIcon = BackendUtility::wrapClickMenuOnIcon($theIcon, 'pages', $pageRecord['uid']); $uid = $pageRecord['uid']; diff --git a/typo3/sysext/backend/Classes/Tree/View/ContentCreationPagePositionMap.php b/typo3/sysext/backend/Classes/Tree/View/ContentCreationPagePositionMap.php index 0e460083cecfd651a7f4aa6fba90d001b6edd1d2..1b38e87681fa232143940909b239c27d3c4e5e5e 100644 --- a/typo3/sysext/backend/Classes/Tree/View/ContentCreationPagePositionMap.php +++ b/typo3/sysext/backend/Classes/Tree/View/ContentCreationPagePositionMap.php @@ -92,7 +92,7 @@ class ContentCreationPagePositionMap extends AbstractContentPagePositionMap } return ' - <button type="button" class="btn btn-link" data-target="' . htmlspecialchars($target) . '" title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:insertNewRecordHere')) . '"> + <button type="button" class="btn btn-link" data-target="' . htmlspecialchars($target) . '" title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:insertNewRecordHere')) . '"> ' . $this->iconFactory->getIcon('actions-arrow-left-alt', Icon::SIZE_SMALL)->render() . ' </button>'; } @@ -103,7 +103,7 @@ class ContentCreationPagePositionMap extends AbstractContentPagePositionMap protected function getRecordHeader(array $row): string { return ' - <span class="py-2" ' . BackendUtility::getRecordToolTip($row, 'tt_content') . '> + <span class="py-2" title="' . BackendUtility::getRecordIconAltText($row, 'tt_content') . '"> ' . $this->iconFactory->getIconForRecord('tt_content', $row, Icon::SIZE_SMALL)->render() . ' ' . BackendUtility::getRecordTitle('tt_content', $row, true) . ' </span>'; diff --git a/typo3/sysext/backend/Classes/Tree/View/ContentMovingPagePositionMap.php b/typo3/sysext/backend/Classes/Tree/View/ContentMovingPagePositionMap.php index 89899f62b4d04300bbe08820e8ab8514b1017fc7..a1013479c4cd3862f3d8a37d6d9c9b7cb3293137 100644 --- a/typo3/sysext/backend/Classes/Tree/View/ContentMovingPagePositionMap.php +++ b/typo3/sysext/backend/Classes/Tree/View/ContentMovingPagePositionMap.php @@ -87,7 +87,7 @@ class ContentMovingPagePositionMap extends AbstractContentPagePositionMap protected function getRecordHeader(array $row): string { return ' - <span class="py-2" ' . BackendUtility::getRecordToolTip($row, 'tt_content') . '> + <span class="py-2" title="' . BackendUtility::getRecordIconAltText($row, 'tt_content') . '"> ' . $this->iconFactory->getIconForRecord('tt_content', $row, Icon::SIZE_SMALL)->render() . ' ' . ($this->moveUid === (int)$row['uid'] ? '<strong>' : '') . ' ' . BackendUtility::getRecordTitle('tt_content', $row, true) . ' diff --git a/typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php b/typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php index e1e6def70016ecf2ff48922d230882fddb183bba..7ce76558b36a616d242053c612159001d0d43baa 100644 --- a/typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php +++ b/typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php @@ -176,8 +176,9 @@ class PagePositionMap $lines[] = '<span class="text-nowrap"><a href="' . htmlspecialchars($this->getActionLink($prevPid, $dat['row']['pid'])) . '" title="' . $this->insertlabel() . '">' . $this->iconFactory->getIcon('actions-arrow-left-alt', Icon::SIZE_SMALL)->render() . '</a></span>'; } // The line with the icon and title: - $toolTip = BackendUtility::getRecordToolTip($dat['row'], 'pages'); - $icon = '<span ' . $toolTip . '>' . $this->iconFactory->getIconForRecord('pages', $dat['row'], Icon::SIZE_SMALL)->render() . '</span>'; + $icon = '<span title="' . BackendUtility::getRecordIconAltText($dat['row'], 'pages') . '">' + . $this->iconFactory->getIconForRecord('pages', $dat['row'], Icon::SIZE_SMALL)->render() + . '</span>'; $lines[] = '<span class="text-nowrap">' . $icon . ' ' . $this->linkPageTitle($this->boldTitle(htmlspecialchars(GeneralUtility::fixed_lgd_cs($dat['row']['title'], (int)$this->getBackendUser()->uc['titleLen'])), $dat, $id), $dat['row']) . '</span>'; } diff --git a/typo3/sysext/backend/Classes/Utility/BackendUtility.php b/typo3/sysext/backend/Classes/Utility/BackendUtility.php index 5b72faea0847618d2753a41322978f4d15ecfe74..c09ddabc1caa79b36ea94313cac678ea85e928c0 100644 --- a/typo3/sysext/backend/Classes/Utility/BackendUtility.php +++ b/typo3/sysext/backend/Classes/Utility/BackendUtility.php @@ -1200,9 +1200,11 @@ class BackendUtility * * @param string $table * @return string + * @deprecated will be removed in TYPO3 v13.0 - use getRecordIconAltText directly */ public static function getRecordToolTip(array $row, $table = 'pages') { + trigger_error('BackendUtility::getRecordToolTip() will be removed in TYPO3 v13.0 - use getRecordIconAltText() instead', E_USER_DEPRECATED); return 'title="' . self::getRecordIconAltText($row, $table) . '"'; } diff --git a/typo3/sysext/backend/Classes/View/BackendLayout/Grid/GridColumnItem.php b/typo3/sysext/backend/Classes/View/BackendLayout/Grid/GridColumnItem.php index fc28ae880932ae7469d14cbb1beed6f271ec134c..b84904c52ccea6e50243e54aa67e8639905368f6 100644 --- a/typo3/sysext/backend/Classes/View/BackendLayout/Grid/GridColumnItem.php +++ b/typo3/sysext/backend/Classes/View/BackendLayout/Grid/GridColumnItem.php @@ -174,8 +174,7 @@ class GridColumnItem extends AbstractGridObject $row = $this->record; $icons = []; - $toolTip = BackendUtility::getRecordToolTip($row, $table); - $icon = '<span ' . $toolTip . '>' . $this->iconFactory->getIconForRecord($table, $row, Icon::SIZE_SMALL)->render() . '</span>'; + $icon = '<span title="' . BackendUtility::getRecordIconAltText($row, $table) . '">' . $this->iconFactory->getIconForRecord($table, $row, Icon::SIZE_SMALL)->render() . '</span>'; if ($this->getBackendUser()->recordEditAccessInternals($table, $row)) { $icon = BackendUtility::wrapClickMenuOnIcon($icon, $table, $row['uid']); } diff --git a/typo3/sysext/backend/Resources/Private/Templates/ContentElement/MoveElement.html b/typo3/sysext/backend/Resources/Private/Templates/ContentElement/MoveElement.html index 30fc365a7a60b939ee11985ce9f74360ec3c085d..8259f5c09f252867da873ba925eb1f4f7c78a03e 100644 --- a/typo3/sysext/backend/Resources/Private/Templates/ContentElement/MoveElement.html +++ b/typo3/sysext/backend/Resources/Private/Templates/ContentElement/MoveElement.html @@ -10,7 +10,7 @@ <h1><f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:movingElement" /></h1> <h3 class="mb-2"> - <span {recordTooltip -> f:format.raw()}><core:iconForRecord table="{table}" row="{elRow}" /></span> + <span title="{recordTooltip -> f:format.raw()}"><core:iconForRecord table="{table}" row="{elRow}" /></span> {recordTitle -> f:format.raw()} </h3> <div class="pt-2"> @@ -37,7 +37,7 @@ </f:if> <f:if condition="{table} == 'tt_content'"> <f:if condition="{pageInfo}"> - <span {ttContent.recordTooltip -> f:format.raw()}><core:iconForRecord table="pages" row="{pageInfo}" /></span> + <span title="{ttContent.recordTooltip -> f:format.raw()}"><core:iconForRecord table="pages" row="{pageInfo}" /></span> </f:if> {ttContent.recordTitle}<br /> {contentElementColumns -> f:format.raw()}<br /> diff --git a/typo3/sysext/core/Documentation/Changelog/12.4/Deprecation-100459-BackendUtilitygetRecordToolTip.rst b/typo3/sysext/core/Documentation/Changelog/12.4/Deprecation-100459-BackendUtilitygetRecordToolTip.rst new file mode 100644 index 0000000000000000000000000000000000000000..ea4fe53bced82a2fa5c401d29269f150c97a5ae2 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/12.4/Deprecation-100459-BackendUtilitygetRecordToolTip.rst @@ -0,0 +1,50 @@ +.. include:: /Includes.rst.txt + +.. _deprecation-100459-1680683235: + +========================================================= +Deprecation: #100459 - BackendUtility::getRecordToolTip() +========================================================= + +See :issue:`100459` + +Description +=========== + +The method :php:`TYPO3\CMS\Backend\Utility\BackendUtility::getRecordToolTip()` +has been marked as deprecated. + + +Impact +====== + +Calling this method will trigger a PHP deprecation warning. + + +Affected installations +====================== + +TYPO3 installations with custom extensions using this method. This is usually +the case for old installations where Fluid templates or Extbase backend modules +were not common. + + +Migration +========= + +As this method is just a wrapper around :php:`BackendUtility::getRecordIconAltText()` +with a "title" attribute for the markup, the replacement is straightforward: + +Before: + +.. code-block:: php + + $link = '<a href="..." ' . BackendUtility::getRecordToolTip(...) . '>my link</a>'; + +After: + +.. code-block:: php + + $link = '<a href="..." title="' . BackendUtility::getRecordIconAltText(...) . '">my link</a>'; + +.. index:: Backend, PHP-API, FullyScanned, ext:backend diff --git a/typo3/sysext/info/Classes/Controller/PageInformationController.php b/typo3/sysext/info/Classes/Controller/PageInformationController.php index d011395812d2753633fb9e6c0ff15f8c573f0b07..222b17c27e3b8b4192a8a8a27cd85fc6ab79c55f 100644 --- a/typo3/sysext/info/Classes/Controller/PageInformationController.php +++ b/typo3/sysext/info/Classes/Controller/PageInformationController.php @@ -422,8 +422,7 @@ class PageInformationController extends InfoModuleController protected function getIcon(array $row): string { // Initialization - $toolTip = BackendUtility::getRecordToolTip($row); - $icon = '<span ' . $toolTip . '>' . $this->iconFactory->getIconForRecord('pages', $row, Icon::SIZE_SMALL)->render() . '</span>'; + $icon = '<span title="' . BackendUtility::getRecordIconAltText($row, 'pages') . '">' . $this->iconFactory->getIconForRecord('pages', $row, Icon::SIZE_SMALL)->render() . '</span>'; // The icon with link if ($this->getBackendUser()->recordEditAccessInternals('pages', $row)) { $icon = BackendUtility::wrapClickMenuOnIcon($icon, 'pages', $row['uid']); diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php index 843f7f23dedd0c728cab5bdab86041872abcfe5f..d027581975e1f903ed02b2c42094ba975fb4e978 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php @@ -1471,4 +1471,11 @@ return [ 'Deprecation-100053-GeneralUtility_GP.rst', ], ], + 'TYPO3\CMS\Backend\Utility\BackendUtility::getRecordToolTip' => [ + 'numberOfMandatoryArguments' => 1, + 'maximumNumberOfArguments' => 2, + 'restFiles' => [ + 'Deprecation-100459-BackendUtilitygetRecordToolTip.rst', + ], + ], ];