Project

General

Profile

Actions

Bug #89173

closed

Notification actions broken after document change

Added by Andreas Kienast about 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2019-09-14
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

If a notification with actions is triggered within an iframe, the actions are broken after the iframe document changes. This is due to broken scopes when the notification is generated.

Following code is invoked in list_frame which renders a notification:

require(['TYPO3/CMS/Backend/Notification', 'TYPO3/CMS/Backend/ActionButton/DeferredAction'], function(Notification, DeferredAction) {
    Notification.info('Foo', 'Yadda yadda.', 0, [
        {
            label: 'Revert\u0020update',
            action: new DeferredAction(function() {
                return new Promise(resolve => setTimeout(() => { console.log('DONE'); resolve('foobar'); }, 1000));
            })
        }
    ]);
});

If e.g. another backend module is loaded, the click event in the notification gets lost and the callback cannot be executed anymore.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #89247: Revert Notification Action FactoryClosed2019-09-24

Actions
Actions

Also available in: Atom PDF