[policy, no patch] Convert all entities that extend ContentEntityBase to be revisionable

Created on 23 November 2015, over 9 years ago
Updated 22 April 2025, 4 days ago

Problem/Motivation

Currently the only core entities that are revisionable is the node entity and block content entities. All content entities have a good use case to be revisioned and can fairly easily be made revisionable.

Proposed resolution

We can quite easily make all entities revisionable by doing a hook_entity_type_alter() and setting the revision key. Maybe we should make it even easier to set the revision key? so easy that it could be done via config or even via a checkbox within a config page or bundle.

User interface changes

Need to think about where, but a checkbox to enable revisions seems good. Maybe even a revision config page where all entities can be managed.

API changes

If anything, only a some new methods to more easily update entity keys.

Data model changes

Eventually we will need a way to migrate data from the old schema to the new revisionable schema, but for now, as an MVP I think we should only allow entities to have revisions enabled if they have no data. Then we look further down the line to add a migration in that moves content.

🌱 Plan
Status

Closed: outdated

Version

11.0 🔥

Component

entity system

Created by

🇬🇧United Kingdom timmillwood 🏴󠁧󠁢󠁷󠁬󠁳󠁿 Wales, UK

Live updates comments and jobs are added and updated live.
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.

  • 🇳🇿New Zealand quietone

    There hasn't been conversation here for 9 years and the majority of entities that extend ContentEntityBase are revisionable. Those that are not are comment, file, message, shortcut, and user. Of those there are issues for file, user and comment. And for shortcut and message, there are issues to discuss removing them from core. Those should be resolved before discussing making those entities revisionable.

    I think that this issue can be closed and implementation can continue in the other issues.

Production build 0.71.5 2024