- Issue created by @joachim
Drupal\Core\EventSubscriber\ConfigImportSubscriber checks the prefix of config on import, and enforces that it is the name of an enabled extension:
[$owner] = explode('.', $name, 2);
if ($owner !== 'core') {
$message = FALSE;
if (!isset($core_extension['module'][$owner]) && isset($module_data[$owner])) {
$message = $this->t('Configuration %name depends on the %owner module that will not be installed after import.', [
However, there is no similar control on saving config -- and up until I fixed it today, the documentation on config ( https://www.drupal.org/docs/develop/creating-modules/defining-and-using-... → ) said that using the module name as a prefix was only a suggestion.
This means that a module developer could create config that can't be deployed or imported:
1. Write an admin settings page in their module, saving the config in a name like substring_of_module_name.settings
2. Do a config export
3. Deploy the code to a different environment
4. Config import fails because substring_of_module_name doesn't exist
Warn developers when config is being saved that the name is incorrectly formed if the prefix is not the name of an installed extension.
Upgrade this to an exception in the next major.
@alexpott on Slack:
> We could start with a warning - and add it to an event subscriber… either in core or maybe in \Drupal\system\SystemConfigSubscriber::onConfigSave
Active
11.0 🔥
configuration system