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.
Actually there is a problem with taxonomy terms that have spaces.
For example, something like
/myview/cms drupal+php+web will be interpreted like
cms+drupal+php+web
wich means that 'cms drupal' will never be selected.
Comment | File | Size | Author |
---|---|---|---|
#22 | views-n1027458-22.patch | 2.42 KB | DamienMcKenna |
#22 | views-n1027458-22.interdiff.txt | 701 bytes | DamienMcKenna |
#7 | 1027458.views-7.x-3.x.7.patch | 3.94 KB | dagmar |
#6 | 1027458.views-7.x-3.x.patch | 3 KB | dagmar |
#3 | 1027458.views-3.x.patch | 3.18 KB | dagmar |
Comments
Comment #1
dagmarHere is the patch
Comment #2
dawehnerOh if i apply this patch i get
Comment #3
dagmarHere is the re-roll.
Comment #4
SgtPepper CreditAttribution: SgtPepper commentedCould this be ported to version 7?
thanks!
Comment #5
dawehnerThe current patch is against 6.x, so please keep it there.
If you want to help please test the patch there, i'm pretty sure then it's not that hard to port to 7.x-3.x
Comment #6
dagmarHere is the 7.x-3.x version. Changed the title since it works for other kinds of arguments besides taxonomy terms.
Comment #7
dagmarAfter some testing I found this doesn't work for arguments with dashes on it
Now this is working properly.
Dashes in arguments have to be encoded using a double dash, like this:
my_view/Consectetuer--Decet+At-Fere-Iusto-Luptatum
This will filter by "Consectetuer-Decet" OR "At Fere Iusto Luptatum"
Also, would be nice to fix #1042546: Allow to replace spaces by dashes in links to encode a dash into a double dash.
Comment #8
dagmarHere is the 6.x-3.x version.
Comment #9
dawehnerWhen testing this patch i saw that '-' are converted to '/' if you don't have checked "replace spaces with -' this sounds like a bug.
Shouldn't be to hard to fix.
One additional thing i saw is that
this doesn't allow to use "+" anymore
Comment #10
dagmarThanks for the review @dereine.
Well I did some changes to the patch. There was some problems with strings like "Drupal - Wordpress".
So, this patch allows to filter taxonomy terms (and probably titles or other strings) like:
And the combination of thos strings in something like
Drupal- CMS+Wordpress- &- Others
I tried to write test to check this but I didn't found an easy way to add taxonomy terms to nodes using simpletest. Sorry.
Comment #11
dawehnerI totally get this change, you want to have a way to distinct between "-" and "--", though i'm wondering whether people actually expect to have " " to "-". Wouldn't it be possible to use -- to "\", then "-" to "/" and then "\" to "-", so for the actual output nothing changes.
I'm trying to write a simpletest without taxonomy terms, but with plain title strings.
Comment #12
tim.plunkettTriggering the testbot.
Comment #14
burgs CreditAttribution: burgs commentedWould it be a crazy time to suggest that we replace the OR operator from a + to something like a | or something that isn't a somewhat special character in urls?
Comment #15
sokrplare CreditAttribution: sokrplare commented+1 for comment #14!
Looks like the D7 patch in #10 no longer applies (not too much surprise there, but just to save others some time trying) - the issues are with includes/handlers.inc.
Comment #16
dawehnerIn general we certainly needs tests here, especially if we want to get this into D8 as well.
The problem, even it might work, is that we aren't allowed to change existing behavior. This means we have to support still both usecases.
Given that we do the same in several places, we should move that to a function.
In general I do prefer to have both patches in one place, tbh.
Comment #17
imclean CreditAttribution: imclean commentedComing in late here, but could this simply be an option instead? Here's an example for string contextual filters which provides an option to preserve spaces. Default is the current behaviour.
Comment #18
imclean CreditAttribution: imclean commentedFix typo, whitespace and some code.
Comment #19
ladybug_3777 CreditAttribution: ladybug_3777 commentedThere's been movement on this issue on a related post: https://www.drupal.org/node/1534720
Comment #20
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 4 year old patch in #18 to views_handler_argument_string.inc still applies cleanly to the latest views 7.x-3.x-dev and if still relevant needs to be reviewed.
Comment #21
NitebreedStumbled upon this issue today, patch in #18 works perfectly
Comment #22
DamienMcKennaA minor adjustment, to remove the trinary operator.
Comment #24
DamienMcKennaComment #25
eloivaque#22 Work for me