Hi,

I have a content type "News" with a field "News type" being a list (easier to export than a taxonomy and better for static usage).
In my "News list" view, I want to add a contextual filter on this field. It works well but for this kind of field, the value might be used instead of the key in the override title option.

Example (wanted)
-----------
Field configuration :
1|News
2|Press
3|Other

Views display URL => Title
news/1 => News
news/2 => Press
news/3 => Other

The only workaround is to use a "list (text)" field and to choose the options to uppercase the first letter. It work while you do not have any special chars in your field value.

Example (real, french)
-----------
Field configuration :
actualites|Actualités
breves|Brèves
presse|Presse

Views display URL => Title
news/actualites => Actualites (instead of "Actualités")
news/breves => Breves (instead of "Brèves")
news/presse => Presse (good because no special char)

Could you please take a look at this ?

Regards.

CommentFileSizeAuthor
#6 views-1382120-6.patch859 bytestim.plunkett
#1 1382120.patch2.13 KBdawehner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Category: bug » feature
Status: Active » Needs review
FileSize
2.13 KB

Ah this seems to make sense, let's replace the title for list arguments with it's actual title via an extra argument handler.
As this is not a bug in the classical sense change the status.

Here is a patch for it.

dawehner’s picture

Ah this seems to make sense, let's replace the title for list arguments with it's actual title via an extra argument handler.
As this is not a bug in the classical sense change the status.

Here is a patch for it.

DuaelFr’s picture

Hi dereine,

Thank you for your quickness but I tried to patch the 3.0 RC and dev version with this without any success.
When patching Views then clearing cache I get a "Broken/missing handler" issue on my contextual filter.
Reverting and clearing cache again give me my handler back.

Regards,

Oleksa-1’s picture

Category: feature » bug

Confirm issue. As I see from here http://drupal.org/node/1137672 with taxonomy there is the same bug.

dawehner’s picture

Category: bug » feature

Though i still think this is effective a feature not a bug.

tim.plunkett’s picture

FileSize
859 bytes

Not sure if this is still valid, since this file was added by #1395320: In a summary, view shows the key, not the value from List(integer) or List(Text) fields.

Here's a reroll anyway.

dawehner’s picture

I'm not really sure whether it's a good idea to use a string handler for a numeric internal data representation, even this works for the title, it could cause problems on other places now or in the future.

tim.plunkett’s picture

Triggering the testbot.

Status: Needs review » Needs work

The last submitted patch, views-1382120-6.patch, failed testing.