I get the "Received an invalid response from the server." error when I attempt to create a node under the url of a node. ex. (http://website.com/node/3/upload) This doesn't happen when it's done under the normal node creation. (http://website.com/node/add/node-name)

I tried all the cache related solutions but none of them seem to fix this problem. I don't have much experience with this type of problem solving and I did not wish to create a issue to a problem that has already been addressed but I'm really at the end of my ropes.

Also, I am using node gallery along with content taxonomy, the problem happens when I try to upload a new image under a user's gallery.

Comments

wim leers’s picture

Category: task » support
Status: Active » Postponed (maintainer needs more info)

1) You're using the latest development snapshot?
2) The module that is providing that form should do this:

Hierarchical Select compatibility: gotcha's
-------------------------------------------
- "Invalid response from server"
  This typically means that some functions could not be found when
  Hierarchical Select does an AHAH callback to the server, which in turn means
  that some code (some PHP file) has not been included, while it should have
  been.
  Hierarchical Select supports the same system to define files that should be
  included as CTools:
    $form_state['form_load_files']
  Hence you should do something like this in your form code:
    $form_state['form_load_files'] = array(drupal_get_path('module', 'node') . '/pages.inc');
  Which could look like this in your case:
    $form_state['form_load_files'] = array(drupal_get_path('module', 'mymodule') . '/something.inc');

(see API.txt)

dre788’s picture

Category: support » task
Status: Postponed (maintainer needs more info) » Active

1) Yes, I am.
2) I'm not sure I understanding what's happening here. Should I apply that code to the form which I am getting the error on?

wim leers’s picture

Status: Active » Postponed (maintainer needs more info)

Which module is providing that form?

*That* module should apply those guidelines. Drupal 7 will require something similar, so it's not such a strange demand: http://api.drupal.org/api/drupal/includes--form.inc/function/form_load_i...

dre788’s picture

Status: Postponed (maintainer needs more info) » Active

The module of the form is node gallery.

wim leers’s picture

Title: Node creation error » Node creation error when used with HS
Project: Hierarchical Select » Node Gallery
Assigned: dre788 » Unassigned

Then let's move this to its issue queue.

scroogie’s picture

Mhm. The form function is just $type_node_form here. We just pipe the output through an additional page callback. Or are you using plupload dre788?

dre788’s picture

Version: 6.x-3.x-dev » 6.x-3.0-alpha2
Assigned: Unassigned » dre788

No, I'm not using plupload.

scroogie’s picture

Okay, I don't really understand this yet. I'll need to rebuild the situation. You have a content taxonomy field on the image type of node gallery and use the Hierarchical select widget on that?

dre788’s picture

Yeah, nothing else was done. The hierarchical select works via node/add link but when I attempt to do it from the image upload link, which uses the same content type "gallery image", I get the error.

dre788’s picture

Any idea what could be causing this? Is there anything I could do to get around this? The problem seems pretty isolated but unfortunately, I can't do much to tackle it on my own.

scroogie’s picture

Perhaps its enough to change the module_load_include to a corresponding call to form_load_include() in the upload page, but I'm unfortunately really constrained on time right now, so I can't try it out.

wim leers’s picture

dre788: please try the latest development snapshot.

dre788’s picture

Ok, I applied the latest dev. shot but I get the same error. I also tried what scroogie suggested, no luck. As a temporary fix I went and created a views that redirects to the node/add link which I used to replace the error causing form via tab tamer. It's a bit out of the way but it gets the job done.

scroogie’s picture

Wim Leers probably meant the latest snapshot of Hierarchical Select, because there was a change in the related code, see #697172: "Invalid Response from Server", possible causes and solution
Or did you try that?

dre788’s picture

Yeah that was the one I applied. Error still persists.

justintime’s picture

Status: Active » Postponed (maintainer needs more info)

I was able to reproduce, and tried quite a few solutions, none of which worked. I did use the latest dev of HS, and I tried including node.pages.inc as recommended using FAPI.

I'm pretty sure that #538022: JS alert: "Received an invalid response from the server." needs to be resolved before we can fix this - I did not apply any patches from that issue due to time.

Marking postponed until the issue above is resolved. Once that's done, simply adding a

    $form_state['form_load_files'] = array(drupal_get_path('module', 'node') . '/node.pages.inc');

to node_gallery_form_alter() and changing the signature to pass $form_state by reference should fix it. I didn't commit this code because I'm not 100% sure it's the fix.

Once the issue above is resolved, feel free to set this issue to active.

zengenuity’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Issue queue cleanup.