Problem/Motivation
It’s currently not possible to add entities which are not publishable and "revisionable" inside workspaces without applying corresponding changes to an entity type.
This is caused by WorkspaceManager::isEntityTypeSupported() which is gets called from EntityReferenceSupportedNewEntitiesConstraintValidator::validate() .
It would be great to have a simpler way to allow certain entity types to be created inside workspaces. In the long run workspaces should also adopt a concept of EntityTypeIsIgnored instead of EntityTypeIsSupported.
Steps to reproduce
- Install a module that provides a content entity which is either no publishable or revisionable
- Switch to a non live workspace
- Try to create an entity of the type mentioned in step 1
Proposed resolution
For now override the validation constraint and its corresponding validator plugin and assign them in hook_field_info_alter(), dropping the validation constraint set by core workspaces.
Issue fork wse-3259701
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
amateescu commentedMerged into 1.0.x, thanks!