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.


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.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.