When you delete a node that's in a different language to the one you're currently using in admin/node/content the url alias isn't deleted with the node. This is because the drupal_get_path_alias() call in path_nodeapi($op = delete) (~line 173 path.module) doesn't return the alias due to the langauge difference.

Demonstration
Create a node in language other than English and specify an alias
on the node view page execute php dsm(drupal_get_path_alias('node/$nid')); > returns correct alias
on admin/content/node in English execute php dsm(drupal_get_path_alias('node/$nid')); > returns 'node/{nid}'

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

j0hn-smith’s picture

Title: url alias not deleted with nodes in when in different language admin/node/content » url alias not deleted with nodes when in different language admin/node/content
Dave Reid’s picture

Title: url alias not deleted with nodes when in different language admin/node/content » Path_node_delete can leave abandoned URL aliases
Version: 6.12 » 7.x-dev
Assigned: Unassigned » Dave Reid
Status: Active » Needs review
Issue tags: +Needs backport to D6, +Needs tests
FileSize
772 bytes

The logic in path_node_delete will only delete path aliases for a node only if the user has certain permissions and checking drupal_get_path_alias(). If a user that doesn't have the create url alias permission deletes a node, those records are still left in {url_alias} when they should have been removed since the source path no longer exists.

Status: Needs review » Needs work

The last submitted patch failed testing.

Dave Reid’s picture

Status: Needs work » Needs review
FileSize
787 bytes

Heh...whoops!

Dries’s picture

I committed this to CVS because it is an obvious bugfix. We should have tests for this. I also wonder if we need to do a clean-up update function.

Should probably be backported to Drupal 6 too.

Status: Needs review » Needs work

The last submitted patch failed testing.

Dave Reid’s picture

Version: 7.x-dev » 6.x-dev
Status: Needs work » Patch (to be ported)
Issue tags: -Needs backport to D6, -Needs tests

Should no longer need tests since we added the new API. But this still needs to be backported.

Dave Reid’s picture

Status: Patch (to be ported) » Needs review
FileSize
1.27 KB
thedavidmeister’s picture

Status: Needs review » Needs work

I do not know if we still intend to back port this to D6 but the patch does not apply anymore:

error: path/path.module: No such file or directory

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.