I have a view with multiple exposed filters set to 'Allow multiple selections' for a series of 'has taxonomy term' selectors. We have four exposed filters; Sector, Location, Job Type, and Renumeration. The first filter 'Sector' does not have any child terms, whereas the other three have sub-terms that appear once you select the parent term (thanks to the great functionality within SHS).
However I am facing an issue using 7.x-1.6 whereby the exposed filter does not work for the third filter (Job Type). The filter works fine for the first two, but upon selecting a Job Type and a child term, the view does not return the correct results, and it does not remember what's been selected for 'Job Type' (the filter appears unselected).
Note that these filters work perfectly if 'Allow multiple selections' is not selected (so we get a normal select drop-down instead of a multi-select box).
I tried upgrading to the dev version but it still doesn't work and it throws an "Undefined offset" error. I have created a separate issue for this here - https://drupal.org/node/2032705
Thanks for your help.
Comment | File | Size | Author |
---|---|---|---|
#24 | shs-multiple-exposed-filters-with-multiple-select-2032703-24-d7.patch | 450 bytes | gngn |
#7 | shs-filter-identifier-second-display.jpg | 445.73 KB | caspervoogt |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedHere is the view export:
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedI'll need this for a production site fairly soon and this bug has thrown a bit of a spanner in the works. Do we have a maintainer who is available for testing?
Comment #3
jphelan CreditAttribution: jphelan commentedI'm having the same issue.
Comment #4
ssoulless CreditAttribution: ssoulless commentedSame here, this module has a lot of problems... preffer the normal hierarchical select
Comment #4.0
ssoulless CreditAttribution: ssoulless commentedAdded link to other issue
Comment #5
wouhn CreditAttribution: wouhn commentedSame here
Comment #6
fornandakishore CreditAttribution: fornandakishore commentedStill the issue exists?
I am also facing the same issue, I have two exposed dropdown filters and I want to make them allow multiple, but only the first shs dropdown is working well for multiple select and rest of the dropdowns are not working.
Comment #7
caspervoogt CreditAttribution: caspervoogt at Plethora commentedSame thing here. I solved this by setting the Filter Identifier to a unique machine name for each of my view displays.
The default Filter Identifier is shs_term_node_tid_depth. I left that alone for my first view display, but the on my second view display set it to shs_term_node_tid_depth_staff (since it was a view listing staff members). This cleared it up for me (after clearing all caches, of course).
I have attached a screenshot showing where this setting lives.
Comment #8
caspervoogt CreditAttribution: caspervoogt at Plethora commentedComment #9
stBorchertThanks for the suggested solution.
.
Btw. ... did any of you tried the latest development version?
Comment #10
caspervoogt CreditAttribution: caspervoogt at Plethora commentedI have not tried the dev version, no.
Comment #11
stBorchertI've tested this right now with the latest development version on a clean installation.
When adding 2 exposed filters with "Has taxonomy terms (with depth; Simple hierarchical select)", Views automatically appends a numeric index to the filter identifier of the second filter.
Both filters work.
Additionally I created a panel page that prints the view two times: in both instances all the filters worked.
Seems to be fixed ...
Comment #12
caspervoogt CreditAttribution: caspervoogt at Plethora commentedInteresting, so maybe a release will be cut soon.
Comment #14
subadmin CreditAttribution: subadmin commentedHello everyone
I have the same issue on my site http://mpaproperty.com/demo/ here you can see on top i am using quick-tab there is Residential , Commercial and Land tab and all have views and exposed file with SHS.
there is problem with Commerical and Land same SHS setting apply to Residential and it works.
Please help me out in this, i am stuck since last 3 days, i can share views link with admin access to solve the problem
Thanks in advance
Comment #15
caspervoogt CreditAttribution: caspervoogt at Plethora commentedsubadmin, are you using 7.x-1.x-dev?
'I solved this by setting the Filter Identifier to a unique machine name for each of my view displays.' That should also work.
Comment #16
subadmin CreditAttribution: subadmin commentedHello Caspervoogt
I have not install dev version, i am using 7.x-1.6
and your mention point under your attach image is already done on my side
in shs-filter-identifier i have shs_term_node_tid_depth and shs_term_node_tid_depth_1 and shs_term_node_tid_depth_2 as i already mention above Residential tab works fine but other two are not Commercial and Land
so please check it on my site again http://www.mpaproperty.com/demo/ and tell me what i need to do, should i change my shs module version
Thank you
Comment #17
subadmin CreditAttribution: subadmin commentedComment #18
caspervoogt CreditAttribution: caspervoogt at Plethora commentedI see you are using unique identifiers, which is good. I would suggest switching to the dev branch of the code, and re-testing.
Comment #19
waqarit CreditAttribution: waqarit commentedUsing dev branch of code doesn't solve the problem.
Comment #20
caspervoogt CreditAttribution: caspervoogt at Plethora commented@waqariz, do your selects have unique identifiers?
Comment #21
waqarit CreditAttribution: waqarit commented@caspervoogt, yes I have unique identifiers.
Comment #22
caspervoogt CreditAttribution: caspervoogt at Plethora commentedI don't know what to tell you in that case. I thought that was the issue on my end .. and making them unique did seem to solve it for me.
Comment #23
Gunfigter100 CreditAttribution: Gunfigter100 commentedI have a similar situation. I have a view with two fields using exposed filters. They both have unique filter identifiers, yet only the first exposed filter's values are being used in the query. In my investigation I found that there is a flaw/oversight in the updateFieldValue function of shs.js in the latest dev version (7.x-1.6+73-dev). Line 506 is as follows:
var prev_value = $('.shs-select:eq(' + i + ')').val();
What I discovered is that since there are two controls that have the ".shs-select" class, that looking for the "i" instance of the class caused the first control to be selected even if the change was made in the second control. If both first and second controls had selected values then the exposed filter worked as intended. But if only one had a selected value that value was always assumed to come from the first control. I fixed this problem for myself by rewriting the line to look for the control by id rather than by class:
var prev_value = $('#' + base_id + '-select-' + (i + 1)).val();
This solution likely needs more testing and may not work in all cases. So far though it has worked for me.
Comment #24
gngn CreditAttribution: gngn at Computer Manufaktur GmbH commentedI made a patch to #23
We had this working for quite some time.