When you use HS with multi-step forms, you will finally recognise, it is not working. Beside you need to work a lot for it, one bug in HS actually let you fail anyway.

Actually iam not sure, why on JSON the whole form gets reconstructed instead of using the cache, which can easily accessed by form_build_id in the parameters...but ok, i have to live with it ( this makes EVERY json call build a WHOLE node_add form...what is soooo slow...because they are huge).

Because of that form building, we need to let the form_callback work, which is in the paramenters[0] .. for that, we have "file" which indicates, which file defined this method...but thats exactly the problem.

If you use multi-step forms, the menu_item('file') must not reflect this file.... thats what this patch is for. It actually uses reflections to determine the correct file, instead of let menu_item('file') guess.

It should work on every usecase, non multi-step forms should still work the old way. Patch attached

CommentFileSizeAuthor
hierarchical_select.module.patch1.22 KBeugenmayer

Comments

eugenmayer’s picture

Status: Reviewed & tested by the community » Needs review
wim leers’s picture

Status: Needs review » Closed (won't fix)

1) patch file encoding is messed up
2) spacing is messed up
3) comments are even more messed up
4) general code style is wrong
5) reflection is only available in PHP 5, whereas Drupal 6 does not require PHP 5 (Drupal 7 does). So I won't and can't add this.

HS works fine in multistep forms. As long as they're not spread across multiple files. Which is something I didn't take into account previously.

Regarding reconstructing the entire form: you've already created a separate issue for that: #578984: Refactor _json to use the cache rather to reconstruct the whole form on every ajax request..

eugenmayer’s picture

this is not related in general.

That PHP4 reason is rediculous..but hey, its simply up to you.