I have enabled $form_state['rebuild'] in the submit handler function then I cannot pass the `tid` to the default value of hierarchical select element. I should pass an array of `tid`s to it.

Comments

jonloh’s picture

Same here. I'm building a node multistep form with my own custom coding. But whenever I'm editing a node and the page goes on to the 2nd page where Hierarchical Select is, it will always default to

jyraya’s picture

I have a similar behavior as the one of jonloh. I am making a node form alter in order to rebuild my form by adding new fields to it after clicking a specific button.

When the user submits the form and comes back on it with new fields, the field using "hierarchy select" is rendered by showing "Nothing has been selected." but values have been selected.

I have it in the node edition and the creation cases.

diuss1987’s picture

I've resolved this problem by adding this before $form_state['rebuild'] = TRUE:
unset($form_state['input']['variable_name'].
Just delete previous default value

Gold’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

Is this an issue with HS or has it come about due to a custom form?

If the 'fix' described in #3 can be applied to the codebase please update the description to include steps to reproduce it and provide a patch.

jonloh’s picture

Looks like it happened many years ago and I myself don't remember what it was ;p

I would say it can be closed until someone else opens it up.

Gold’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Fair and agreed. :)