After enabling this module, all pages have a "Please wait..." loader that breaks the site for few miliseconds. Hiding that with css hides the text but still breaking the layout...

:not(.html) .ajax-progress-throbber{ display:none;}

Any way to remove loader feature?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

preetam.chari’s picture

This issue occurs mostly with ajax calls where https request gets redirected to http and if we have added the X-FRAME-OPTIONS SAMEORIGIN

Solution which helped me resolve the issue is as below, module version 7.x-4.3

File: autologout.js
Lines below should be replaced as below,

Place 1 around line 145:

function logout() {
$.ajax({
url: Drupal.settings.basePath + "?q=autologout_ahah_logout",
type: "POST",
success: function() {
window.location = localSettings.redirect_url;
},
error: function(XMLHttpRequest, textStatus) {
if (XMLHttpRequest.status == 403 || XMLHttpRequest.status == 404) {
window.location = localSettings.redirect_url;
}
}
});
}

to

function logout() {
var site_host = window.location.host;
var site_base_url = "https://"+site_host+"/en";
$.ajax({
url: site_base_url + "?q=autologout_ahah_logout/",
type: "POST",
success: function() {
window.location = localSettings.redirect_url;
},
error: function(XMLHttpRequest, textStatus) {
if (XMLHttpRequest.status == 403 || XMLHttpRequest.status == 404) {
window.location = localSettings.redirect_url;
}
}
});
}

Place 2 around line 200

Drupal.ajax['autologout.getTimeLeft'] = new Drupal.ajax(null, $(document.body), {
url: Drupal.settings.basePath + '?q=autologout_ajax_get_time_left',
event: 'autologout.getTimeLeft',
error: function(XMLHttpRequest, textStatus) {
// Disable error reporting to the screen.
}
});

to

var site_host = window.location.host;
var site_base_url = "https://"+site_host +"/en";

Drupal.ajax['autologout.getTimeLeft'] = new Drupal.ajax(null, $(document.body), {
url: site_base_url + '?q=autologout_ajax_get_time_left/',
event: 'autologout.getTimeLeft',
error: function(XMLHttpRequest, textStatus) {
alert(url);
// Disable error reporting to the screen.
}
});

Place 3 around line 250:

Drupal.ajax['autologout.refresh'] = new Drupal.ajax(null, $(document.body), {
url: Drupal.settings.basePath + '?q=autologout_ahah_set_last',
event: 'autologout.refresh',
error: function(XMLHttpRequest, textStatus) {
// Disable error reporting to the screen.
}
});

to

var site_host = window.location.host;
var site_base_url = "https://"+site_host +"/en";

Drupal.ajax['autologout.refresh'] = new Drupal.ajax(null, $(document.body), {
url: site_base_url+ '?q=autologout_ahah_set_last/',
event: 'autologout.refresh',
error: function(XMLHttpRequest, textStatus) {
// Disable error reporting to the screen.
}
});

johnennew’s picture

@preetam.chari Any chance of providing that as an actual patch file? You'll feel better for learning how, I guarantee it!

https://www.drupal.org/node/707484

preetam.chari’s picture

@Ceng: I will definitely try.Thanks

MustangGB’s picture

Version: 7.x-4.3 » 7.x-4.x-dev
Category: Support request » Feature request
Status: Active » Needs review
FileSize
915 bytes

I think this is a nicer way of doing it.

nils.destoop’s picture

This is more correct. Set the progress once when constructing the ajax.

MustangGB’s picture

And what about the refresh and logout events?

JordanMagnuson’s picture

Yes, it seems to me that the progress needs to be unset at three locations where there is an ajax callback:

  1. Drupal.ajax['autologout.getTimeLeft']
  2. Drupal.ajax['autologout.refresh']
  3. function logout()