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.
Comment | File | Size | Author |
---|---|---|---|
#1 | entity-data_table_required-2322097-1.patch | 4.14 KB | plach |
Comments
Comment #1
plachComment #2
plachComment #3
plachComment #4
plachmore tags
Comment #5
plachComment #6
plachComment #7
jhodgdonThis 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?
Comment #8
plachOur SQL (content) entity storage supports only fieldable entity types.
Comment #9
jhodgdonAh, 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.
Comment #10
alexpottCommitted 3c29af9 and pushed to 8.0.x. Thanks!
Comment #12
Gábor HojtsyYay, thanks!