On the content taxonomy setup page if I set "Advanced settings for hierarchical vocabularies" to use a "Parent Term" other than the actual parent of the vocabulary, (thus hiding some of the top parts of my hierarchy) hierarchical select will only show the selected branch of the hierarchy tree. That is good so far.

The problem is, that when I use the "create new" feature in the first level available to hs, the newly created term gets to be placed in the root of the vocabulary instead of the top of the vocabulary branch that is available to hs.
So the newly created term will not be available for selection and will not be placed on the right level.

Creating a new term in a level below that works fine.

I hacked into the code of hs_content_taxonomy.module to solve the problem:

/**
 * Implementation of hook_hierarchical_select_create_item().
 */
function hs_content_taxonomy_hierarchical_select_create_item($label, $parent, $params) {
  // TRICKY: no depth check is necessary because HS's internal validation
  // prevents an invalid parent.
  if(empty($parent)){$parent=$params['tid'];}
  return hs_taxonomy_hierarchical_select_create_item($label, $parent, $params);
}

Added the line with the "if" structure... Maybe someone could confirm that its the right thing to do. For me it seems to work well.

CommentFileSizeAuthor
#2 hierarchical_select.module.patch758 byteskenorb
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

akin.demirci’s picture

Same problem here and your patch worked for me too. Thanks...

kenorb’s picture

The same problem.
Find the patch in attachment for review.

stefan.r’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

6.x issue without activity for over 3 years, closing.

Please reopen if this is still an issue in 7.x.