Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
ajax system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Mar 2019 at 07:10 UTC
Updated:
13 May 2020 at 09:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hadsie commentedComment #3
hadsie commentedComment #4
hadsie commentedComment #5
indytechcook commentedI had issues using this patch. The time wasn't long enough. Here is an updated patch to change the timeout if the state is 0.
Comment #6
HyperD commentedOn Chrome, FF, Edge: it works perfectly but
Once applied delay-ajax-alerts-3039666-5.patch, I got the following error on IE11
From investigation it seems it is from the section here below
-Drupal.displayAjaxError = function (message) {+Drupal.displayAjaxError = function (message, status_code = 0) {
// Skip displaying the message if the user deliberately aborted (for example,
// by reloading the page or navigating to a different page) while the Ajax
// request was still ongoing. See, for example, the discussion at
// http://stackoverflow.com/questions/699941/handle-ajax-error-when-a-user-clicks-refresh.
- if (!Drupal.beforeUnloadCalled) {
- alert(message);
- }
+ // Use setTimout to delay execution and ensure that beforeunload has had a chance
+ // to be called.
+ var delay = status_code == 0 ? 3000 : 1;
+ setTimeout(function () {
+ if (!Drupal.beforeUnloadCalled) {
+ alert(message);
+ }
+ }, delay);
};
In attachment the screenshot of all the generated errors on IE11
No errors on any other browser
Comment #7
grigoriunicolae commentedAdded the IE hotfix based on the patch from #5