New action/condition: entity diff

Issue information

From user: jurgenhaas

Related to !363 (merged)

Contribution record

Fork management

Problem/Motivation

To know if an entity got changed and/or which fields of an entity got changed, would help a lot in many use cases.

Proposed resolution

The following 2 new plugins should work based on a content entity which contains a original property, e.g. in the pre-save entity event:

  • Provide a new action that returns a list of field names that got changed
  • Provide a new condition that return TRUE if at least one field got changed

An extra bonus would be if those two plugins also worked in the form context, i.e. in the form validate event.

Remaining tasks

  • There is a todo comment in the MR to enhance the access control
  • Add a condition plugin which verifies if either field has changed, or a single field provided in the include field
  • Move common code between action and condition plugin into a trait
  • Write tests
Edited by drupalbot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information