This is a tricky one.
At the moment Multiversion module attaches some custom but required fields (see MultiversionManager::attachRequiredFields()
) to all content entities (actually just nodes at the moment) to handle the multiversion revision system. For performance reasons we want these fields to be converted to base properties for each content entity type. This would also just make the system a lot cleaner.
The tricky part is installation order and handling changes in the entity schema when Multiversion module suddenly gets installed, e.g. we then have to go in and alter all entity schemas to add our new base properties and fill existing entities in with values for these properties in retrospective. At the moment Multiversion will break if it's installed after any entity module. We are cheating a bit to get the tests passing for now, see MultiversionWebTestBase::setUp()
.
Thankfully big parts of this problem is being solved in core at #1498720: [meta] Make the entity storage system handle changes in the entity and field schema definitions. So Multiversion will critically depend on that functionality.
In this issue we need to build a solution that removes the hack in MultiversionWebTestBase::setUp()
and generates/alters each entity schema properly with base properties instead of fields. We should rely on #1498720: [meta] Make the entity storage system handle changes in the entity and field schema definitions for this.
We will likely have to create our own ContentEntitySchemaHandler
that our multiversion\Entity\SqlContentEntityStorage
would use.
Comments
Comment #1
dixon_Comment #2
dixon_Comment #3
dixon_Looking further into this is seems like we don't need a new schema handler, since the existing one handles things nicely.
Comment #4
dixon_Comment #5
dixon_Work is going on here: https://github.com/dickolsson/drupal-multiversion/tree/2337401-base-fields
Comment #6
dixon_This is now mostly working. See work-in-progress code in this PR: https://github.com/dickolsson/drupal-multiversion/pull/2
This issue depends on two core bugs to be fixed as well:
Comment #7
dixon_Comment #8
dixon_