Problem/Motivation
#2666808: Add a revisionable entity base class and log interface introduced three revision metadata fields, which are named "revision_created, revision_user, revision_log_message". However the core still assumes at some places that they are called "revision_timestamp, revision_uid, revision_log". That is the case where the node entity and the block entity use the previous nomenclature. But unfortunately this is not the only place.. There is one another really important place and it is in SqlContentEntityStorage::getTableMapping where the only the old nomenclature is used to put these revision metadata fields in the "entity_type_id_revision" table. #2666808: Add a revisionable entity base class and log interface did not extend the list with the new revision metadata fields and what now happens is that if you use the new RevisionLogEntityTrait your revision metadata fields will not be put like they should in the "entity_type_id_revision" table, but they will be put in the field table.
Proposed resolution
Extend the list in SqlContentEntityStorage::getTableMapping with the new three revision metadata fields.
Remaining tasks
Discuss if it should be added in 8.1.x or in 8.2.x and if we need an update mechanism...
User interface changes
none.
API changes
The revision metadata fields from the RevisionLogEntityTrait now will be put in the "entity_type_id_revision" table instead in the field table.
Data model changes
none.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2732699-2.patch | 1.03 KB | hchonov |
Comments
Comment #2
hchonovComment #3
hchonovComment #4
dawehnerLooks fair, its a bit sad that we don't automatically detect those fields but rather hardcode it.
Does this changes the table scheme aka. we need some form of update path?
Comment #5
hchonovYes, we'll need an update path as those revision metadata fields would now be in the field table for entities using the RevisionLogEntityTrait and they should be moved to the entity_type_id_revision table.
Comment #6
hchonovClosing as the update path should be implemented in #2248983: Define the revision metadata base fields in the entity annotation in order for the storage to create them only in the revision table.