Absolute Beginners Guide to Drupal Revisions

tutuploadsmedia_1343771002081.png

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. 

If you want to learn about revisions in WordPress, check out the WordPress revisions guide.

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: http://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 ( http://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: http://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: http://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: http://drupal.org/sandbox/darthsteven/1468938.

Author

  • Steve Burge

    Steve is the founder of OSTraining. Originally from the UK, he now lives in Sarasota in the USA. Steve's work straddles the line between teaching and web development.

0 0 votes
Article Rating
Subscribe
Notify of
8 Comments
Oldest
Newest
Inline Feedbacks
View all comments
paul ea
paul ea
11 years ago

is it safe just to empty the node-revision table?

Josh B
Josh B
11 years ago

Great write up! Thanks for helping others on this. I never knew these modules even existed and they are so important!

SimonW
10 years ago

I think below is one of a great module for revision. It can delete and keep to a certain copies of revisions for each node and support cron as well. It’s better than setting by date as you may end up all revisions gone after some time.
[url=https://drupal.org/project/node_revision_delete]https://drupal.org/project/…[/url]

steve
steve
10 years ago
Reply to  Simon

That’s a useful module. Thanks for the link, Simon

Pontius Pilate
Pontius Pilate
9 years ago

‘Call to me and I will answer you and tell you great and unsearchable things you do not know’

-Jeremiah 33:3

$100873824
$100873824
9 years ago

Great article, very well written and highly informative. Thank you for your contribution! Has there been any change in the management department of these revisions? I still don’t see many modules or ways to help with managing a site that has a lot of content with a lot of revisions. Other than going through each node one by one, I don’t really see an easy way to deal with this. This is important, because some of my content types can hold a lot of images and files. And since their revision still lives in Drupal, those files are still on the server taking up space but NOT being used by the LIVE (current) node but only by the old revisions of that node. Any advice would be greatly appreciated!

Chipo Zunguza
Chipo Zunguza
8 years ago

thank you so much this really helped

8
0
Would love your thoughts, please comment.x
()
x