Problem/Motivation
There is currently possible no access restrictions for delete operations on config entities inside a workspace if wse_config is active. As a result it is currently possible to attempt a deletion of a config entity, which is not overridden and active in live. The operation will fail because WseConfigDatabaseStorage::delete() won't find a wse_config entity to delete.
Steps to reproduce
On Vanilla Drupal 9.5.x
- Enable the wse_config module
- Switch to the Stage workspace
- Head to /admin/structure/views
- Try to delete any view
The following error will be thrown:
Error: Call to a member function delete() on bool in Drupal\wse_config\WseConfigDatabaseStorage->delete() (line 227 of modules/contrib/wse/modules/wse_config/src/WseConfigDatabaseStorage.php
Proposed resolution
As a first step, we should disallow the delete operation in case of config entities that are not overridden inside a workspace. In a next step and followup, it would be great to actually support removal of active config inside a workspace and then deploy these removals when the workspace gets published.
Issue fork wse-3312821
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
s_leu commentedComment #5
amateescu commentedMerged, thanks!
Comment #7
amateescu commented