When creating an automated path alias that uses the path token of a related node ignore words are being removed in pathauto_cleanstring.

If you had a node (node1) with a path alias set to /the-way and a bunch of nodes (sub-node) that refer to it and try to use the node1 path in their automated path alias ([node1-path]/[sub-node-title-raw]). A sub-node with "test" as the title would end up with an alias of /-way/test, instead of /the-way/test.

The pathauto_cleanstring function already takes a parameter to allow path tokens to specify that slashes should not be removed, so it should have another parameter to specify whether or not to remove the ignore words.

CommentFileSizeAuthor
#4 pathauto-793494_2.patch2.73 KBDeeLay
#1 pathauto-793494.patch2.56 KBDeeLay

Comments

DeeLay’s picture

StatusFileSize
new2.56 KB

patched against head

DeeLay’s picture

Status: Active » Needs review
dave reid’s picture

Version: 6.x-1.1 » 7.x-1.x-dev

HEAD = Drupal 7 (7.x-1.x-dev).

Instead of having more conditions like this, we should probably just combine these two parameters into one $is_path boolean parameter.

DeeLay’s picture

StatusFileSize
new2.73 KB

yeah, fair point. I guess the only reason for having 2 separate parameters is that it would allow the removal of ignore words to be bypassed without also bypassing the removal of slashes, although I can't think of a use case that would require that.

Created a new patch with 1 parameter.

Status: Needs review » Needs work

The last submitted patch, pathauto-793494_2.patch, failed testing.

dave reid’s picture

dave reid’s picture

Status: Needs work » Closed (duplicate)