Revisions
AI Context Items support full revision history, allowing you to track changes over time and revert to previous versions if needed.
Every save creates a revision
Context items are moderated by the ai_context_editorial workflow, and
Content Moderation creates a new revision on every save. The Create new
revision checkbox on the context item form is therefore always checked and
locked, and there is no setting to turn revisions off. Use the revision log
message to describe each change.
Viewing revisions
The revision history lives at
/admin/config/ai/context/items/{id}/revisions. Reach it from the
Revisions operation in the row dropbutton on the context items listing, or
from the Revisions tab on the item itself. It shows a chronological list of
all revisions, including:
- Revision timestamp
- Revision author
- Log message
- Current vs. previous status
Reverting a revision
From the revision history, you can revert any context item to a previous revision. This creates a new revision with the old content, preserving the full history.
Reverting requires the Revert all AI Context Item revisions permission.
If Dynamic Entity Reference was uninstalled, older revisions may have a log note listing the Specific Entities they referenced before their values were removed. Reverting one of those revisions does not restore the lost references. Reinstall Dynamic Entity Reference and enter the values again if you want the item restricted to those entities.
Token name and revisions
The Token name field is not revisionable. One value applies to all revisions of the item. Revisions do not store an earlier token name, so a revision revert does not change the token name. Drupal stores the value only with the default revision, so a draft of a published item cannot change the token name. The item form shows an error in that case. See Token name.
The revert confirmation warns when the revert makes the token empty in a language, for example a revert to an archived revision of the only published translation. See When a change makes the token empty.
Deleting a revision
Individual revisions can be deleted from the history (except the current revision). This requires the Delete all AI Context Item revisions permission.
Diff integration
When the Diff module is installed, you can compare revisions side-by-side. The module provides custom diff field builders for:
- Specific entities fields -- shows changes to entity item associations (requires Dynamic Entity Reference)
- Scope field -- shows changes to scope value selections
Description, Purpose and Content are compared using their rendered plain-text
fields. Markup stored in these fields does not take effect in the comparison.
For example, a stored <br /> appears as <br /> in the default Raw
view and as <br /> under Strip tags, rather than creating a line break.
The diff integration is automatically enabled when the Diff module is installed. No additional configuration is required.
Comparing revisions requires the View all AI Context Item revisions permission (or Administer AI Context) and view access to the item, as the revision history does. CCC sets this requirement for all Diff versions. Diff 2.0.1 and 2.1.1 also set it upstream. See Access boundaries.
Revision and moderation
Each moderation state change (draft to published, or vice versa) creates a new revision. Combined with revision log messages, this provides a complete audit trail of the editorial workflow.