Problem/Motivation

The current code in WseConfigDatabaseStorage::readMultiple is proceeding to call WseConfigDatabaseStorage::getOverriddenNames even if all the read config is ignored. This is problematic and may lead to infinite loops in case another module is reading config in any code that alters queries for example.

It currently happens for example when wse_config and trash are enabled at the same time because trash is reading a config in TrashManager::isEntityTypeEnabled which is called somewhere after WseConfigDatabaseStorage::getOverriddenNames.

Steps to reproduce

  • Enable the Trash module on a Drupal project with WSE/Workspaces
  • Navigate to workspace settings at /admin/config/workflow/workspaces/settings, select some additional config entity types (see screenshot attached below) and save.
  • Navigate to home
  • Create a new workspace via clicking on the admin toolbar's workspace tab, then clicking + Add new workspace and submitting the modal form that pops up with any workspace name
  • Observe: infinite loop and memory exhausted errors due to that

Proposed resolution

Don't proceed loading overrides when all read configs are ignored in wse_config.

Remaining tasks

Write test

Issue fork wse-3584100

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

Title: Avoid reading config if everything read configs are ignored » Don't read wse config if all requested configs are ignored
s_leu’s picture

Component: Code » Workspace Config
Status: Active » Needs review

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

  • amateescu committed 1b2ee8c0 on 3.0.x authored by s_leu
    fix: #3584100 Don't read wse config if all requested configs are ignored...
amateescu’s picture

Status: Needs review » Fixed

Converted the new test to a kernel one, and merged. Thanks!

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.