Closed (fixed)
Project:
Views Dependent Filters
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Feb 2012 at 16:55 UTC
Updated:
10 Apr 2012 at 13:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
joachim commented> the controller field
You mean filter, right?
Which plugin are you using for exposed forms? I've only tested this with Basic and BEF.
In fact, can you export your view and paste it here so I can look at all its settings?
Comment #2
apmsooner commentedYes, "controlling filter" would be better wording. I tried both basic and BEF with same result.
Code attached...
Thanks.
Comment #3
joachim commentedYou've got a google map in there? Maybe you have JS clashes.
Can you try stripping the view right down to the essentials only?
Comment #4
nakara commentedhello I'm french sorry for my bad English, I have the same problem, I have followed the instructions from Readme.txt. dependent my filters are not hidden.
Comment #5
joachim commentedSame reply as to the OP: please strip your view right down to the barest essentials: remove any foreign plugins and reset options to their defaults to try and find out what is causing the problem.
Comment #6
nakara commentedI have try to create a view with different setup, I don 'use any plugin I have always seen my filters depend
Comment #7
joachim commentedCan either of you try to reproduce this with filters that exist in a basic install of Drupal, eg
- node type filter as controller
- node author as a dependent filter
Comment #8
apmsooner commentedI was able to get dependent filters to work per #7 instructions. My issue maybe is the google maps conflict... not sure cause its only attached to the attachment view but perhaps still a conflict. I'll try to recreate my view from the very ground level on up and see if i can pinpoint the problem.
Comment #9
nakara commented#7 works for me but I am replacing author with a taxonomy its not works .
Comment #10
apmsooner commentedOkay, i've pinpointed my problems. It has nothing to do with conflicting javascript on other views. For some reason, a taxonomy field cannot be the controller field. If i used the example node type as the controller field and authorid as the dependent, it works fine but if i use a taxonomy field as the controller field and authorid as the dependent, the dependent shows no matter what.
Comment #11
apmsooner commentedCorrection, my issue matches #9 which is taxonomy field as dependent field. I was using a normal select field as controller field and taxonomy field as dependent field in my test that failed. Hope that helps clarify the issue.
Comment #12
joachim commentedCan you try re-enable killing of the filters early on by uncommenting at line 264:
This should remove the JS behaviour so that you have to submit the form with the controller value to see the change in the filter. (I'm meaning to make that a UI option...)
Does the taxonomy filter work now?
If so that would pinpoint the problem to the JS dependency code.
Comment #13
nakara commentedi have uncommented / / $ this-> filters_disable ();
my field taxonomy is hidden, but impossible to display it this time.
Comment #14
apmsooner commentedI uncommented and it works when clicking apply for the first filter selection, the second dependent filter shows on page reload which is just fine for me.... not optimal but is a solution.
Comment #15
joachim commented> not optimal but is a solution
Hehe that was the way this module was originally going to work; the JS stuff was extra icing I discovered I could do ;)
In which case it's a JS problem to do with picking up values from the filter's form element. Some firebugging and fiddling in views_dependent_filters_exposed_form_after_build() may help you find the cause.
Comment #16
apmsooner commentedYeah i agree. It works for me with the uncommented code so I'm pretty okay with that as it is for now.
Comment #17
joachim commentedUpdating title and status.
Comment #18
jvandooren commentedI have a yes/no field (published/unpublished) which is controlling a taxonomy field. I had the same issue as mentioned above and started debugging...
The problem is an incorrect filter_id in the form dependency. In my case, it is generating "edit-status_1" and "edit-status_1-1" (for BEF I guess) But if I change the foreach in views_dependent_filters.module on line 35 to the following, "edit-status-1" and "edit-status-1-1" is generated... This fixed my problem because this actually is the correct ID.
I don't know if BEF needs the "_" or the "-" but changing that is pretty easy :-)
Comment #19
joachim commentedYup, looks like this needs to use the core part of http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_htm... (which we can't actually call because it mucks around trying to be unique).
Could you try this patch please?
Comment #20
jvandooren commentedYep, this fixed my issue!
I'll wait with RTBC untill someone with BEF tried the patch...
Thanks!
Comment #21
maxiorelConfirm. The patch from #19 works with exposed taxonomy filters.
Comment #22
joachim commented- #1431606 by Ozmodiar, joachim: Fixed JS dependency for taxonomy term filters as controllers.
Committed the patch.
Comment #23
mxtThere isn't a DEV version to download in the project page: can you provide it?
Thank you very much.
Comment #24
joachim commentedDone; will take a few hours to show up as a download.