From ebe37c9704a60bfcbc3adf650f59db007c20e017 Mon Sep 17 00:00:00 2001 From: Andreas Fernandez Date: Tue, 5 Mar 2019 21:08:09 +0100 Subject: [PATCH] [BUGFIX] Access and update attribute `data-action` explicitly in Core Updater This patch updates the data attribute `action` via overriding the HTML attribute. Previously, jQuery's `.data()` was used which broke the functionality as the DOM gets re-rendered and jQuery lost the overriden value in its data object. Resolves: #87847 Releases: master, 9.5 Change-Id: Iddece8ccd498373b0490ea99b6808b76e6c5c2cf Reviewed-on: https://review.typo3.org/c/59877 Tested-by: TYPO3com Tested-by: Benni Mack Reviewed-by: Benni Mack --- .../Resources/Public/JavaScript/Modules/CoreUpdate.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Modules/CoreUpdate.js b/typo3/sysext/install/Resources/Public/JavaScript/Modules/CoreUpdate.js index 65c7f7097cba..c3ffd47c3297 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Modules/CoreUpdate.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Modules/CoreUpdate.js @@ -87,7 +87,9 @@ define([ currentModal.on('click', '.t3js-coreUpdate-init', function(e) { e.preventDefault(); - var action = $(e.target).data('action'); + // Don't use jQuery's data() function, as the DOM is re-rendered and any set data attribute gets lost. + // See showActionButton() + var action = $(e.target).attr('data-action'); currentModal.find(self.selectorOutput).empty(); self[action](); }); @@ -250,7 +252,7 @@ define([ } var domButton = this.buttonTemplate; if (action) { - domButton.data('action', action); + domButton.attr('data-action', action); } if (title) { domButton.text(title);