Problem/Motivation

Currently when generating the schema for a translatable entity type, we treat the data table as optional. The reason we introduced this exception was that when #2183231: Make ContentEntityDatabaseStorage generate static database schemas for content entities went in, not all content entity types were migrated to the standard table layout yet. Since core SQL entity storage is going to support dynamic switching between only 4 table layouts, we need to enforce the existence of the data table for translatable entity types. If we don't, besides needing to support more table layouts than what we need, "wrongly defined" entity types might have base fields not supporting translation even if their storage definitions say they do.

Proposed resolution

Remove that check on the existence of the data table when initializing the table layout and introduce a default value for the data table name when it is not defined in the entity type definition.

Remaining tasks

Reviews

User interface changes

None

API changes

None, this will just make things work as announced in the various change notices.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plach’s picture

Status: Active » Needs review
FileSize
4.14 KB
plach’s picture

plach’s picture

Issue tags: +language-content, +D8MI

more tags

plach’s picture

Issue summary: View changes
plach’s picture

Issue tags: +beta deadline
jhodgdon’s picture

This seems very reasonable to me. I completely agree that we should have data tables on all translatable, fieldable entities... are they needed for non-fieldable, translatable entities though?

plach’s picture

Our SQL (content) entity storage supports only fieldable entity types.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Ah, didn't know that. In that case, I think this is a good idea, and it is a very straightforward patch. All it really does is add a data table with a default name to entities that don't have this in their annotation.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 3c29af9 and pushed to 8.0.x. Thanks!

  • alexpott committed 3c29af9 on 8.0.x
    Issue #2322097 by plach: Enforce data tables for translatable entity...
Gábor Hojtsy’s picture

Issue tags: -sprint

Yay, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.