Alert developers if the config split folder is not correctly configured

Created on 21 September 2023, over 1 year ago
Updated 19 October 2023, over 1 year ago

Problem/Motivation

When a split is configured to use folder storage, but no path has been set, this leads to an unhelpful error message:

TypeError: Drupal\config_split\ConfigSplitManager::singleImportOrActivate(): Argument #2 ($storage) must be of type Drupal\Core\Config\StorageInterface, null given

While it is the developer's responsibility to set up a correct configuration, it would be nice to point out exactly what is wrong.

Steps to reproduce

  1. Configure a split to use folder storage, but set the folder path to an empty string.
  2. Activate the split.

Proposed resolution

We can introduce an assert() that checks whether the path is configured. This is a low impact improvement which will show up only on developer environments, as opposed to introducing an exception which is technically an API change.

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇧🇬Bulgaria pfrenssen Sofia

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

Comments & Activities

Production build 0.71.5 2024