Not sure if this is a bug or if it would be a feature request.

When I have "Reset selection of hierarchical select" enabled, after a selection is made, HS is reset to the top-level term in the completed selection. So, for example, if I choose:

Visual Arts --> Design [Add]

HS resets to "Visual Arts". At this point, I cannot select another term under "Visual Arts" without first changing to another top-level term (for example, "Performing Arts"), then coming back to "Visual Arts", then selecting a second-level term.

Would it be possible to have the reset leave the top-level drop-down empty rather than defaulting to the top-level term of the last selection?

Not sure if this is clear? I'd appreciate any feedback.

Thanks.

Comments

wim leers’s picture

Component: Miscellaneous » Code
Assigned: Unassigned » wim leers
Category: feature » bug

Sounds like a bug. Even one that I've fixed before. Will probably apply to the Drupal 5 version as well.

I'll try to reproduce this.

cfuller12’s picture

I have this same issue and am creating a fix for a client. The approach I'm taking is to add the reset_hs value to Drupal settings and then do the following in the Ajax callback in hierarchical_select.js (around line 544):

        if (updateType == 'add-to-dropbox') {
          if (Drupal.settings.HierarchicalSelect.settings[hsid]['reset'] == true) { 
            $('#hierarchical-select-' + hsid +'-wrapper .hierarchical-select .selects select:first').val('');
          }
        }

Does this sound like the right approach? If so, I'll generate a patch against head as soon as I get a chance.

Thanks

Christopher Herberte’s picture

subscribe

wim leers’s picture

Priority: Normal » Critical

Duplicate issue: http://drupal.org/node/352506.

This is a bug in both the D5 & D6 versions. The only remaining simply reproducible bug in D5!

wim leers’s picture

This is when dropbox['reset_hs'] == 0.

Related issue: http://drupal.org/node/341881.

wim leers’s picture

Title: Reset selection of hierarchical select » Reset selection of Hierarchical Select not working
Status: Active » Fixed

This was actually due to *one* line of code that I commented out during the initial D6 port, because I wasn't sure it was still necessary. Well, it obviously was.

Fixed: http://drupal.org/cvs?commit=186246.

Status: Fixed » Closed (fixed)

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