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.

CommentFileSizeAuthor
#5 catpath_separator.patch708 bytesgreggles

Comments

wim leers’s picture

Status: Active » Closed (works as designed)

This depends on the separator you've set in your Pathauto settings.

greggles’s picture

Status: Closed (works as designed) » Active

This 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.

najibx’s picture

Yes, 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".

martig’s picture

It 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.

greggles’s picture

Status: Active » Needs review
StatusFileSize
new708 bytes

Can 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.

greggles’s picture

Assigned: Unassigned » greggles

I 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...

martig’s picture

Thanks, the patch seems to have fixed this issue. But now I discovered another issue. I'll open up a new issue for it.

claudiu.cristea’s picture

The issue is not fixed in a proper way. This patch let non-alphanumeric chars in the path.

Example:

Category: "Abc, xyz"
Sub-category: "subcat"

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.

greggles’s picture

@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?

claudiu.cristea’s picture

Yes, 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.

greggles’s picture

Claudiu - 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).

greggles’s picture

Status: Needs review » Closed (duplicate)

I think this is actually a duplicate of http://drupal.org/node/162740 - or at least that fixing that one also coincidentally fixed this.

Right?

martig’s picture

Fixed it for me.
Thanks