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

  1. Install a module that provides a content entity which is either no publishable or revisionable
  2. Switch to a non live workspace
  3. 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

Command icon 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

s_leu created an issue. See original summary.

amateescu’s picture

Status: Active » Fixed

Merged into 1.0.x, thanks!

Status: Fixed » Closed (fixed)

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