it looks to me that pathauto doesn't replace slashes in node titles. Eg. My title is "What happened on 10/25/2007" the path generated is "node/what-happened-on-10/25/2007" causing Drupal to search for non existing pages!

I can't see this reported on any other post...

CommentFileSizeAuthor
#7 pathauto.180460.patch995 bytesHenrik Opel

Comments

greggles’s picture

Status: Active » Postponed (maintainer needs more info)

I can't repeat that behavior. Are you perhaps running a patched version of the module?

greggles’s picture

Status: Postponed (maintainer needs more info) » Active

Pardon me - I do see this now. I'll see what I can find...

pulpzebra’s picture

yes... version is 5.x.2.0-beta3 plain... not patched. Same behaviour with previous versions. It got me quite surprised that anyone has run into this before!

pulpzebra’s picture

hi. Any news about this issue?

HorsePunchKid’s picture

Are you using one of the patches from the punctuation characters issue? If so, it may be incorrectly preserving those slashes from the node title (see Wolfey's comment).

greggles’s picture

see comment 3 - not patched.

pulpzebra - I'm not sure exactly when/where this issue slipped in but I've got a fix coming soon.

Henrik Opel’s picture

Status: Active » Needs review
StatusFileSize
new995 bytes

Hi there,

we ran into this issue today and tracked it down to pathauto_cleanstring().

Looks like the following code,

    // Preserve alphanumerics, everything else becomes a separator.
    $pattern = '/[^a-zA-Z0-9]+/ ';
    $output = preg_replace($pattern, $separator, $output);

which is responsible for removing slashes (and other stuff), accidentally ended up inside an if-statement for the recently added (optional) transliteration feature. Thus it will only execute if the transliteration option is enabled.

We simply moved it out of the if-statement so that it is always executed when pathauto_cleanstring() is called and the removal works again, regardless of the state of the transliteration option.

Patch is against branch DRUPAL-5--2 of pathauto.

greggles’s picture

Status: Needs review » Needs work

@HeO - it wasn't accidental. The reason it was moved inside the transliteration branch is that if you use non-ASCII characters then that preg_replace will destroy them.

Henrik Opel’s picture

@greggles: - I see - looks like I should have read the punctuation chars treatment issue more carefully - sorry for adding a redundant suggestion/patch.

Still, that preg_replace() being only executed if transliteration is enabled is the reason for slashes not being removed if not. So this issue is more or less just a 'sub' problem of the punctuation chars treatment issue.

But as long as there is no better solution in place, the current behavior is a regression for anyone upgrading from pre 5.x-2.0 pathauto, since it changes behavior silently. This is irritating and can break existing sites, so I think it would be better to leave the 'old' behavior in place. This would result in the choice for administrators currently being:

A - transliteration disabled: Everything works as before
B - transliteration enabled: New feature, transliterate (very nice, btw :)

Option 'C - allow non-ASCII characters', could be added once the punctuation chars treatment issue is resolved.

Your call, of course, but if you opt for the current state, this issue should be marked as a duplicate.

greggles’s picture

Status: Needs work » Fixed

Transliteration was actually available before - it's the ability to make it optional that's new.

Anyway, I believe that I've fixed this as part of a big patch I just did. If you want to test please follow the instructions in http://drupal.org/node/143831#comment-322101

Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)