Config split error

Created on 15 December 2023, 7 months ago
Updated 17 June 2024, 13 days ago

Problem/Motivation

I am using config split in the Collection mode instead of the Folder mode (as shown in attached screenshot)

If I use config_auto_export and I save some configuration then I get an error message.

The website encountered an unexpected error. Please try again later.

Drupal\Core\File\Exception\NotRegularDirectoryException: is not a directory. in Drupal\Core\File\FileSystem->scanDirectory() (line 668 of core/lib/Drupal/Core/File/FileSystem.php).
Drupal\config_auto_export\ConfigSubscriber->readConfigSplitFiles() (Line: 219)
Drupal\config_auto_export\ConfigSubscriber->findInConfigSplit('system.site') (Line: 236)
Drupal\config_auto_export\ConfigSubscriber->onConfigSave(Object, 'config.save', Object)
call_user_func(Array, Object, 'config.save', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'config.save') (Line: 229)
Drupal\Core\Config\Config->save() (Line: 208)
Drupal\system\Form\SiteInformationForm->submitForm(Array, Object)

This is caused, I suppose, by the readConfigSplitFiles method that does not take into account config slit Collections.

Steps to reproduce

- Configure a config split to use the Collection mode
- Enable config_auto_export
- Submit a config form e.g. /admin/config/system/site-information

I have too little knowledge of the config split module to propose a solution.

Many thanks for the great module.

πŸ“Œ Task
Status

Active

Version

2.2

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands batigolix Utrecht

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

Comments & Activities

  • Issue created by @batigolix
  • Assigned to jurgenhaas
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Thanks @batigolix for reporting this. We've never used collections for this ourselves, so that's why we've missed it during implementation. I'll assign it to myself and hope to find some time to look into this.

  • πŸ‡³πŸ‡±Netherlands batigolix Utrecht

    Thanks @jurgenhaas for the feedback.

    I'd like to add that for me this has very low priority. I could even switch back Config Split to the other storage mode.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    I've looked into this, and it turns out that we're polling all the config split directories to find out which config entity belongs to which split. That fails when you configured a new split but never exported that. That's why the directory doesn't exist yet.

    There must be another way to find out, whether a config entity belongs to a split and to which. I've raised that question in πŸ’¬ API question: find split for given config entity Active and need to wait for their feedback.

  • Issue was unassigned.
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Unfortunately, it is not that simple, to find out to which collection a config entity belongs to. Without that knowledge, CAE can't really do its job. So, I guess we're down to only supporting collections where the config entity file already exists in the collection's storage.

    For more details, please refer to the related issue.

Production build 0.69.0 2024