Drupal is a registered trademark of Dries Buytaert

Provides helpers (for use in other contrib modules or custom code) to get the list of fields changed between two given revisions of an entity.

Features

  • List the changed fields between two revisions of a content entity.
  • List the values changed in a specified field.
  • For a given field, show its label (optionally overridable) and the values changed inline.

Post-Installation

Enable and use one of Revision Summary's helper methods in your custom code.

You can use it like this to list the fields that have changed between the current revision of a node and an arbitrary version ID.

\Drupal::service('revision_summary.compare_revisions')->listChangedFields($node, $version_id, ['field_example', 'field_other_example']);

or:

$build['field_reasonable_accommodation'] = \Drupal::service('revision_summary.compare_revisions')->giveFieldNameWithChangesInlineAsMarkup(
  entity: $node,
  version_id: $revision_id,
  field_name: 'field_reasonable_accommodation', 
  field_label: "R.A."
);

(Field label here is optional; if it is not provided the field's display name will be taken from the provided entity.)

Note that the underlying Diff module displays most fields like you would expect by default, but Drupal core list fields (numeric lists, text lists) show only the key, not the label value. So to have the field say "R.A. added Wheelchair Full Access, incl. Roll-in Shower" instead of perhaps "R.A. added 3" you will want to go to /admin/config/content/diff/fields and edit the settings (gear icon) for the relevant field, leaving the plugin set to List Field Diff but changing the Comparison method from only "Key" to "Label" or both— "Label (key)".

Additional Requirements

No recommended modules but extremely vaguely related is Revision Helper.

Similar projects

If you are not aware of it, certainly see what Diff module can do in its own right, with additional entity types supported by Entity Diff UI.

Supporting this Module

You can support Agaric's overall contributions to Drupal and a bit beyond by supporting Drutopia at opencollective.com/drutopia. Thanks!

Community Documentation

Documentation help always welcome; right now this module page is mostly it.

Activity

Total releases
2
First release
Apr 2025
Latest release
6 months ago
Release cadence
151 days
Stability
0% stable

Releases

Version Type Release date
1.0.0-alpha1 Pre-release Sep 4, 2025
1.0.x-dev Dev Apr 6, 2025