Hello!

I used a contextual filter in 7.x-3.0-rc1 on a drop down list field that took advantage of the option "Transform spaces to dashes in URL". In 7.x-3.1 this option is no longer available in 7.x-3.1, at least not for drop down lists. If I try a regular text field it works fine. Has this been changed on porpuse? Any work arounds available? Thanks in advance!

Cheers, Ben.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

Version: 7.x-3.1 » 7.x-3.3
FileSize
12 KB

Same deal in 7.x-3.3.

I see the code in handlers/views_handler_argument_string.inc so I know it's there. But in a view with a List (text) field as a contextual filter (displayed as summary), the options don't show up, even though they used to in earlier versions.

Here's my view output in case it is helpful.

leex’s picture

subscribe

webchick’s picture

Ok, spoke to merlinofchaos about this. This was broken in #1395320: In a summary, view shows the key, not the value from List(integer) or List(Text) fields. because the list argument handler added in http://drupalcode.org/project/views.git/commit/0c3c1c35a5c8b64d33d15da18... assumes all lists are numeric-derived.

dawehner’s picture

Oh. Sorry for committing such things very fast.

There has to be probably one argument handler for list and list

webchick’s picture

Status: Active » Needs work
FileSize
32.85 KB

That comment was a little bit obtuse. :)

I think you mean something like this? (I didn't bother renaming views_handler_argument_field_list to views_handler_argument_field_list_numeric because I wasn't sure what that would do to existing installations.)

However, this doesn't seem to work. :( Not only do I not see the URL munging options, but I also don't even see the addition to options_form that's supposed to be there. Hm.

webchick’s picture

Doh. WRONG patch.

dawehner’s picture

One problem i see here is that you forgot to add the file to .info, maybe this solves the problem already.

The rest looks fine.

leex’s picture

I've patched manually and created the new .inc and included it in the .info file but cannot see any extra options. I definitely have friendly names for my list items.

This was with Views version = "7.x-3.3+47-dev"

webchick’s picture

Status: Needs work » Needs review
FileSize
3.79 KB

Well, here's a working patch that gets the options to show up. In addition to the missing files[] property (thanks!), the problem was that the $field argument was being overwritten in a foreach loop, so I changed that variable to $field_name instead. (Again, this is a SVN/p0 patch; sorry, I don't have this code in Git atm.)

However, the "Case in path: Lower case" option does not seem to actually work even though it is selected. Hm.

tim.plunkett’s picture

Status: Needs review » Needs work
+++ modules/field/views_handler_argument_field_list_text.inc	(revision 0)
@@ -0,0 +1,57 @@
+ * Contains views_handler_argument_field_list handler

Definition of views_handler_argument_field_list_text.

+++ modules/field/views_handler_argument_field_list_text.inc	(revision 0)
@@ -0,0 +1,57 @@
+ * Argument handler for list field to show the human readable name in the summary.

This is over 80 chars, and is still copy/paste from views_handler_argument_field_list

+++ modules/field/views_handler_argument_field_list_text.inc	(revision 0)
@@ -0,0 +1,57 @@
+    $options['summary']['contains']['human'] = array('default' => FALSE);

needs 'bool' => TRUE

+++ modules/field/views_handler_argument_field_list_text.inc	(revision 0)
@@ -0,0 +1,57 @@
+      '#default_value' => $this->options['summary']['human'],#

Trailing #? seems to have been in views_handler_argument_field_list as well.

Ooookay now I just realized its straight up copy/paste. Duh on me.

Maybe views_handler_argument_field_list_string instead of views_handler_argument_field_list_text? Wasn't immediately obvious to me the difference.

dawehner’s picture

Status: Needs work » Needs review
FileSize
5.49 KB

So here is a patch which fixes the concerns raised by tim.plunkett, and fixes the case converting for both all handlers, this actually never worked.

dawehner’s picture

Title: Transform spaces to dashes in URL no longer working in 7.x-3.1 » Transform spaces to dashes in URL in list fields does not work

Update title

dawehner’s picture

Issue tags: +Release-blocker

Adding tags

dawehner’s picture

Status: Needs review » Fixed

Retested the latest patch and committed to 7.x-3.x

iben’s picture

Dear all,

thank you very much for all your work! I applied the "views-list-text-fix-url-munging-1424500.patch" of webchick, but now my contextual filter in the Views Module (7.x-3.3) shows only "Broken/missing handler " if I try to create a filter. Should I better just wait for the next tested and published version of Views or can I otherwise help out somehow?

Cheers, Ben.

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