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

  1. Enable the wse_config module
  2. Switch to the Stage workspace
  3. Head to /admin/structure/views
  4. 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

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.

s_leu’s picture

Status: Active » Needs review

  • amateescu committed 8951947 on 1.0.x authored by s_leu
    Issue #3312821: Implemented hook_entity_access() to prevent fatal error...
amateescu’s picture

Status: Needs review » Fixed

Merged, thanks!

Status: Fixed » Closed (fixed)

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

amateescu’s picture

Component: Code » Workspace Config
Issue tags: -Workspace config