Hierarchical select hook form alter I have a problem with getting my module_form_alter to work for hierarchical select. I am running on Drupal 7 and my content type is called mytemp and I'm pretty sure my form-id is mytemp_node_form. I have a taxonomy called ICA which my hierarchical select references to. 

I get the following error when I run it: 


  Warning: Invalid argument supplied for foreach() in arjmod_form_alter() (line 8 of /var/www/hcms/sites/all/modules/arjmod/arjmod.module)


I would like to have my hierarchical select appear with a fixed row height but I can't get it to work. 

This is my code: 

&lt;?php 
function mymodule_form_alter (&amp;$form, &amp;$form_state, $form_id){
  if($form_id == 'mytemp_node_form'){
    foreach ($form['taxonomy'] as &amp;$vocab)
      if($vocab['#type'] == 'hierarchical_select')
        $vocab['#size'] = 10;
}} ?&gt;


Please point me in the right direction.
Looks like $form['taxonomy'] is not an array.

There are some options for hierarchical selects maybe this is all you need:

http://localhost/admin/config/content/hierarchical_select