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.

s_leu made their first commit to this issue’s fork.

s_leu’s picture

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

There were lots of changes in the workspaces ecosystem since this Issue/PR was filed. The latest changes pushed in the PR reflect those and integrate config variants with workspace_config.

s_leu’s picture

Status: Needs review » Postponed (maintainer needs more info)
Related issues: +#3593888: Integrate component_variant config entity type
graber’s picture

Let's give it 2 months since now, if no one will answer to #6, we can close this one with the "Nobody cares anymore" status ;)

amateescu’s picture

@graber, can you please point out exactly which is the question that you want answered. Thank you.

graber’s picture

Sure, this is my concern exactly but it's in general about adding code specific to another module here:

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.

amateescu’s picture

The latest MR doesn't add "code specific to another module" anymore, it implements a hook provided by the workspace_config (contrib) module. That's the designed integration point between config entities and workspaces.

amateescu’s picture

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

Reviewed the MR, and it needs to be cleaned up a bit.

graber’s picture

Added a few of my own. With all that handled we can land it. Thanks for reviewing and discussing on Slack @amateescu!

s_leu’s picture

Status: Needs work » Needs review
graber’s picture

Status: Needs review » Needs work

Ok, 1 thing can be a follow-up or optional but we need to handle https://git.drupalcode.org/project/component_variants/-/merge_requests/8...

s_leu’s picture

Status: Needs work » Needs review

Remaining Phpstan errors are unrelated.

  • graber committed 3cccf063 on 1.0.x authored by ajits
    feat: #3579963 Support workspaces with component variants
    
graber’s picture

Status: Needs review » Fixed

In. Thanks all!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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