Drupal allows you to create multiple revisions of the same content
This control function is ideal for tracking changes made to content over time. In other words, it's a simple and fast way to save a copy of each piece of content when you make a change.
In the world of Drupal, content refers to any type of data entered and stored in the database (the elements actually displayed to visitors on the site).
Still in Drupal, to represent and manage different types of content, we use entities. All the components of a site are entities: blocks, paragraphs, nodes, media, comments, users, etc. These are called entity types. They are essential for organizing and structuring a Drupal site's content in a modular way.
Revisions may apply to the content of different types of entities
Revisions can be applied to the contents of different types of entities such as nodes, taxonomy terms, blocks, media, users...
As a reminder, nodes are one of Drupal’s basic entities and are widely used to create and manage content such as articles, pages, blog posts, etc.
Each entity type can have its own rules and behaviors regarding revisions. For example, nodes generally have a "Published" status managed with revisions, while taxonomy terms may have different data fields associated with their revisions.
All content is revisable if the option is enabled for the content type. This allows you to create different versions of the same content: revisions. These are identified by the “revision id” and the content’s own identifier.
What content revision can bring you
Revisions are very useful for correcting errors and improving content; they are especially practical when multiple contributors are working simultaneously on a site and for organizations that must adhere to document retention rules and data history requirements.
Version control ensures accountability, transparency, and the ability to revert to previous states if necessary.
Integrate reviews into your content moderation workflow
The integration of Drupal’s core “content moderation” module with content revisions improves collaborative content creation and review processes. Content moderation allows site administrators to define custom workflows with different states that content must go through before being published (draft, needs review, published, etc.).
Combined with content revisions, the content moderation module enables multiple users with different roles to seamlessly collaborate on content creation:
- Authors can submit drafts for review.
- Editors can make revisions and provide feedback.
- Administrators can oversee the entire workflow.
Revisions serve as checkpoints in the content moderation workflow, capturing each iteration of a content item as it progresses through the review process. This ensures transparency, accountability, and traceability at every stage of content development and publication.
How do revisions work?
When content, such as an article, is modified, Drupal will keep a copy of the current version and create a new version. Over time, several versions of the same article will exist in the back office. Although all these different copies are stored in the database, only one of them is published and accessible to site visitors. This is similar to the track changes feature in a Word document or a version control system such as Git, for example.
There are three terms to distinguish:
- The default revision: When visiting a content page, or when a custom block is loaded on a page, Drupal must decide which revision to load. That’s why a revision is designated as the default revision, meaning that, unless otherwise specified, it’s the one that should be used. For node content, this is commonly known as the published revision.
- The current revision: By using modules such as content moderation, it is possible to create a revision that is newer than the currently published revision. This is called a current revision or a pending revision.
- Archived revision(s): Once a new default revision is set, the previous revision becomes an archived revision.
When saving content, Drupal’s default behavior is to create a new revision containing all updates, then set this new revision as the default revision.
Schedule your posts with the Scheduler module
The Scheduler module in Drupal allows site administrators to schedule content publication and unpublishing at specific dates and times. When used together with content revisions, the Scheduler module streamlines the automated management of revision publishing schedules.
For example, a site administrator can schedule the publication of a revision for a later date using the Scheduler module. This allows content contributors to prepare and finalize content revisions in advance, ensuring timely publication without manual intervention.
The compatibility between content revisions from the “content moderation” module and the Scheduler module is ensured by the scheduler_content_moderation_integration module. This latter streamlines content management processes by managing revision access based on user roles.
Best practices and mistakes to avoid for developers
To modify or extend Drupal’s core functionality, developers code custom modules. Here are some best practices regarding content management and revisions:
- Ensure that content types and custom entities correctly implement revision management mechanisms.
- Use Drupal’s entity API to create, update, and manage revisions programmatically.
- Incorporate revision metadata and necessary relationships to maintain data integrity.
- Implement access control mechanisms to restrict revision management to authorized users.
Additionally, care should be taken:
- Not to overlook revision metadata and its updates when making changes in the code.
- To avoid poor management of revision relationships, which can lead to inconsistencies or data corruption.
- Not to neglect permissions and access controls related to revisions.
- Not to underestimate the impact of revisions on performance and scalability, especially during large-scale deployments.
Drupal, a flexible content management tool for organizations
In short, as we have seen, content revisions are a very interesting feature of Drupal. Developers can create robust and efficient content management systems, allowing for content revision on the one hand, and their integration into content moderation workflows on the other. These strengths make Drupal an advanced tool when it comes to content management.
If you're interested in these features, contact us!