Problem/Motivation

The component_variant being a ConfigEntityType is not allowed to be saved in a workspace currently.

Steps to reproduce

  • Create a workspace
  • Try to create a component variant

Proposed resolution

Allow creation of variants in a workspace.

Remaining tasks

Review

User interface changes

None

API changes

None

Data model changes

None

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

ajits created an issue. See original summary.

ajits’s picture

Issue summary: View changes
Status: Active » Needs review

Created an MR that should fix this.

graber’s picture

Status: Needs review » Postponed (maintainer needs more info)

Looks like it's introducing a hard dependency, we don't want that. How is it solved for other config entity types in Drupal core and contrib modules?

amateescu’s picture

Status: Postponed (maintainer needs more info) » Needs review

Using that handler class is not a hard dependency, if the Workspaces module is not installed the additional handler is simply not used/instantiated.

What we need to consider instead is whether these config entities should be tracked in the workspace they're being changed in. Is there an intended use case to create or edit component variants in a workspace? If so, the wse_config module (part of www.drupal.org/project/wse) needs to be used.

If not, this MR is enough.

graber’s picture

Status: Needs review » Postponed (maintainer needs more info)

What we need to consider instead is whether these config entities should be tracked in the workspace they're being changed in. Is there an intended use case to create or edit component variants in a workspace? If so, the wse_config module (part of www.drupal.org/project/wse) needs to be used.

As long as there are no such issues in the queue - no.

Ok, it's not a hard dependency indeed but still.. we add code specific to another module. If we continue going this way, in a year or 2 we'll have more of such third party code that accommodates something else that is completely optional, and that's not the right way to go.

I think we need a better understanding of the issue, many of other contrib modules also define config entity types (https://git.drupalcode.org/project/message/-/blob/8.x-1.x/src/Entity/Mes...), core itself defines config entity types (https://git.drupalcode.org/project/drupal/-/blob/main/core/modules/block...) and I don't see any Workspaces-specific entries in the entity type declarations.

Please do proper investigation, otherwise patching locally may be your only option if you don't have time.