i've created a view which has a term id as argument.
(term id, not term name, as urls with ümlauts ar not so nice)

In "contextual filters" settings i can "override title" to something like
"Results for term %1", which outputs something like
"Results for term 42"

In fact i want a title like "Results for term BIGQUESTION".
(term name, not id)

Comments

merlinofchaos’s picture

Status: Active » Fixed

Hm. 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.

geek-merlin’s picture

Status: Fixed » Active
StatusFileSize
new52.93 KB

tried this with current dev - see attached screenshot.

my "Branche %1" entry unfortunately results in "Branche 5"

geek-merlin’s picture

addendum:
* 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)

dawehner’s picture

Can 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.

geek-merlin’s picture

yop.
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"

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new657 bytes

Oh i got it. Thanks

What about this patch?

geek-merlin’s picture

Status: Needs review » Needs work

unfortunately nope.
changed the "filter value type" from "term ids with commas" to "term ids"
and the title changed from term name to term id.

dawehner’s picture

Can you please provide an export of the view?

ssjcory’s picture

I think there is an option for validation criteria. Select Filter value type: term name converted to term id.

This should work for you :)

geek-merlin’s picture

StatusFileSize
new9.04 KB

here an export.

mstrelan’s picture

I too am having this issue. Going to workaround it by overriding the title in Panels.

mordonez’s picture

subscribe, with term ids with commas solves the problem

ezheidtmann’s picture

I, 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 +".

ezheidtmann’s picture

Category: feature » bug
Status: Needs work » Needs review
StatusFileSize
new1.19 KB

(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)

ezheidtmann’s picture

StatusFileSize
new657 bytes

An updated patch against 7.x-3.x.

ezheidtmann’s picture

StatusFileSize
new5.01 KB
new30.64 KB

Hey 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_ui
2) $ 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".
contextual filter illustration
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.

dawehner’s picture

Status: Needs review » Fixed

Yeah this patch makes absolute sense so commited to both 6.x-3.x and 7.x-3.x

Status: Fixed » Closed (fixed)

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