Using the "raw" version of a location wildcard token in pathauto (for example, [location-city_0-raw]) produces an invalid token error. I noticed this problem after an update of token module from 6.x-1.12 to 6.x-1.15.
It looks like the regular expression in the patch that resolved #883804: Token 6.x-1.14 breaks location wildcard tokens with Pathauto 6.x-1.4 assumes the "wildcard" tokens will end with a number. This means that the variations that end with "-raw" are disallowed.
I resolved the problem for my site by changing line 539 (on token.module 6.x-1.15) from
elseif (preg_match('/^(.*[_-])\d+$/', $token, $result)) {
to
elseif (preg_match('/^(.*[_-])\d+(\-raw)?$/', $token, $result)) {
Maintainers, thanks for your work on this incredibly important module!
Comment | File | Size | Author |
---|---|---|---|
#1 | token-raw-version-of-wildcard-tokens-1066454-2.patch | 1022 bytes | isaac77 |
Comments
Comment #1
isaac77 CreditAttribution: isaac77 commentedHere's a patch against 6.x-1.x-dev. I'm neither very familiar with the internals of token module nor an expert on regular expressions... so this definitely needs to be looked at. Thanks!
Comment #2
Dave Reid#1: token-raw-version-of-wildcard-tokens-1066454-2.patch queued for re-testing.