Actions
Bug #89173
closedNotification actions broken after document change
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.
Actions