Optional configuration not installed as expected at site install time
Configuration in config/optional
is not installed as expected at site install time.
We tried a workaround: manually edit exported configuration to add a dependency on one of our feature modules. This indeed triggers config installation, but it leaves the config item in a state where it shows as "changed" in features, and the item needs to be manually edited again the next time it's exported.
This issue seems to be limited to site install time, perhaps due to a caching issue. When installing the relevant modules post-install, the optional config is installed as expected.
A possible fix would be: at the end of the site installation, run \Drupal::service('config.installer')->installOptionalConfig()
. Calling the method without arguments should trigger installation of all optional config for which the dependencies are met.