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.
If you want to learn about revisions in WordPress, check out the WordPress revisions guide.
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.
- 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.
- 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.
- Click Save and you’ll now see the Revisions tab.
- 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.
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:
Here is how the actual comparison appears on the screen:
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.
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.
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.
is it safe just to empty the node-revision table?
Hi Paul. The downside to that is you’ll lose all your revisions.
I’ll see if can follow up with a blog post on a better solution for only clearing older versions.
Great write up! Thanks for helping others on this. I never knew these modules even existed and they are so important!
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.
That’s a useful module. Thanks for the link, Simon
‘Call to me and I will answer you and tell you great and unsearchable things you do not know’
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!
thank you so much this really helped