Node revisions

Last modified: July 31, 2009 - 13:37

When you edit a node in your Drupal site, you have the option of creating a new revision, which allows you to track how the node has changed over time on your site. To create a revision, check the Create a new revision box on the node editing form. You can also have this box checked by default by updating the default Workflow settings on the edit page for your content type(s) (admin >> content management >> content types).

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.

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

 
 

Drupal is a registered trademark of Dries Buytaert.