- 🇫🇷France ericdsd France
Hi i missed your comment, i'll test your suggestion then Thanks.
- 🇫🇷France ericdsd France
Thanks, switching from directory to collection works like a charm.
This should probably be explained in module documentation. - 🇨🇭Switzerland bircher 🇨🇿
You are right!
Feel welcome to update the documentation directly! Missing documentation is one of the last things holding up the 2.0.0 release.
See 📌 Update documentation for Config Split 2.x Active @bircher There seems to be one major drawback to using Collections, and that is that "when you switch to a different environment and export, it deletes the previously exported collections that aren't active.".
This makes it impossible to maintain all splits for all environments in source control (GIT), which seems to make the idea of being able to enable different splits for different environments redundant.
One export on a developer's local machine which has local developer split settings enabled will completely delete and remove from source control, the splits for TEST, STAGING and PRODUCTION environments.
Am I missing something here?
We also would like to be given some feedback / CLI output during a drush config-export to show the developer that changes to split files will be made, but changing from 'Folder' method to 'Collection' method does not seem to be the solution if it has this described limitation.
- 🇨🇭Switzerland bircher 🇨🇿
@martybfly I think the problem is how you "switch to a different environment"
The reason it works with folders the way you do it is because the non active folders are not touched at all, but that could also lead to configuration you had being lost or exported to the main sync directory when it should have gone to the folder.
In Config Split 2 I introduced the difference between activating and enabling and deactivating and disabling.
Switching environments should be done by deactivating one and activating the other, and not just enabling and disabling splits.
It gets further complicated because you could do that in the following way in Config Split 1 (which still works in Config Split 2 as well)- export config
- change what splits are active (in settings.php for 1.x and 2.x , or via state override in 2.)
- import config
how collections work is that the config of the active split is the active config and when exported it goes into a collection, when imported it goes in the active one. For inactive splits the collection gets imported, and when you export it gets exported untouched.
Your problem is that you do not deactivate the previous environment, and so it never goes from the active config to the collection inside the active config store and so when you export the config the collection gets removed.TLDR: deactivate the environment you are switching from (do not use settings.php to determine which environment is active but use state override)