- Issue created by @boobaa
- 🇭🇺Hungary mxr576 Hungary
After some investigation I think the major difference between 2.x and 1.x that 2.x is now uses an event subscriber for importing splitted configurations (https://git.drupalcode.org/project/config_split/-/blob/2.0.0/src/EventSu...) but 1.x used to do the same via integrating with Config Filter (https://git.drupalcode.org/project/config_split/-/blob/8.x-1.9/src/Plugi...) and Config Filter 1.x used to override the config storage in service container compilation time (https://git.drupalcode.org/project/config_filter/-/blob/8.x-1.x/src/Conf...) but it also uses an event subscriber in Config Filter 2.x (https://git.drupalcode.org/project/config_filter/-/blob/8.x-2.x/src/Conf...).
The Config Split 2.x even subscriber also has a could be relevant comment:
// Unfortunately we can not load the existing splits from the drupal because // the subscribed events is compiled into the container in a compiler pass // and at that point we can not access the container yet of course.
So probably what should be double checked is which version of Config Filter was installed in these configurations:
drupal/core:10.1.8 with drupal/config_split:1.9.0 AND drupal/config_ignore:2.4.0 – PASS (as the original starting point of the investigation);
drupal/core:10.1.8 with drupal/config_split:1.9.0 AND drupal/config_ignore:3.2.0 – FAIL (actually, this is how the problem was spotted first), which is really weird, because:So maybe... maybe... leveraging events for this will turn out to be an insufficient solution.
- 🇭🇺Hungary boobaa
In cases of drupal/core:10.1.8 with drupal/config_split:1.9.0, drupal/config_filter:1.12.0 was used, because that's the latest version of it anyway, and drupal/config_split:1.9.0 depends on drupal/config_filter:^1.
- 🇭🇺Hungary mxr576 Hungary
Added the issue where config ignore switched to the new approach.
- 🇭🇺Hungary mxr576 Hungary
Added related config split issue that swtiched to event subscribers.
- 🇨🇭Switzerland bircher 🇨🇿
Hi, thanks for digging into this. The real reason is a bug in core I just filed: 🐛 Dispatch config transformation event during site install from configuration Active
The workaround for now is to import the configuration right after the drupal site install.
But even when the core issue is addressed Config Split will only get to participate in the second configuration import because it is a module that needs to be installed before it can be used. This is something I am considering addressing for a future version when config split is split into a module and a php library that is available also without being installed. But that is way off topic for now. - 🇨🇭Switzerland bircher 🇨🇿
If you patch drupal core with 🐛 Dispatch config transformation event during site install from configuration Active
and you add the following to your settings.php it will work as expected:
// Make config split available before it is installed. $class_loader->addPsr4('Drupal\\config_split\\', [ __DIR__ . '/../../modules/contrib/config_split/src']); $settings['container_yamls'][] = DRUPAL_ROOT . '/modules/contrib/config_split/config_split.services.yml';
- 🇮🇱Israel heyyo Jerusalem
I tested #7 unfortunatly I got an error with webprofiler installation which is in my local config split.
[error] Error: Interface "Drupal\views\Plugin\views\query\CastSqlInterface" not found in include() (line 10 of /var/www/html/web/core/modules/mysql/src/Plugin/views/query/MysqlCastSql.php) #0 /var/www/html/vendor/composer/ClassLoader.php(576): include() #1 /var/www/html/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}() #2 [internal function]: Composer\Autoload\ClassLoader->loadClass() #3 /var/www/html/web/modules/contrib/webprofiler/src/Compiler/ServicePass.php(76): ReflectionClass->__construct()