Skip to content

Instantly share code, notes, and snippets.

@claudinec
Created October 29, 2012 01:34
Show Gist options
  • Save claudinec/3970891 to your computer and use it in GitHub Desktop.
Save claudinec/3970891 to your computer and use it in GitHub Desktop.
--- a/modules/hs_taxonomy.module
+++ b/modules/hs_taxonomy.module
@@ -181,6 +181,9 @@ function hs_taxonomy_form_taxonomy_form_term_alter(&$form, &$form_state) {
// Use Hierarchical Select for selecting the parent term(s).
$parent = isset($form['#term']['tid']) ? array_keys(taxonomy_get_parents($form['#term']['tid'])) : array(0);
+ if (empty($parent)) {
+ $parent = array(0);
+ }
$form['relations']['parent'] = array(
'#type' => 'hierarchical_select',
'#title' => t('Parents'),
@claudinec
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment