While debugging a few issues I was having with the alias being generated when the entity was saved, I tried to work something out using the path action: "Create or delete a content's URL alias", I found out it was working very oddly:

Things I've noticed:

- If you leave the alias empty (so that you want it deleted) it won't do a thing
- If you enter any alias, a new alias will be added leaving others in the alias table (I am unsure if this was intended, but based that the empty should delete it, it's my assumption that entering an alias should update one if it exists)

Further more, I've given more thoughts into whether you would want to update or create a new alias and although I think that can be added as another parameter to the action, I believe that it can also be made with the more generic "Create or delete any URL alias" leaving this one for updating/deleting.

Similar thing happens on the taxonomy's term alias update action. Also, while reviewing this, I noticed the base was wrongly set for the taxonomy action (probably due to a undetected copy paste).

CommentFileSizeAuthor
#1 2009354-1-fix-path-actions.patch5.72 KBhanoii
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hanoii’s picture

Status: Active » Needs review
FileSize
5.72 KB

Attached is a patch that tries to work this out, it uses the same approach used by the path.module to bring path details into the node's form, because the path module doesn't add it to the node or taxonomy's element when it's loaded.

Now it properly creates, update or deletes content or taxonomy aliases.

It also fixes the improper taxonomy action base as well as changed some texts to explain the action better.

Status: Needs review » Needs work

The last submitted patch, 2009354-1-fix-path-actions.patch, failed testing.

jelo’s picture

Hanoii, I just ran into the issue in the 6.x-1.5 version. I can confirm that deletion does not work. "Create or delete a content's URL alias" did not work at all for me.

Then I tried "Create or delete an URL alias". The strange thing is that it does not work with tokens or php evaluation to set the existing systems path correctly.

If I hardcode a random nid into the field named "existing system path", such as node/234 the alias will actually be deleted.

However, if I use token [node:nid] or php node/<?php echo $node->nid;?> it won't do anything.

jelo’s picture

Issue summary: View changes

Updated issue summary.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: 2009354-1-fix-path-actions.patch, failed testing.