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:
<?php function mymodule_form_alter (&$form, &$form_state, $form_id){ if($form_id == 'mytemp_node_form'){ foreach ($form['taxonomy'] as &$vocab) if($vocab['#type'] == 'hierarchical_select') $vocab['#size'] = 10; }} ?>
Please point me in the right direction.