Exception thrown from WSE Config

Created on 16 December 2024, 6 days ago

Problem/Motivation

An exception is thrown when you save a block config entity if you have not visited the workspace config page and pressed save.

Steps to reproduce

  1. Install standard
  2. Enable wse_config and workspaces_ui
  3. Activate the stage workspace
  4. Go to admin/structure/block/manage/olivero_site_branding - press save
The website encountered an unexpected error. Try again later.

RuntimeException: The "block" entity type can only be saved in the default workspace. in Drupal\workspaces\EntityOperations->entityPresave() (line 133 of core/modules/workspaces/src/EntityOperations.php).
Drupal\workspaces\Hook\WorkspacesHooks->entityPresave(Object, 'block')
call_user_func_array(Array, Array) (Line: 355)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Array, 'workspaces') (Line: 307)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_presave', Object) (Line: 354)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_presave', Array) (Line: 325)
Drupal\Core\Config\Entity\ConfigEntityStorage->invokeHook('presave', Object) (Line: 529)
Drupal\Core\Entity\EntityStorageBase->doPreSave(Object) (Line: 483)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 239)
Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object) (Line: 354)
Drupal\Core\Entity\EntityBase->save() (Line: 617)
Drupal\Core\Config\Entity\ConfigEntityBase->save() (Line: 293)
Drupal\Core\Entity\EntityForm->save(Array, Object) (Line: 350)
Drupal\block\BlockForm->save(Array, Object)

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Workspace Config

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @alexpott
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    This happens for any config entity type that you edit why a workspace is active. I think we need to prevent access or something neater than thrown an exception.

  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    Relatedly and conversely whe you edit simple configuration that's not supported - for example workspaces.settings on admin/config/workflow/workspaces/settings when you are in a workspace it'll save and make immediate changes to the live config, which feels at best quite inconsistent.

Production build 0.71.5 2024