Last active
July 7, 2021 12:13
-
-
Save podarok/3c14521da12ad73fa08fe3ec0a237a28 to your computer and use it in GitHub Desktop.
features_hook.diff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/features.module b/features.module | |
index 07e2740..7d061b2 100644 | |
--- a/features.module | |
+++ b/features.module | |
@@ -48,10 +48,12 @@ function features_file_download($uri) { | |
/** | |
* Implements hook_modules_installed(). | |
*/ | |
-function features_modules_installed($modules) { | |
- if (!in_array('features', $modules)) { | |
- /** @var \Drupal\features\FeaturesAssignerInterface $assigner */ | |
- $assigner = \Drupal::service('features_assigner'); | |
- $assigner->purgeConfiguration(); | |
+function features_modules_installed($modules, $is_syncing) { | |
+ if (!$is_syncing && !in_array('features', $modules)) { | |
+ if (!empty(\Drupal::hasService('features_assigner'))) { | |
+ /** @var \Drupal\features\FeaturesAssignerInterface $assigner */ | |
+ $assigner = \Drupal::service('features_assigner'); | |
+ $assigner->purgeConfiguration(); | |
+ } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment