Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
jonloh CreditAttribution: jonloh commentedSame 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
Comment #2
jyraya CreditAttribution: jyraya commentedI 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.
Comment #3
diuss1987 CreditAttribution: diuss1987 commentedI've resolved this problem by adding this before $form_state['rebuild'] = TRUE:
unset($form_state['input']['variable_name'].
Just delete previous default value
Comment #4
GoldIs 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.
Comment #5
jonloh CreditAttribution: jonloh commentedLooks 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.
Comment #6
GoldFair and agreed. :)