Hi,
during the initialization of webfm in the node edit form, the AJAX post requests to http://../webfm_js/ cause repeated calls of hook_init. This causes problems e.g. for the protected_node module which locks nodes for editing in its init function. To avoid such issues, jQuery started to mark ajax requests with an additional POST header:

// Set header so the called script knows that it's an XMLHttpRequest
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");

The following patch adds the same header for the webfm ajax calls, so that modules can distinguish between real and AJAX POST requests. Please consider adding this, so that modules like protected_node are able to work together with webfm (see http://drupal.org/node/281584).

CommentFileSizeAuthor
webfm_signal_xmlhttp_request.patch449 bytesFrank Steiner

Comments

robmilne’s picture

I've just resurfaced and this looks to be a worthy change. Is this change also required in the 5.x version?

Frank Steiner’s picture

For the checkout module, I don't think so, because it doesn't use hook_init in 5.x. But I guess it can't hurt to mark AJAX request in the same way as jQuery, maybe some other modules can make use of it.

robmilne’s picture

Status: Needs review » Fixed

see 6.x-2.10-rc1

Anonymous’s picture

Status: Fixed » Closed (fixed)

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