This is caused because a missing Parenthesis in "OR" condition in line 1470 of hierarchical_select.module

Currently:

 if ($config['editability']['status']
      && $config['editability']['allow_new_levels']
      && $config['editability']['max_levels'] == 0 || count($hierarchy->lineage) < $config['editability']['max_levels']
      && module_invoke($config['module'], 'hierarchical_select_valid_item', end($hierarchy->lineage), $config['params'])
      && module_hook($config['module'], 'hierarchical_select_create_item'))
  {

It should be:

  if ($config['editability']['status']
      && $config['editability']['allow_new_levels']
      && ($config['editability']['max_levels'] == 0 || count($hierarchy->lineage) < $config['editability']['max_levels'])
      && module_invoke($config['module'], 'hierarchical_select_valid_item', end($hierarchy->lineage), $config['params'])
      && module_hook($config['module'], 'hierarchical_select_create_item'))
  {

patch attached.

CommentFileSizeAuthor
#2 284435.patch1.06 KBwim leers
#1 patch_1.patch766 bytesjavi-er
patch_1.patch766 bytesjavi-er

Comments

javi-er’s picture

StatusFileSize
new766 bytes
wim leers’s picture

Title: If a term don't have childrens the option "<create new>" is displayed, no matter if "Allow creation of new terms" isn't selected » If a term doesn't have children the option "<create new>" is displayed, no matter if "Allow creation of new terms" is selected
Status: Active » Fixed
StatusFileSize
new1.06 KB

Good catch! Next time, please roll your patch using CVS, and against CVS HEAD though ;) Your patch was already outdated (fast development pace!).

Committed.

wim leers’s picture

(I initially forgot to credit you, I cancelled the commit-in-progress successfully, at least my CVS client said so, but it seems it got through anyway. My apologies!)

javi-er’s picture

Awesome! sorry about the outdated diff, it's my first patch and I wasn't sure how to make it :)

wim leers’s picture

You did a pretty good job if it was your first ;) :)

Thanks again!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.