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.
after deleting the last revision of a node, drupal attempts to send you back to the "revisions" tab for that node, which is now an invalid path.
to repeat:
- create a test node
- edit the node, and under "publishing options" select the "create new revision" checkbox, submit your change
- goto the "revisions" tab for this node
- click on the "delete" link under "operations" for the previous (non-current) revision
you'll be sent back to a path like:
http://localhost/drupal-4-7/node/2/revisions
which will give you text like:
Access denied
Deleted testing revision 4.
You are not authorized to access this page.
the attached patch fixes this problem. i'm not sure if there's a better way to figure out if we just deleted the last revision of a file, other than doing another db_query() against the {node_revisions} table. that's what we do in node_menu() to decide if we should display the revisions tab at all, so it seemed like a reasonable choice. comments please. ;)
thanks,
-derek
Comment | File | Size | Author |
---|---|---|---|
node-delete_last_revision_path.patch | 767 bytes | dww | |
Comments
Comment #1
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedno better idea how to fix this.
applied
Comment #2
(not verified) CreditAttribution: commented