- Issue created by @pbabin
- Merge request !42Add if statement if destination and transformation storage is empty β (Open) created by pbabin
We have a crazy multisite single codebase situation where we lock down what is ignored in all of our sites through a config override. This has worked for us when we install the our config_override system in our host and then uninstall the package when we pull our databases locally. We're moving to have this functionality always on; however, when we run drush cim
in this new setup we are not ignoring everything that needs to be ignored.
I initially explored "
Use ignore settings of the target storage if the config ignore config is ignored
π
Use ignore settings of the target storage if the config ignore config is ignored
Needs work
" as a possible solution; however, in trying to create a patch our situation appears to be different. Neither the $transformation_storage
nor $destination_storage
variables passed to the transformStorage()
function in ConfigIgnoreEventSubscriber have values so we aren't using the target storage (yes, we are ignoring the config_ignore.settings as well in our override) which separates our issues from the above referenced issue.
Line 141 of the ConfigIgnoreEventSubscriber has the following:
if ($transformation_storage->exists('config_ignore.settings'))
and this always results to true for us with our config setup.
Adding the following addresses this particular use case:
if (empty($destination_storage->getAllCollectionNames()) && empty($transformation_storage->getAllCollectionNames())) {
$ignoreConfig = ConfigIgnoreConfig::fromConfig($this->configFactory->get('config_ignore.settings'));
} elseif ($transformation_storage->exists('config_ignore.settings'))
Merge request to follow shortly.
@bircher - if this is a valid proposal, I'm still relatively new to Drupal coding and tests are one of my weaknesses. I understand that a test will be needed and I'd greatly appreciate a high level clue of how to create a test for this use case similar to this comment you made π Use ignore settings of the target storage if the config ignore config is ignored Needs work a few months ago which was extremely helpful for me to diagnose this issue.
Active
3.0
Code