Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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}'
Comment | File | Size | Author |
---|---|---|---|
#8 | 481706-path-deleted-nodes-D6.patch | 1.27 KB | Dave Reid |
#4 | 481706-path-D7.patch | 787 bytes | Dave Reid |
#2 | 481706-path-D7.patch | 772 bytes | Dave Reid |
Comments
Comment #1
j0hn-smith CreditAttribution: j0hn-smith commentedComment #2
Dave ReidThe 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.
Comment #4
Dave ReidHeh...whoops!
Comment #5
Dries CreditAttribution: Dries commentedI 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.
Comment #7
Dave ReidShould no longer need tests since we added the new API. But this still needs to be backported.
Comment #8
Dave ReidComment #9
thedavidmeister CreditAttribution: thedavidmeister commentedI 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