Posted by boneless on October 7, 2009 at 1:41am
Jump to:
| Project: | Hierarchical Select |
| Version: | 6.x-3.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I noticed the 'allowed_levels' values do not work properly in the API.
When activating 'editability' all levels (but the root level 0) are always able to be extended.
This seems to be due to checking _hierarchical_select_create_new_item_is_allowed() only for the max_depth level.
(hierarchical_select.module line 1776)
(Possible) Solution:
replace line 1782: $hierarchy->levels[$depth] = array('create_new_item' => $option) + $hierarchy->levels[$depth];
with:
if(_hierarchical_select_create_new_item_is_allowed($config, $depth)){
$hierarchy->levels[$depth] = array('create_new_item' => $option) + $hierarchy->levels[$depth];
}(sorry not much of a patcher myself)
This seems to fix the problem for me with $enforce_deepest = TRUE.
Hope this helps.
Comments
#1
Great catch, thanks!
- D6: http://drupal.org/cvs?commit=281994
- D5: http://drupal.org/cvs?commit=281996
#2
Automatically closed -- issue fixed for 2 weeks with no activity.