Skip to content

Commit

Permalink
[BUGFIX] Respect data-content for modals again
Browse files Browse the repository at this point in the history
With the upgrade to Bootstrap 5, modals unintentionally don't support
the `data-content` attribute anymore as this was automatically migrated
to the namespaced variant `data-bs-content`. While this is technically
correct for Bootstrap 5, Core still needs to support the old variant as
documented.

Resolves: #98067
Releases: main, 12.4, 11.5
Change-Id: I544cbd779c808727c472575654adca3dc4c91197
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79974
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
  • Loading branch information
andreaskienast authored and o-ba committed Jul 11, 2023
1 parent 6545deb commit 587690c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Build/Sources/TypeScript/backend/modal.ts
Expand Up @@ -486,7 +486,7 @@ class Modal {
private initializeMarkupTrigger(theDocument: Document): void {
const modalTrigger = (evt: Event, triggerElement: HTMLElement): void => {
evt.preventDefault();
const content = triggerElement.dataset.bsContent || TYPO3.lang['message.confirmation'] || 'Are you sure?';
const content = triggerElement.dataset.bsContent || triggerElement.dataset.content || TYPO3.lang['message.confirmation'] || 'Are you sure?';
let severity = SeverityEnum.info;
if (triggerElement.dataset.severity in SeverityEnum) {
const severityKey = triggerElement.dataset.severity as keyof typeof SeverityEnum;
Expand Down
2 changes: 1 addition & 1 deletion typo3/sysext/backend/Resources/Public/JavaScript/modal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 587690c

Please sign in to comment.