I have a multiple hierarchy vocabulary for regions. For example:

Europe
-Austria
-Turkey
Middle East
-Albania
-Turkey

If I enable this module (either multiple or single select), I get the following behaviour

1. Select Europe (fine)
2. Select Turkey (fine)
3. another select box pops out with the terms from Middle East - with Albania at the top (for example)
4. Select Turkey from that select box (because there's no option)
5. The original select box gets reset with the top term selected (Austria)
6. Select Turkey in that select box
7. back to step 3, repeat forever, start muttering.

Would be great if you could choose , or if it'd somehow stop showing that extra select box at all when there's multiple hierarchies.

Comments

catch’s picture

Title: Support multiple hierarchies » Allow <none> option in select boxes
Category: feature » bug

Also it seems impossible to select only a top-level term and not children, same issue really, but because of this, marking this as a bug instead.

wim leers’s picture

It's indeed impossible to select only a top-level term. You always have to select a "deepest" term. This is by design.
If you can figure out a way for doing what you need that makes sense, feel free to post it here.

The behavior you describe in 3. though seems like a bug. Do you have a link to a live website? Could you post a screenshot of your vocabulary's list of terms? Do you have terms with multiple parents?

junyor’s picture

Why not have a option in all non-top-level select boxes? That would make it possible to only select a top-level term. Or, have a blank line (or "---" or "") as the default option, even in required boxes. This will force the user to choose the term rather than pre-selecting one in both boxes.

catch’s picture

@Wim - I'll try to get screenshots to you over the next couple of days.

@Junyor: that's what I'm after really - a fix for core taxonomy module just went into D6 as well using ''.

catch’s picture

This is the issue: http://drupal.org/node/180109

I think it would deal with my multiple parents bug, and maybe selecting top level terms as well (which is more of a feature request, but makes this module unusable when you also have multiple hierarchies in forums for example).

wim leers’s picture

I hadn't read that issue yet, but that indeed makes a lot more sense. That would actually *simplify* the taxonomy implementation of Hierarchical Select :P

derjochenmeyer’s picture

It seems the patch mentioned in #5 got committed to 5.x (http://drupal.org/node/180109)

Furthermore, i agree with porfyros' duplicate post (http://drupal.org/node/190755). A multiple checkbox "save all terms path" would make it a lot more transparent to the enduser (admin, editor, ...) what is going on in the background.

The downside is this one: If you want to use Hierarchical Select for non administrators (i.e. the normal enduser) this option is too technical.

@Hierarcical select / Wim: I think this module is a huge usability step! Thanks for the work!

junyor’s picture

I applied the patch to the taxonomy module, but there was no change with the hierarchical select. I guess something has to be done in this module, too.

wim leers’s picture

Yep, changes in the taxonomy.inc file of HS are necessary too. I'm not sure when I'll have time for this though.

derjochenmeyer’s picture

I just had an idea. Instead of having a <none> option there could be "choose level 1...", "choose level 2...", "choose level 3..."

in the code it could look like this

<?php
none_option[0] = t('choose level 1...');
none_option[1] = t('choose level 2...');
none_option[2] = t('choose level 3...');
?>

Then it would be also easy via locale module for every user to translate that whatever he wants, lets say

choose country...
choose state...
choose city...

so it would catch this one as well http://drupal.org/node/179399

junyor’s picture

A blank value could be localized, too, as long as it's wrapped in t(), no?

derjochenmeyer’s picture

It would be harder to find it though in the locale interface if its empty.

My suggestion is a bit ugly -> to predefine an array of t() variables.

But if you generate those values with foreach($level) you loose the ability to translate each level seperately, right?

I tried to implement it in my own sandbox, but i dont understand enough how taxonomy.inc works. But i got far enough to say its possible.

wim leers’s picture

Category: bug » feature

That's not the same as a label. But that should be close enough for most people, yes.

wim leers’s picture

Title: Allow <none> option in select boxes » Allow <none> option in every level
pepeek’s picture

Hi,

let me summarize this thread. "Allow option in every level" is recognized as useful, it has category "feature request" and the status is active.

Currently there is no proposed solution. There is a code fragment in #10, but I do not know where to put it. It is more like a symbolic guideline, correct?

Wim, this is really useful module and this feature is a must in many use-cases (well, in mine it is :)
Do you plan on working on this? You've mentioned that it is not done by design, do you see a problem there?

If you have no time for this and you give me some hints, I can try to put it together.

I know these points must be implemented:

1. First we have to put default option (or ) to all of the select boxes starting with the second level.
2. on_select event must be modified to fill-up only the next box in the row rather then all the levels at once.
3. the submit function must store term id of the last entered box, rather then the last level one.

Correct?

wim leers’s picture

Title: Allow <none> option in every level » Allow the user to choose an item from any level and allow level labels
Assigned: Unassigned » wim leers
Status: Active » Fixed

Hohoho! I guess this is one of my christmas presents to the Drupal community.

Both features (selection of an item in any level and the ability to label each level) have been implemented in the next version of Hierarchical Select. It will be committed to HEAD soon.

junyor’s picture

Yay! Thank you, Wim. And Merry Christmas!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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