Closed (duplicate)
Project:
Pathauto
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
2 Jun 2007 at 18:56 UTC
Updated:
16 Aug 2007 at 11:32 UTC
Jump to comment: Most recent file
If I understand correctly the [catpath] pattern should produce an alias like category/subcategory (As [cat], but including its supercategories separated by /.)
On my site it's producing aliases like category_subcategory. I'm running drupal 5.1.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | catpath_separator.patch | 708 bytes | greggles |
Comments
Comment #1
wim leersThis depends on the separator you've set in your Pathauto settings.
Comment #2
gregglesThis is actually a bug. If token is not returning the right separator or maybe pathauto is somehow replacing it with _ instead of / but it's a bug.
Comment #3
najibx commentedYes, similarly, in my case (I use [vocab]/[catpath] ) in the "Category path settings", and the result :
MyVocab/MytermParent-MySubterm
Notice that I am getting "-" instead of "/" for the subterm
it's nothing to do with the "Separator".
Comment #4
martig commentedIt certainly is a bug, cause in 1.x branch I didn't encounter this kind of behavior. I'm using "_" as a replacement for spaces, but "/" certainly isn't a space nor unknown character.
Comment #5
gregglesCan you confirm that this only happens with transliteration enabled?
I've provided a patch which fixes this by letting basically any untransliterated character slip through if you've enabled transliteration. Which I actually think is the more reasonable behavior anyway.
Comment #6
gregglesI believe this is fixed - can either of you test out the patch to confirm that it works for you as well? It's super simple...
Comment #7
martig commentedThanks, the patch seems to have fixed this issue. But now I discovered another issue. I'll open up a new issue for it.
Comment #8
claudiu.cristeaThe issue is not fixed in a proper way. This patch let non-alphanumeric chars in the path.
Example:
will cause [catpath] to be: "abc,-xyz/subcat" but is should be "abc-xyz/subcat".
I think that quotation marks must be striped or replaced by separator in tokens, before they are concatenated.
Comment #9
greggles@Claudiu - a major feature in Pathauto 5.x-2 is that it is much more lenient with what characters it lets into the URLs. This allows it to support international characters in the url. Along with that comes the fact that the filtering system needs a lot of work, as you are finding. There is a separate issue for the punctuation characters treatment and I have some ideas on fixing that, but that is a separate issue from this one. I think you can agree that "abc,-xyz/subcat" is a step in the right direction from "abc-xyz-subcat" - right?
Comment #10
claudiu.cristeaYes, is a step forward. But since this will not gonna be fixed I must use 5.x-1.2. I had tried to find what's wrong but I cannot understand the whole mechanism. I suspect that somewhere the whole alias is cleaned (there the '/' goes into separator).
I thing that the entire alias shouldn't be cleaned. Instead, after building up, the alias must be exploded by '/' and cleaned piece by piece... or something like that.
Comment #11
gregglesClaudiu - there is a patch in that punctuation issue that fixes the commas problem, though not in the best long term manner. If you need it now, just use that patch.
This piece of code actually does clean each token on their own - not the whole alias. And if we split apart by / then we also split apart the term in the case that the term is "books/magazines" (for example).
Comment #12
gregglesI think this is actually a duplicate of http://drupal.org/node/162740 - or at least that fixing that one also coincidentally fixed this.
Right?
Comment #13
martig commentedFixed it for me.
Thanks