Thank you so much for this module, it was just what I needed!

I wanted to "auto-select" the parent of a child term, while forcing the user to choose a term from the deepest level, using "Level choice". I use this to make parent breadcrumb links work, which they don't do otherwise.

There is however a minor error: is shown in the dropdown, also when at least one term is required. I realise that I am using a dev-version, but I thought you might like to know anyways.

Comments

wim leers’s picture

Assigned: Unassigned » wim leers
Status: Active » Closed (works as designed)

This is not a bug. This is by design. The <none> term is selected by default to force the user to consciously make a choice. If he tries to submit it without making a conscious choice, an error will be shown because he didn't select anything.

ressa’s picture

Thank you for the quick response Wim.

It makes sense to display <none> if there are no Level labels enabled. I forgot to mention in my first post that I had enabled Level labels to make it display "- Please Select -", but I was probably not using Level labels as intended.

But what if you are building a web site in another language than english, or would just like to display something else than <none>?

For now I have just changed line 1618 in hierarchical_select.module from:

$option = theme('hierarchical_select_special_option', t('none'));
to
$option = t('- Please choose -');

But hacking a module is never optimal, I think an option to change the <none> to something else would be better. What do you think?

ressa’s picture

Category: bug » feature

I forgot to change the Category status when I posted the last comment.

ressa’s picture

Status: Closed (works as designed) » Active

Oops, sorry! I needed to set the Status to active of course.

wim leers’s picture

Status: Active » Fixed

Well, you're the first to ask to change this text I think. In any case, you can override the theme_ hierarchical_select_special_option() function and check if the text equals 'none'. In that case, you simply replace it by something else. I won't add yet another setting for something that can be altered through theming (as it should be).

Status: Fixed » Closed (fixed)

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