As suggested by: http://drupal.org/node/538022#comment-2502630

293:  // drupal_json() function.
294:  module_load_include('inc', 'node', 'node.pages');
295:  drupal_set_header('Content-Type: text/javascript; charset=utf-8');

PLEASE add this line in the module, it will fix all HTTP-0, Received an invalid response from the server and other json/ajax errors caused by using HS form elements in blocks or custom code without regular node rendering.

Comments

jonthomas83’s picture

Hi there,

I've created a custom module to alter form elements using hook_form_alter, unfortunately this too is causing the "Received an invalid response from the server" message prompt.

I've tried the above patch and it's not working for me, disabling my module works but it's not the answer I'm looking for I'm afraid! :)

Many thanks for any help you could possibly offer me, advice or links to where this has been solved elsewhere, I've had a look around to no avail.

Cheers,
Jonathan

wim leers’s picture

Status: Patch (to be ported) » Closed (works as designed)

That's not the right way to fix this. Some other module is including node.pages.inc and that module should follow the guidelines in API.txt (search for "$form_state").