diff --git a/core/includes/install.inc b/core/includes/install.inc index c7e414aaa290d8715cefb8f10ba108e6c25b5659..11e4e5fa88a62f884815c98bcb8bc65d551870b6 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -11,6 +11,7 @@ use Drupal\Component\Utility\OpCodeCache; use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Extension\ExtensionDiscovery; +use Drupal\Core\Extension\ModuleHandler; use Drupal\Core\Site\Settings; /** @@ -1113,6 +1114,16 @@ function install_profile_info($profile, $langcode = 'en') { $info = \Drupal::service('info_parser')->parse("$profile_path/$profile.info.yml"); $info += $defaults; + // Convert dependencies in [project:module] format. + $info['dependencies'] = array_map(function ($dependency) { + return ModuleHandler::parseDependency($dependency)['name']; + }, $info['dependencies']); + + // Convert install key in [project:module] format. + $info['install'] = array_map(function ($dependency) { + return ModuleHandler::parseDependency($dependency)['name']; + }, $info['install']); + // drupal_required_modules() includes the current profile as a dependency. // Remove that dependency, since a module cannot depend on itself. $required = array_diff(drupal_required_modules(), [$profile]); diff --git a/core/modules/system/tests/src/Kernel/Installer/InstallerMissingDependenciesTest.php b/core/modules/system/tests/src/Kernel/Installer/InstallerDependenciesResolutionTest.php similarity index 76% rename from core/modules/system/tests/src/Kernel/Installer/InstallerMissingDependenciesTest.php rename to core/modules/system/tests/src/Kernel/Installer/InstallerDependenciesResolutionTest.php index 052c0afb80028209cb8946a9be4435181f6b2ab6..d4d4c3194a74ada27d93fba273a7cf4880c5f3f0 100644 --- a/core/modules/system/tests/src/Kernel/Installer/InstallerMissingDependenciesTest.php +++ b/core/modules/system/tests/src/Kernel/Installer/InstallerDependenciesResolutionTest.php @@ -5,11 +5,11 @@ use Drupal\KernelTests\KernelTestBase; /** - * Tests that we handle the absence of a module dependency during install. + * Tests that we handle module dependency resolution during install. * * @group Installer */ -class InstallerMissingDependenciesTest extends KernelTestBase { +class InstallerDependenciesResolutionTest extends KernelTestBase { /** * {@inheritdoc} @@ -19,7 +19,7 @@ class InstallerMissingDependenciesTest extends KernelTestBase { /** * Verifies that the exception message in the profile step is correct. */ - public function testSetUpWithMissingDependencies() { + public function testDependenciesResolution() { // Prime the drupal_get_filename() static cache with the location of the // testing profile as it is not the currently active profile and we don't // yet have any cached way to retrieve its location. @@ -32,8 +32,11 @@ public function testSetUpWithMissingDependencies() { ]); $message = $info['required_modules']['description']->render(); + $this->assertContains('Fictional', $message); $this->assertContains('Missing_module1', $message); $this->assertContains('Missing_module2', $message); + $this->assertNotContains('Block', $message); + $this->assertNotContains('Node', $message); } } diff --git a/core/profiles/testing/testing.info.yml b/core/profiles/testing/testing.info.yml index f5627e39062a8a2f1bc46a1276386afffa907bdf..9924817a3d6ff867acb34ec8ee64f6bc704c367c 100644 --- a/core/profiles/testing/testing.info.yml +++ b/core/profiles/testing/testing.info.yml @@ -7,7 +7,7 @@ hidden: true install: # Enable page_cache and dynamic_page_cache in testing, to ensure that as many # tests as possible run with them enabled. - - page_cache + - drupal:page_cache - dynamic_page_cache # @todo: Remove this in https://www.drupal.org/node/2352949 themes: diff --git a/core/profiles/testing_missing_dependencies/testing_missing_dependencies.info.yml b/core/profiles/testing_missing_dependencies/testing_missing_dependencies.info.yml index fe475b3be2d24e6dce16ab2bbf5aeb98570bc443..5532efdb7adf541a8296017fa7143e16a5dcc86c 100644 --- a/core/profiles/testing_missing_dependencies/testing_missing_dependencies.info.yml +++ b/core/profiles/testing_missing_dependencies/testing_missing_dependencies.info.yml @@ -5,6 +5,9 @@ version: VERSION core: 8.x hidden: true install: + - block + - drupal:node + - drupal:fictional - missing_module1 - missing_module2 keep_english: true