Closed (fixed)
Project:
Component variants
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2026 at 09:50 UTC
Updated:
31 Jul 2026 at 13:05 UTC
Jump to comment: Most recent
The component_variant being a ConfigEntityType is not allowed to be saved in a workspace currently.
Allow creation of variants in a workspace.
Review
None
None
None
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
ajitsCreated an MR that should fix this.
Comment #4
graber commentedLooks 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?
Comment #5
amateescu commentedUsing 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.
Comment #6
graber commentedAs 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.
Comment #8
s_leu commentedThere 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.
Comment #9
s_leu commentedComment #10
graber commentedLet'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 ;)
Comment #11
amateescu commented@graber, can you please point out exactly which is the question that you want answered. Thank you.
Comment #12
graber commentedSure, this is my concern exactly but it's in general about adding code specific to another module here:
Comment #13
amateescu commentedThe 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.Comment #14
amateescu commentedReviewed the MR, and it needs to be cleaned up a bit.
Comment #15
graber commentedAdded a few of my own. With all that handled we can land it. Thanks for reviewing and discussing on Slack @amateescu!
Comment #16
s_leu commentedComment #17
graber commentedOk, 1 thing can be a follow-up or optional but we need to handle https://git.drupalcode.org/project/component_variants/-/merge_requests/8...
Comment #18
s_leu commentedRemaining Phpstan errors are unrelated.
Comment #20
graber commentedIn. Thanks all!