When I use [termalias] token field for generating urls for nodes, pathauto removes slashes from path.
But it isn't good. When I set an hierarchial terms (for example, path alias for taxonomy/term/5 is folder1/subfolder2) and pathauto pattern [termalias]/[title].html, pathauto generate path like 'folder1subfolder2/nodetitle.html', but path must be 'folder1/subfolder2/nodetitle.html'.
The easy patch for it is to change string in function pathauto_clean_token_values($full):
if (substr($full->tokens[$key], -4, 4) === 'path' || substr($full->tokens[$key], -8, 8) === 'path-raw') {
to
if (substr($full->tokens[$key], -4, 4) === 'path' || substr($full->tokens[$key], -8, 8) === 'path-raw' || $full->tokens[$key] == 'termalias') {
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | no_slashes_alias_224243.patch | 1.27 KB | greggles |
Comments
Comment #1
gregglesThis makes sense to me, but I think that checking for "alias" as the end of the string is a more robust solution.
Comment #2
gregglesCommitted to 5.x and HEAD.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.