Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#11 | 1424500.patch | 5.49 KB | dawehner |
#9 | views-list-text-fix-url-munging-1424500.patch | 3.79 KB | webchick |
#6 | views-list-text-fix-url-munging-1424500.patch | 2.62 KB | webchick |
#5 | views-api-docs-cleanup-1461840.patch | 32.85 KB | webchick |
#1 | job-view.txt | 12 KB | webchick |
Comments
Comment #1
webchickSame 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.
Comment #2
leex CreditAttribution: leex commentedsubscribe
Comment #3
webchickOk, 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.
Comment #4
dawehnerOh. Sorry for committing such things very fast.
There has to be probably one argument handler for list and list
Comment #5
webchickThat 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.
Comment #6
webchickDoh. WRONG patch.
Comment #7
dawehnerOne problem i see here is that you forgot to add the file to .info, maybe this solves the problem already.
The rest looks fine.
Comment #8
leex CreditAttribution: leex commentedI'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"
Comment #9
webchickWell, 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.
Comment #10
tim.plunkettDefinition of views_handler_argument_field_list_text.
This is over 80 chars, and is still copy/paste from views_handler_argument_field_list
needs
'bool' => TRUE
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.
Comment #11
dawehnerSo 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.
Comment #12
dawehnerUpdate title
Comment #13
dawehnerAdding tags
Comment #14
dawehnerRetested the latest patch and committed to 7.x-3.x
Comment #15
iben CreditAttribution: iben commentedDear 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.