Need to add an entity update event listener to add moderation state for newly revisionable fields

Created on 15 May 2019, over 5 years ago
Updated 24 October 2023, about 1 year ago

Problem/Motivation

After https://www.drupal.org/node/3034742 β†’ we no longer get moderation state fields for free on revisionable entity types

We need to react to the entity type being saved like in \Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber::onEntityTypeUpdate

Proposed resolution

- add event listener
- add update hook to create the field for any newly revisionable entity-types we don't already have (e.g. taxonomy, menu link)

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • @hitchshock opened merge request.
  • Status changed to Needs review about 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine HitchShock Ukraine

    Sometimes the patch can be really useful when some hook_update_N() will make the entity type unrevisional.
    But the last patch was incorrect, it can remove the field even if the revision state of the entity type has not been changed.

    Updated the patch and made a PR.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Thanks

    As this is pretty complex it would be good to have some tests for it

Production build 0.71.5 2024