diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php index c61ba6c..c61e5d0 100644 --- a/core/lib/Drupal/Core/Extension/ModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php @@ -905,6 +905,9 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) { module_load_install($module); $this->invoke($module, 'uninstall'); + // Remove all configuration belonging to the module. + \Drupal::service('config.manager')->uninstall('module', $module); + // Remove any entity schemas belonging to the module. $entity_manager = \Drupal::entityManager(); $schema = \Drupal::database()->schema(); @@ -921,9 +924,6 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) { } } - // Remove all configuration belonging to the module. - \Drupal::service('config.manager')->uninstall('module', $module); - // Remove the schema. drupal_uninstall_schema($module); diff --git a/core/tests/Drupal/Tests/Core/Entity/Schema/ContentEntitySchemaHandlerTest.php b/core/tests/Drupal/Tests/Core/Entity/Schema/ContentEntitySchemaHandlerTest.php index 8511623..1b1891d 100644 --- a/core/tests/Drupal/Tests/Core/Entity/Schema/ContentEntitySchemaHandlerTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/Schema/ContentEntitySchemaHandlerTest.php @@ -73,7 +73,9 @@ public static function getInfo() { public function setUp() { $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); $this->entityType = $this->getMock('Drupal\Core\Entity\ContentEntityTypeInterface'); - $this->storage = $this->getMock('Drupal\Core\Entity\ContentEntityDatabaseStorage'); + $this->storage = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityDatabaseStorage') + ->disableOriginalConstructor() + ->getMock(); // Set up basic expectations that apply to all tests. $this->entityType->expects($this->any())