diff --git a/core/modules/system/src/Tests/Update/UpdatePathTestBaseFilledTest.php b/core/modules/system/src/Tests/Update/UpdatePathTestBaseFilledTest.php index 4ccc6e7..4dceb5d 100644 --- a/core/modules/system/src/Tests/Update/UpdatePathTestBaseFilledTest.php +++ b/core/modules/system/src/Tests/Update/UpdatePathTestBaseFilledTest.php @@ -8,6 +8,7 @@ namespace Drupal\system\Tests\Update; use Drupal\node\Entity\Node; +use Drupal\node\Entity\NodeType; use Drupal\user\Entity\User; /** @@ -415,6 +416,12 @@ public function testUpdatedSite() { foreach ($expected_enabled_themes as $theme) { $this->assertTrue($this->container->get('theme_handler')->themeExists($theme), 'The "' . $theme . '" is still enabled.'); } + + // Ensure that the Book module's node type does not have duplicated enforced + // dependencies. + // @see system_post_update_fix_enforced_dependencies() + $book_node_type = NodeType::load('book'); + $this->assertEqual(['enforced' => ['module' => ['book']]], $book_node_type->get('dependencies')); } /** diff --git a/core/modules/system/system.post_update.php b/core/modules/system/system.post_update.php new file mode 100644 index 0000000..3a141ce --- /dev/null +++ b/core/modules/system/system.post_update.php @@ -0,0 +1,35 @@ +listAll() as $id) { + $config = $config_factory->get($id); + if ($config->get('dependencies.enforced') !== NULL) { + // Resave the configuration entity. + $entity = $config_manager->loadConfigEntityByName($id); + $entity->save(); + } + } + + return t('All configuration objects with enforced dependencies re-saved.'); +} + +/** + * @} End of "addtogroup updates-8.0.0-beta". + */