Closed (fixed)
Project:
Hierarchical Select
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
26 May 2009 at 22:52 UTC
Updated:
10 Aug 2009 at 12:00 UTC
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
Comment #1
wim leersThis 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.Comment #2
ressaThank 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?
Comment #3
ressaI forgot to change the Category status when I posted the last comment.
Comment #4
ressaOops, sorry! I needed to set the Status to active of course.
Comment #5
wim leersWell, 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).