Drupal lets you create a new revision every time a node is updated. This allows you to track how the node has changed over time on your site.

To enable this feature you go to the default node editing form (D6: administer/content management/content types/edit/workflow settings; D7: administer/structure/content types/edit/publishing options) and check the box Create a new revision in the node editing form. This will result in a new revision being created every time the node is edited. (Administrators can override this when editing an individual node.)

To view and manage revisions, use the Revisions tab when viewing a node (you must have "view revisions" or "administer nodes" permission to view revisions.) From the Revisions tab, you can view the individual revisions, revert to an earlier revision, and delete revisions (you must have the "administer nodes" or "revert revisions" and "delete revisions" permissions).

One interesting detail of the system is the behaviour of the reverting mechanism. Let's say you have revisions {1,2,3,current}. If you revert to revision #2, a copy of #2 is made and the copy is set as the current revision. Thus, after reverting you'll have {1,2,3,4,current}, where current is a clone of #2, and #4 is the previous current revision.

Another useful feature of the revision system is the Log field, which appears near the "Create a new revision" check box on the node editing form. If you add a message to the Log field when you create a revision, that message will appear on the Revisions tab along with the revision. It is a good idea to add a meaningful Log message whenever you create a node revision, so that others (or you, months later) can see why you changed the node and what your changes were, without having to actually view the previous revision.

You can enhance the revisions tab by installing the contributed Diff module. This module allows you to see the differences between two revisions; without this module, you can only view the entire content of each revision, and it may be difficult to tell exactly what has changed between the revisions.

Note that the node_revisions table in the database will always have one record associated with each record in the node table, which it keeps track of as the current revision. This will happen even if you do not have revisions enabled. On the other hand, if you have enabled revisioning, you will have multiple entries in your node_revision table associated with each node, corresponding, not just to the current revision, but all past revisions too.

(Authoring note: Some of the content of this page came from http://groups.drupal.org/node/1875.)

The Revisioning module provides more fine-grained control for revisions in Drupal 6.x and 7.x: http://drupal.org/project/revisioning

Comments

squares’s picture

I have a client who would like to see their revisions exactly as they would appear if they were selected as the current revision. However, when viewing inactive revisions, the sidebar regions are not being displayed. I've checked the settings for the blocks that SHOULD appear there, and they're all set correctly... I have looked around for a template that might drive this page with no luck. Can anyone help point me in the right direction?

Thanks,
S

akalata’s picture

I've been able to see my sidebar regions when viewing revisions when using Context to display blocks.

As far as templates go, I have confirmed that core revisions don't use node.tpl.php to render content -- perhaps that extends to page.tpl.php as well?

smussbach’s picture

The templates are defined in diff/diff.theme.inc. You can hook into them by simply defining them in your custom module or your template.php.
To override theme function theme_diff_node_revisions($vars) you could define in template.php

/**
* Implements theme_diff_node_revisions()
**/
function YOURTHEMENAME_diff_node_revisions($vars){
  // your code here
}
criscom’s picture

Hi,

I cannot find any information on how to replace the revision table showing all revisions on node/nid/revisions. I would like to replace/overwrite that table/view but cannot find a template file. Big thank you in advance for pointing out a direction.

Chris

gwyn@mobomo.com’s picture

Hi - I have a customer who is using Drupal and has revisions on, but wants to have a version saved to S3 every time the node is published. Other than checking the logs within Drupal and seeing the revisions there, is there a way to get a copy of the node, every time something changes and push a copy of it out to S3? We need this for FOIA requirements.

mudasirweb’s picture

I have Diff module enabled and when checking the revisions of node, sometimes I found some of the revisions shows the revision author as Anonymous, when checking the database I found in revisions table for same node some revisions_id's has revision_uid set to 0. Not sure why it does not saves the revision user sometimes. Anyone else facing such issues.

hungry_mind’s picture

One interesting detail of the system is the behaviour of the reverting mechanism. Let's say you have revisions {1,2,3,current}. If you revert to revision #2, a copy of #2 is made and the copy is set as the current revision. Thus, after reverting you'll have {1,2,3,4,current}, where current is a clone of #2, and #4 is the previous current revision.

I wonder what the usefullness of the above behavior is. The result of this is to result with a long revision list, creating confusion to the administrator. Each time one reverts to a past revision, the copy of this revision is created and this copy has to be deleted, in order to keep the list of revisions short.
Viewed from another aspect, almost every software in the planet that has reverting functionality to a previous content revision, does not create a copy of this when reverting back. It just keeps the no. of revisions unchanged.

Is there any way of disabling this behavior, of automatically created copies of revisions after reverting to a past revision?