Commit f7e110f4 authored by Torben Hansen's avatar Torben Hansen Committed by Georg Ringer
Browse files

[BUGFIX] Fix Bootstrap 5 tooltips

With Bootstrap 5 the registration of tooltips with the "data-title"
attribute does not work any more. Instead, the "title" attribute must
be used.

Resolves: #93790
Releases: master
Change-Id: I07ce40103d642f6337fdc3b72b43c4670177e975
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68553

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent 1485d630
......@@ -615,8 +615,8 @@ class InlineRecordContainer extends AbstractContainer
// If the record is edit-locked by another user, we will show a little warning sign:
if ($lockInfo = BackendUtility::isRecordLocked($foreignTable, $rec['uid'])) {
$cells['locked'] = '
<button type="button" class="btn btn-default" data-bs-toggle="tooltip" data-title="' . htmlspecialchars($lockInfo['msg']) . '">
<span title="' . htmlspecialchars($lockInfo['msg']) . '">' . $this->iconFactory->getIcon('warning-in-use', Icon::SIZE_SMALL)->render() . '</span>
<button type="button" class="btn btn-default" data-bs-toggle="tooltip" title="' . htmlspecialchars($lockInfo['msg']) . '">
' . $this->iconFactory->getIcon('warning-in-use', Icon::SIZE_SMALL)->render() . '
</button>';
}
// Hook: Post-processing of single controls for specific child records:
......
......@@ -223,7 +223,7 @@ class InputLinkElement extends AbstractFormElement
$expansionHtml[] = '<div class="form-wizards-element">';
$expansionHtml[] = '<div class="input-group t3js-form-field-inputlink">';
$expansionHtml[] = '<span class="t3js-form-field-inputlink-icon input-group-addon">' . $linkExplanation['icon'] . '</span>';
$expansionHtml[] = '<input class="form-control t3js-form-field-inputlink-explanation" data-bs-toggle="tooltip" data-title="' . $explanation . '" value="' . $explanation . '" readonly>';
$expansionHtml[] = '<input class="form-control t3js-form-field-inputlink-explanation" data-bs-toggle="tooltip" title="' . $explanation . '" value="' . $explanation . '" readonly>';
$expansionHtml[] = '<input type="text" ' . GeneralUtility::implodeAttributes($attributes, true) . ' />';
$expansionHtml[] = '<span class="input-group-btn">';
$expansionHtml[] = '<button class="btn btn-default t3js-form-field-inputlink-explanation-toggle" type="button" title="' . htmlspecialchars($toggleButtonTitle) . '">';
......
......@@ -123,7 +123,7 @@ class InputSlugElement extends AbstractFormElement
$mainFieldHtml[] = '<input';
$mainFieldHtml[] = ' class="form-control t3js-form-field-slug-readonly"';
$mainFieldHtml[] = ' data-bs-toggle="tooltip"';
$mainFieldHtml[] = ' data-title="' . htmlspecialchars($itemValue) . '"';
$mainFieldHtml[] = ' title="' . htmlspecialchars($itemValue) . '"';
$mainFieldHtml[] = ' value="' . htmlspecialchars($itemValue) . '"';
$mainFieldHtml[] = ' readonly';
$mainFieldHtml[] = ' />';
......
......@@ -231,7 +231,7 @@ class SelectCheckBoxElement extends AbstractFormElement
$html[] = '<thead>';
$html[] = '<tr>';
$html[] = '<th class="col-checkbox">';
$html[] = '<input type="checkbox" id="' . $checkboxId . '" class="t3js-toggle-checkboxes" data-bs-trigger="hover" data-bs-placement="right" data-title="' . $title . '" data-bs-toggle="tooltip" />';
$html[] = '<input type="checkbox" id="' . $checkboxId . '" class="t3js-toggle-checkboxes" data-bs-trigger="hover" data-bs-placement="right" title="' . $title . '" data-bs-toggle="tooltip" />';
$html[] = '</th>';
$html[] = '<th class="col-title"><label for="' . $checkboxId . '">' . $title . '</label></th>';
$html[] = '<th class="text-right">' . $resetGroupBtn . '</th>';
......
......@@ -572,8 +572,7 @@ class PagePositionMap
public function getRecordHeader($row)
{
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$toolTip = BackendUtility::getRecordToolTip($row, 'tt_content');
$line = '<span ' . $toolTip . ' title="' . BackendUtility::getRecordIconAltText($row, 'tt_content') . '">' . $iconFactory->getIconForRecord('tt_content', $row, Icon::SIZE_SMALL)->render() . '</span>';
$line = '<span ' . BackendUtility::getRecordToolTip($row, 'tt_content') . '">' . $iconFactory->getIconForRecord('tt_content', $row, Icon::SIZE_SMALL)->render() . '</span>';
$line .= BackendUtility::getRecordTitle('tt_content', $row, true);
return $this->wrapRecordTitle($line, $row);
}
......
......@@ -1204,7 +1204,7 @@ class BackendUtility
public static function getRecordToolTip(array $row, $table = 'pages')
{
$toolTipText = self::getRecordIconAltText($row, $table);
$toolTipCode = 'data-bs-toggle="tooltip" data-title=" '
$toolTipCode = 'data-bs-toggle="tooltip" title=" '
. str_replace(' - ', '<br>', $toolTipText)
. '" data-bs-html="true" data-bs-placement="right"';
return $toolTipCode;
......
......@@ -172,7 +172,7 @@ class GridColumnItem extends AbstractGridObject
}
if ($lockInfo = BackendUtility::isRecordLocked('tt_content', $row['uid'])) {
$icons[] = '<a href="#" data-bs-toggle="tooltip" data-title="' . htmlspecialchars($lockInfo['msg']) . '">'
$icons[] = '<a href="#" data-bs-toggle="tooltip" title="' . htmlspecialchars($lockInfo['msg']) . '">'
. $this->iconFactory->getIcon('warning-in-use', Icon::SIZE_SMALL)->render() . '</a>';
}
......
......@@ -1140,7 +1140,7 @@ class PageLayoutView implements LoggerAwareInterface
}
// Get record locking status:
if ($lockInfo = BackendUtility::isRecordLocked('tt_content', $row['uid'])) {
$additionalIcons[] = '<a href="#" data-bs-toggle="tooltip" data-title="' . htmlspecialchars($lockInfo['msg']) . '">'
$additionalIcons[] = '<a href="#" data-bs-toggle="tooltip" title="' . htmlspecialchars($lockInfo['msg']) . '">'
. $this->iconFactory->getIcon('warning-in-use', Icon::SIZE_SMALL)->render() . '</a>';
}
// Call stats information hook
......
......@@ -64,7 +64,7 @@
<f:if condition="!{page.canEdit}">
<span
data-bs-toggle="tooltip"
data-title="{f:translate(key:'LLL:EXT:backend/Resources/Private/Language/locallang_pages_sort.xlf:noEditPermissions')}"
title="{f:translate(key:'LLL:EXT:backend/Resources/Private/Language/locallang_pages_sort.xlf:noEditPermissions')}"
>
<core:icon identifier="status-status-permission-denied" />
</span>
......
......@@ -1124,7 +1124,7 @@ class DatabaseRecordList
// If the record is edit-locked by another user, we will show a little warning sign:
$lockInfo = BackendUtility::isRecordLocked($table, $row['uid']);
if ($lockInfo) {
$warning = '<span data-bs-toggle="tooltip" data-bs-placement="right" data-title="' . htmlspecialchars($lockInfo['msg']) . '">'
$warning = '<span data-bs-toggle="tooltip" data-bs-placement="right" title="' . htmlspecialchars($lockInfo['msg']) . '">'
. $this->iconFactory->getIcon('warning-in-use', Icon::SIZE_SMALL)->render() . '</span>';
}
if ($this->isRecordDeletePlaceholder($row)) {
......
......@@ -91,7 +91,7 @@
<f:if condition="{taskRecord.isRunning}">
<f:then>
<div class="btn-group" role="group">
<a data-bs-toggle="tooltip" class="btn btn-default t3js-modal-trigger" href="{moduleUri}&CMD=stop&tx_scheduler[uid]={taskRecord.uid}" data-severity="warning" data-title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:stop')}" data-button-close-text="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:cancel')}" data-bs-content="{f:translate(key:'msg.stop')}" title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:stop')}">
<a data-bs-toggle="tooltip" class="btn btn-default t3js-modal-trigger" href="{moduleUri}&CMD=stop&tx_scheduler[uid]={taskRecord.uid}" data-severity="warning" data-button-close-text="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:cancel')}" data-bs-content="{f:translate(key:'msg.stop')}" title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:stop')}">
<core:icon identifier="actions-close"/>
</a>
</div>
......@@ -111,7 +111,7 @@
</f:else>
</f:if>
</a>
<a data-bs-toggle="tooltip" class="btn btn-default t3js-modal-trigger" href="{moduleUri}&CMD=delete&tx_scheduler[uid]={taskRecord.uid}" data-severity="warning" data-title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:delete')}" data-button-close-text="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:cancel')}" data-bs-content="{f:translate(key:'msg.delete')}" title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:delete')}">
<a data-bs-toggle="tooltip" class="btn btn-default t3js-modal-trigger" href="{moduleUri}&CMD=delete&tx_scheduler[uid]={taskRecord.uid}" data-severity="warning" data-button-close-text="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:cancel')}" data-bs-content="{f:translate(key:'msg.delete')}" title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:delete')}">
<core:icon identifier="actions-edit-delete"/>
</a>
</div>
......@@ -170,7 +170,7 @@
<td><span class="label label-danger">{missingClass.class}</span></td>
<td class="nowrap">
<div class="btn-group" role="group">
<a data-bs-toggle="tooltip" class="btn btn-default t3js-modal-trigger" href="{moduleUri}&CMD=delete&tx_scheduler[uid]={missingClass.uid}" data-severity="warning" data-title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:delete')}" data-button-close-text="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:cancel')}" data-bs-content="{f:translate(key:'msg.delete')}" title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:delete')}">
<a data-bs-toggle="tooltip" class="btn btn-default t3js-modal-trigger" href="{moduleUri}&CMD=delete&tx_scheduler[uid]={missingClass.uid}" data-severity="warning" data-button-close-text="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:cancel')}" data-bs-content="{f:translate(key:'msg.delete')}" title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:delete')}">
<core:icon identifier="actions-edit-delete"/>
</a>
</div>
......
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