Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Jul 2011 at 22:12 UTC
Updated:
9 Nov 2011 at 18:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
merlinofchaos commentedHm. The term ID argument should actually do that for you.
You can work around this by adding the term validator. That'll guarantee the validated title is set properly. Plus you can validate that it's actually at erm.
Comment #2
geek-merlintried this with current dev - see attached screenshot.
my "Branche %1" entry unfortunately results in "Branche 5"
Comment #3
geek-merlinaddendum:
* this bug happens when selecting "filter value type" = "term id"
* this bug does NOT happen when selecting "filter value type" = "term id selected by commas"
(which servers me now as a workaround)
Comment #4
dawehnerCan you try to use the general taxonomy term argument instead of the field specific one you are using at the moment?
Therefore you need the relationship to the terms of the node first.
Comment #5
geek-merlinyop.
exactly the same results:
* this bug happens when selecting "filter value type" = "term id"
* this bug does NOT happen when selecting "filter value type" = "term id selected by commas"
Comment #6
dawehnerOh i got it. Thanks
What about this patch?
Comment #7
geek-merlinunfortunately nope.
changed the "filter value type" from "term ids with commas" to "term ids"
and the title changed from term name to term id.
Comment #8
dawehnerCan you please provide an export of the view?
Comment #9
ssjcory commentedI think there is an option for validation criteria. Select Filter value type: term name converted to term id.
This should work for you :)
Comment #10
geek-merlinhere an export.
Comment #11
mstrelan commentedI too am having this issue. Going to workaround it by overriding the title in Panels.
Comment #12
mordonez commentedsubscribe, with term ids with commas solves the problem
Comment #13
ezheidtmann commentedI, too, am experiencing this issue (using a recent tarball of 3.x-7.x-dev). Term IDs are converted to term names when I select "term ids separated by , or +".
Comment #14
ezheidtmann commented(This is actually a bug)
Here's a patch that fixes the "Term ID" validator so that titles are set. I copied the relevant code from the "Term IDs with separators ..." validator -- it's just one new line.
(I don't have git set up, so patch with patch -p1)
Comment #15
ezheidtmann commentedAn updated patch against 7.x-3.x.
Comment #16
ezheidtmann commentedHey guys, I was too lazy to read the whole comment string before. Sorry. But now I'm paying more attention! It turns out that this bug is more difficult to re-create than I originally thought. Steps to reproduce: (Drupal 7.8)
1)
$ drush si ... && drush dl views && drush en views_ui2)
$ drush dl devel && drush en devel_generate && drush genv ... && drush gent ...3) Create view listing articles, no tags specified.
4) Add Contextual filter on Content: Tags (field_tags) -- this is the taxonomy reference field included in the content type in the standard install profile
4.1) Check "Override Title", write something like "Tag %1"
5) Preview with parameter 1, 2, 3, etc..
At this point we see a blank result set with title "Tag 1" or "Tag 3", etc. I'm OK with this -- I do not expect Views to know that field_tags is a term reference and to automatically de-reference the term. So, continuing:
6) In the contextual filter, enable validator: select "Taxonomy term" and set "Filter value type" to "Term ID".

7) Save & preview again.
We see the same result in the preview. The patch I provided fixes this bug -- after applying, I see "Tag blablah", which is the expected behavior.
N.B. The bug is NOT present when the "Content: has taxonomy term ID" contextual filter is used.
Thanks for your attention! I have attached an export of the view I just made to demonstrate the bug.
Comment #17
dawehnerYeah this patch makes absolute sense so commited to both 6.x-3.x and 7.x-3.x