Active
Project:
Views (for Drupal 7)
Version:
7.x-3.10
Component:
exposed filters
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Jan 2011 at 00:55 UTC
Updated:
22 Aug 2018 at 14:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
duellj commentedSorry, the relationship was a red herring. Just create a simple page and attachment with a taxonomy term ID filter, and the attachment won't inherit the filter. Attaching new test view with relationship removed.
Comment #2
duellj commentedOk, so here's the problem as I can see it:
In views_handler_filter_term_node_tid::accept_exposed_input:
so the filter isn't computed unless $this->validated_exposed_input is set. In views_handler_filer_term_node_tid, validated_exposed_input is only set in exposed_validate:
validated_exposed_input is run only in views_exposed_form_validate for the main page view's exposed form, so it's never run for the attachment.
Comment #3
duellj commentedSince the filters are being validated already, could the just the raw input be used for attachment views that inherit exposed input? There might be something I'm missing, but the attached patch let's attached taxonomy filters inherit the values correctly.
Comment #4
merlinofchaos commentedI don't sufficiently understand D7 taxonomy to be able to review this.
Comment #5
merlinofchaos commentedOk, I think I get this now. Committed with a slight change (isset changed to !empty) and not getting rid of the blank line. Needs to be ported to D6.
Comment #6
dawehnerAnd commited.
Comment #8
user654 commented.
Comment #9
seattlehimay commentedLike #8, I have this problem still.
Filters are not inherited at all (neither text, nor pulldown taxonomy) in my attachment. I am using postgres, if it matters.
Not sure how I can provide useful information for you.
Comment #10
hanpersand commentedSubscribe. This is happening to me in 7.x-3.5.
Comment #11
hanpersand commentedComment #12
nikonvulcano commentedThis is happening to me in 7.x-3.5 whit Taxonomy term filter but ONLY with AUTOCOMPLETE active, while with DROPDOWN MENU it's OK !!
Comment #13
webdrips commentedI have the same problem with autocomplete enabled. There's a somewhat similar bug for taxonomies marked for localization using autocomplete. I wonder if the issue could be related?
I can try to find it and post it if it will be helpful.
Comment #14
francescoq commentedI don't know if it was the same problem, but i fought with exposed filters and attachments today... i discovered that "inherit filters" means "inherit filter values"... so you have to configure the filter section in the same way on the attachment and its main view. In this way worked for me.
Comment #15
redsky commentedI thought I'd provide an update since it's been a while.
I'm using views-7.x-3.10 and have this same problem today. I have a page view with an exposed filter criteria. One of those criteria is a taxonomy term. I have an attachment which inherits the filter criteria. When it is setup as autocomplete the attachment displays no results when it is a dropdown it works. It's a large list and an autocomplete would be more appropriate for this use case.
Comment #16
andrew.eatherington@gmail.com commentedIt looks like #14 FrancescoQ is correct putting the exact same exposed filter on the attachment seems to inherit the values
Comment #17
karan.gshar commentedFound the solution:
There are two issues that occur with using autocomplete:
1)If you debug your query in hook_views_query_alter, on initial page load you will find that under 'where' an empty string is being passed to your taxonomy term filter and since filter looks for a tid and an empty string is no 'tid', hence attachment shows up but with no results.
2) If you put a value in your taxonomy term expose filter, then unlike dropdown it takes string as value to check against where clause instead of tid, so you have to convert it into tid.
Here's the example code:
Comment #18
rosemaryreilmanI'm also having a similar issue with views version: 7.x-3.17
I thought it was tied to the main view having ajax enabled. I'm trying
hook_views_query_alterand while that works when you load the page it does not work on ajax submission.I'm using taxonomy filter, search terms and date fields.