Download & Extend

Unable to reset the selection of HS when in a GET form (e.g. Views exposed filter form)

Project:Hierarchical Select
Version:5.x-3.0-rc7
Component:Code
Category:bug report
Priority:normal
Assigned:Wim Leers
Status:closed (fixed)

Issue Summary

I'm experiencing a bug with the HS Taxonomy Views filters which I believe may be larger issue with the HS widget. When using a HS taxonomy such as the one below, I experience the following issue. After selecting a term and submitting the form, the view is correctly filtered. However, if I select the "___" (empty) or "<none>" options in the top level of the HS and submit the form again, the form is set back to what I had selected the first time.

Sample options in the HS widget:

___ (empty)
<none>
<all>
Fruits
--> Apple
--> Banana
--> Orange
Vegetables
--> Broccoli
--> Carrot
--> Spinach

Comments

#1

Title:HS Views filters do not reset properly» Unable to reset the selection of HS when in a GET form (e.g. Views exposed filter form)
Component:Code - Taxonomy Views» Code
Assigned to:Anonymous» Wim Leers
Status:active» fixed

Interesting bug. The reason turned out to be an optimization that no longer applies when you're on a GET form. I'm rendering a "flat select" to allow for GET form compatibility. This is rendered on the server after each update, so it only gets set when the server is contacted. But when "none" is selected, the server is not being contacted, because there are no children for it, so an update doesn't make sense. However, when used on a GET form, the server *should* be contacted, so that the "flat select" is re-rendered.

This patch fixes that.

D5: http://drupal.org/cvs?commit=180056
D6: http://drupal.org/cvs?commit=180062

#2

This is fantastic - the fix works great. Thanks, Wim.

#3

Status:fixed» closed (fixed)

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