Problem/Motivation

The methods WseConfigDatabaseStorage::listAll() and WseConfigDatabaseStorage::getAllCollectionNames() are joining the values of the inner storage with the workspace storage using += operator. This is wrong because the return values are numeric arrays and using += will overwrite existing keys read from the wse storage.

Steps to reproduce

On Vanilla Drupal 9:

  1. Enable wse_config and asset_injector modules
  2. Create 2 asset injector CSS configs in the live workspace
  3. Switch to the stage workspace and create another asset injector CSS config
  4. Navigate to /admin/config/development/asset-injector/css (still inside the stage workspace) and see only 2 configs instead of the expected 3 (2 of the live workspace + 1 created in the stage workspace)

Proposed resolution

Use array_merge() instead of the += operator to preserve keys when joining the lists.

Issue fork wse-3283735

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 made their first commit to this issue’s fork.

  • amateescu committed 85ac5d9 on 1.0.x authored by s_leu
    Issue #3283735: Workspace config: Wrong array concatenation in listAll...
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