Posted by patoh on July 9, 2012 at 1:12pm
7 followers
Jump to:
| Project: | Hierarchical Select |
| Version: | 7.x-3.0-alpha5 |
| Component: | Code - Content Taxonomy |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
Hi Guys. How can i hide the none option in taxonomy select?? Thanx
Comments
#1
Make your hierarchical select field *required.
#2
Thanx pvdsteen.. On This.. Is there a way to animate the pop out select list like the ajax loading circle or something so as to show a user somethings happening. wait for it :)
#3
I have a "Term reference" field using "Hierarchical Select" widget and based on a two-level taxonomy tree. It's marked as "required" and has a "Default value" setted.
Even though the "<none>" option is being printed.
#4
same here.
will look into it tomorrow.
#5
file: hierarchical_select.module
It says in line 1670:
// Prepend a "" option to the root level when:
// - the form element is optional (1), or
// - enforce_deepest is enabled (2), or
// - the dropbox is enabled *and* at least one selection has been added to
// the dropbox (3)
So if you set "Force the user to choose a term from a deepest level", the option will show up event though the field is set to required and has a default value set.
A quick dirty fix is to edit line 1679:
$second_case = $config['enforce_deepest'];change to:
$second_case = !$config['enforce_deepest'];I am not sure but maybe better alternative would be:
Line 1681:
if (($first_case || $second_case || $third_case)change to:
if (($first_case && ($second_case || $third_case))#6
I've solved it changing line 1684 (on 7.x-3.0-alpha5+9-dev**) from:
if (($first_case || $second_case || $third_case) && (isset($special_items) && !count($special_items['none']))) {to
if ($first_case && ($second_case || $third_case) && (isset($special_items) && !count($special_items['none']))) {, closed to what you said on #5-2.
**: Version 7.x-3.x-dev from 2012-Jun-16.