Start a FREE 7 day trial! Get training videos and books, plus expert support:  

Drupal Tutorials and How-to Support Articles

Absolute Beginners Guide to Drupal Revisions

Do you work with clumsy people? Are you a clumsy person yourself? If so, then Revisions might be the solution for you.

Revisions is a quick and easy way to save a copy of every Drupal content item when you make a change. In reality, Revisions is not only useful for clumsy people but also for organizations that have a lot of content creators and for many government agencies who have record keeping rules to follow.

In this tutorial, we'll give you an introduction to the core Revisions features and then show you some useful extra modules.

Enabling Revisions

Revisions are enabled per each content type.

  • Go to Structure, then Content types.
  • Click edit next to a content type.
  • Scroll down to Publishing options and check the Create new revision box.
  • Click Save content type.
tutuploadsmedia_1343771002081.png
  • Click Add content and choose the content type you just enabled revisions for.
  • Create a new content item and click Save.
  • Click the Edit tab.
tutuploadsmedia_1343774185984.png
  • Make a change to the content.
  • There will now be a Revision information box at the bottom of the page. The Create new revision box will be checked by default. You can enter a message describing what you changed.
tutuploadsmedia_1343771153300.png
  • Click Save and you'll now see the Revisions tab.
tutuploadsmedia_1343771197766.png
  • Click the Revisions tab.
  • You'll see the previous version of the content, plus your new version.
  • Click revert to go back and use the previous version.
tutuploadsmedia_1343771214679.png

Diff

There are some key limitations to the way Drupal handles revisions by default. Perhaps the most important is that you can't easily what was changed in each revision. The solution for that is the Diff module: https://drupal.org/project/diff.

Instal Diff and your Revisions tab will now allow you to select two versions to compare:

tutuploadsmedia_1343771257275.png

Here is how the actual comparison appears on the screen:

tutuploadsmedia_1343771280626.png

Revisioning

Another useful addition feature is the ability to moderate all revisions. Using the Revision module ( https://drupal.org/project/revisioning ) it is possible to put all revisions into "draft" status. By default, this is enabled only for live content on your site, so you can make sure no unwanted changes are published.

tutuploadsmedia_1343772186558.png

Revision All

Revision All is a useful module for site administrators: https://drupal.org/project/revision_all. This allows you to easily force revisions to be used for all current and future content types.

You can also disable the "Create new revision" box so that content creators aren't able to uncheck it and avoid saving a revision.

tutuploadsmedia_1343772400760.png

One Key Limitation

One important limitation with revisions in Drupal 7 is the lack of a way to automatically delete old revisions.

The Revision Deletion module was available for D7 and D6 but hasn't been update for D7: https://drupal.org/project/revision_deletion/.

If you have a large site and end up storing a lot of revisions, you may well need to find a solution for clearing the node_revision table in the database. One possibility, for advanced users, is here: https://drupal.org/sandbox/darthsteven/1468938.

 

Start a FREE 7 day trial! Get training videos and books, plus expert support:  

License

All of our tutorials are published under the Creative Commons Attribution-NonCommercial license. This means:
  • You can re-use these tutorials.
  • You can modify these tutorials.
  • You must link back to our original tutorial.
  • You can't use these tutorials commercially.
Click here to read the full license.