I've consistently run into an issue where clicking on the notifications icon produces an "An AJAX HTTP request terminated abnormally" popup under certain conditions. Typically this can be "fixed" by refreshing the page, making sure everything is fully loaded, and trying again, but it creates confusion for normal site visitors, and makes the site look buggy (users don't get this alert on Facebook after all :P).

Here's a thread on my site with users reporting the issue: https://www.pixelscrapper.com/forums/site-meta/community-support/ajax-is...

Here's a related Drupal core issue: https://www.drupal.org/node/1232416

With all the complexity of page loading and user navigation, it seems to me that it is almost inevitable that an mnc ajax request will be terminated abnormally at some point for most users, which leads me to think that the only "easy" way to deal with this issue might be to simply suppress the popup message... any thoughts?

CommentFileSizeAuthor
ajaxerror.png6.78 KBJordanMagnuson
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cmonnow’s picture

Sorry, I should have posted this issue here a few weeks ago but I forgot.

As you've discovered, this issue is simply an annoying implementation of client-side error reporting in Drupal core that's easy to recreate. Simply click on your notifications link and then quickly click on another link to exit the page before the AJAX is complete. As far as I'm aware the fact that an error occurs is normal/expected in our particular case (although there are alternate situations where a bug may needs fixing).

My site isn't live yet but I set a reminder to myself to suppress the error popup eventually. Without going all out and suppressing all alerts across your site (with a module like Prevent JS Alerts), I suppose one of the old patches like #17 in https://www.drupal.org/node/1232416 may be the way to go (which also suppressed autocomplete errors separately). For your own sake you could write the error to the console instead when response.status is equal to 0 (after checking if (typeof console == "object")). The user may not know that an error occurred but like you said, Facebook doesn't tell us anything and personally, I regularly get weirdness with Facebook AJAX loads that require either full page reloads or simply never work full stop.

To avoid patching core and maintaining patches across updates you could use or mimic the sandbox module https://www.drupal.org/sandbox/imre.horjan/2327755 (which applies patch #17). These drawn out Drupal quirks are lose-lose situations because overriding entire Drupal.ajax.prototype.* functions and forgetting about them during subsequent core updates can potentially end up in unintended results as well (e.g. unfixed js bugs). Core patches are more likely to be monitored closely with diff checks before every update and you reduce memory load on every page - but you've also broken the first rule of Drupal.

Let us know how it goes!

JordanMagnuson’s picture

Thanks for the thoughts, cmonnow. I'll look into this, and let you guys know how it goes...

JordanMagnuson’s picture

Version: » 7.x-1.x-dev
Status: Active » Closed (outdated)