The default table mapping and the SQL storage do not agree on whether non-revisionable bundle fields should get a revision table

Created on 14 February 2020, over 5 years ago
Updated 15 August 2025, 9 days ago

Problem/Motivation

Currently when you have a revisionable entity type with a non-revisionable field storage definition requiring a dedicated table, the (default) table mapping returns no dedicated revision table, while the storage and storage schema handlers expect the revision table to be there and try to read from/write to it.

This is bad, because the more we start relying on the table mapping to write schema-agnostic code, the more this discrepancy will bite us. Here's a prime example: #3056539: Updating an entity type from non-revisionable to revisionable fails if it has non-revisionable fields stored in dedicated tables โ†’ .

Proposed resolution

Use the same logic across the table mapping and the SQL storage/schema. Since reconciling the two behaviors is a BC break in either direction, we will need a BC layer and some form of deprecation.

We need to figure out whether we want the table mapping to behave as the SQL storage/schema or viceversa. Given that itโ€™s perfectly legal to have a non-revisionable field on a revisionable entity type and that in such case there is absolutely no point in having a revision table, since it would be a straight copy of the data table, it's probably more correct to extend the table mapping logic to the SQL schema, however this is likely to require a more complex BC layer, as people might be relying on the existence of revision tables. In this case we'd likely be deprecating the existence of revision field tables for non-revisionable fields on revisionable entity types without actually dropping them.

Remaining tasks

  • Decide how to reconcile the two behaviors
  • Write a patch
  • Reviews

User interface changes

None

API changes

TBD

Data model changes

TBD

Release notes snippet

TBD

๐Ÿ› Bug report
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component

entity system

Created by

๐Ÿ‡ฎ๐Ÿ‡นItaly plach Venezia

Live updates comments and jobs are added and updated live.
  • Needs release manager review

    It is used to alert the release manager core committer(s) that an issue significantly affects the overall technical debt or release timeline of Drupal, and their signoff is needed. See the governance policy draft for more information.

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.

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia acbramley

    Popped up in BSI triage, it seems like this is still an issue based on the code in HEAD. Would be good to have some steps to reproduce this bug.

Production build 0.71.5 2024