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') {

CommentFileSizeAuthor
#1 no_slashes_alias_224243.patch1.27 KBgreggles

Comments

greggles’s picture

Status: Active » Needs review
StatusFileSize
new1.27 KB

This makes sense to me, but I think that checking for "alias" as the end of the string is a more robust solution.

greggles’s picture

Status: Needs review » Fixed

Committed to 5.x and HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.