A key failure in AJAX operations (including batch api) is that error reporting to the screen corrupts the AJAX response. I *think* a simple answer is to disable error reporting in ajax_deliver(). However, that would mean people would not get any feedback except by looking in the dblog. But I suspect we have to do it.

Comments

effulgentsia’s picture

Can you provide a step-by-step example that demonstrates an AJAX response being corrupted by screen error reporting?

rfay’s picture

Here's what a failure looks like. We've all seen a million of them. And of course they really have nothing to do with AJAX:

rfay_mac_airbook_screenshot 2012-01-30 at 7.44.46 PM.png

Essentially, all you need for for anything at all to go wrong in the batch, and you get something like this. An experienced person can read what it says and sort out the problem, but most people can't. And of course "An AJAX HTTP Error occurred is completely misleading.

This error was just caused by adding

+  dsm($node, 'loaded node');

in batch_example_op_1() of the batch_example in Examples project. Pretty much any error output during a batch operation causes things like this.