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:

  1. create a test node
  2. edit the node, and under "publishing options" select the "create new revision" checkbox, submit your change
  3. goto the "revisions" tab for this node
  4. 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

CommentFileSizeAuthor
node-delete_last_revision_path.patch767 bytesdww
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

killes@www.drop.org’s picture

Status: Needs review » Fixed

no better idea how to fix this.
applied

Anonymous’s picture

Status: Fixed » Closed (fixed)