Now that this was committed into Drupal 7 #646694: AJAX: Terrible reporting of status 0 response from AJAX request ("HTTP Error 0 has occurred")

It would be really nice if views can provide better messages when views fails than an alert message displaying: "An error occurred at /drupal/admin/build/views/ajax/preview/"

Comments

dagmar’s picture

Status: Active » Needs review
StatusFileSize
new19.93 KB
new13.23 KB
new1.08 KB

Here is the patch. And the error messages before and after applied the patch.

dagmar’s picture

StatusFileSize
new5.26 KB

Here is the complete patch for all error handlers in ajax.js

merlinofchaos’s picture

Let's generalize the error function so that we are not duplicating as much code.

dawehner’s picture

It would be cool, if the regexes have some inline comments, what they do. But thats optional the rest is fine.

dagmar’s picture

StatusFileSize
new5.42 KB

Lets try this patch

merlinofchaos’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Status: Needs review » Patch (to be ported)
StatusFileSize
new6.59 KB

I'm not actually sure this needs to be ported to D7. Maybe we need to submit something like this to D7 core as an improvement to the AJAX framework.

In any case, I improved the error handling slightly and am going to put this in CTools as well.

It's worth noting that behavior is going to change from server to server. For example, mine is configured in such a way that it does not actually send error messages during PHP crashes, so I added a little note to help point people to the right place in that circumstance.

Commited this patch to 2.x and 3.x.

damien tournoud’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
Status: Patch (to be ported) » Fixed

There is nothing to port, most of that is gone.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.