diff -u b/core/includes/install.inc b/core/includes/install.inc --- b/core/includes/install.inc +++ b/core/includes/install.inc @@ -1046,14 +1046,9 @@ * - install: Optional parameters to override the installer: * - theme: The machine name of a theme to use in the installer instead of * Drupal's default installer theme. - * - base profile: Existence of this key denotes that the installation profile - * depends on a parent installation profile. - * - name: The shortname of the base installation profile. - * - excluded_dependencies: An array of shortnames of other modules that have - * to be excluded from the base profile requirements. This allows e.g. to - * disable a demo module that would be installed by the base profile. - * If there are no excluded_dependencies, a shortcut of "base profile: name" - * can be used. + * - base profile: The shortname of the base installation profile. Existence of + * this key denotes that the installation profile depends on a parent + * installation profile. * * Note that this function does an expensive file system scan to get info file * information for dependencies. If you only need information from the info diff -u b/core/lib/Drupal/Core/Extension/ProfileHandler.php b/core/lib/Drupal/Core/Extension/ProfileHandler.php --- b/core/lib/Drupal/Core/Extension/ProfileHandler.php +++ b/core/lib/Drupal/Core/Extension/ProfileHandler.php @@ -123,48 +123,28 @@ 'version' => NULL, 'hidden' => FALSE, 'php' => DRUPAL_MINIMUM_PHP, - 'base profile' => [ - 'name' => '', - 'excluded_dependencies' => [], - 'excluded_themes' => [], - ], + 'base profile' => '', ]; $profile_path = $this->getProfilePath($profile); $profile_file = $profile_path . "/$profile.info.yml"; $info = $this->infoParser->parse($profile_file) + $defaults; - // Normalize any base profile info. - if (is_string($info['base profile'])) { - $info['base profile'] = [ - 'name' => $info['base profile'], - 'excluded_dependencies' => [], - 'excluded_themes' => [], - ]; - } - $profile_list = []; // Get the base profile dependencies. - if ($base_profile_name = $info['base profile']['name']) { + if ($base_profile_name = $info['base profile']) { $base_info = $this->getProfileInfo($base_profile_name); $profile_list += $base_info['profile_list']; // Ensure all dependencies are cleanly merged. $info['dependencies'] = array_merge($info['dependencies'], $base_info['dependencies']); - if (isset($info['base profile']['excluded_dependencies'])) { - // Apply excluded dependencies. - $info['dependencies'] = array_diff($info['dependencies'], $info['base profile']['excluded_dependencies']); - } // Ensure there's no circular dependency. $info['dependencies'] = array_diff($info['dependencies'], [$profile]); // Ensure all themes are cleanly merged. $info['themes'] = array_unique(array_merge($info['themes'], $base_info['themes'])); - if (isset($info['base profile']['excluded_themes'])) { - // Apply excluded themes. - $info['themes'] = array_diff($info['themes'], $info['base profile']['excluded_themes']); - } + // Ensure each theme is listed only once. $info['themes'] = array_unique($info['themes']); @@ -292,7 +272,7 @@ // Remove any base profiles. foreach ($profile_list as $profile_name) { $profile_info = $this->getProfileInfo($profile_name); - if ($base_profile = $profile_info['base profile']['name']) { + if ($base_profile = $profile_info['base profile']) { unset($distributions[$base_profile]); } } diff -u b/core/lib/Drupal/Core/Extension/ProfileHandlerInterface.php b/core/lib/Drupal/Core/Extension/ProfileHandlerInterface.php --- b/core/lib/Drupal/Core/Extension/ProfileHandlerInterface.php +++ b/core/lib/Drupal/Core/Extension/ProfileHandlerInterface.php @@ -14,9 +14,7 @@ * Processing steps: * 1) Ensure default keys are set. * 2) Recursively collect dependencies from parent profiles. - * 3) Exclude dependencies explicitly mentioned in - * $info['base profile']['exclude_dependencies'] - * 4) Add the $info['profile_list'] list of dependent profiles. + * 3) Add the $info['profile_list'] list of dependent profiles. * * @param string $profile * The name of profile. diff -u b/core/profiles/testing_inherited/testing_inherited.info.yml b/core/profiles/testing_inherited/testing_inherited.info.yml --- b/core/profiles/testing_inherited/testing_inherited.info.yml +++ b/core/profiles/testing_inherited/testing_inherited.info.yml @@ -5,17 +5,11 @@ core: 8.x hidden: true -base profile: - name: testing - excluded_dependencies: - - page_cache - excluded_themes: - - classy +base profile: testing dependencies: - block - config - - syslog themes: - stable diff -u b/core/profiles/testing_inherited/tests/src/Functional/InheritedProfileTest.php b/core/profiles/testing_inherited/tests/src/Functional/InheritedProfileTest.php --- b/core/profiles/testing_inherited/tests/src/Functional/InheritedProfileTest.php +++ b/core/profiles/testing_inherited/tests/src/Functional/InheritedProfileTest.php @@ -28,13 +28,11 @@ // Check that stable is the default theme. $this->assertEquals('stable', $this->config('system.theme')->get('default')); - // Check the excluded_dependencies flag on installation profiles. + // Check that parent dependencies are installed. $this->assertTrue(\Drupal::moduleHandler()->moduleExists('config')); - $this->assertFalse(\Drupal::moduleHandler()->moduleExists('page_cache')); - // Check that all themes were installed, except excluded ones. + // Check that all themes were installed. $this->assertTrue(\Drupal::service('theme_handler')->themeExists('stable')); - $this->assertFalse(\Drupal::service('theme_handler')->themeExists('classy')); } } diff -u b/core/profiles/testing_subsubprofile/testing_subsubprofile.info.yml b/core/profiles/testing_subsubprofile/testing_subsubprofile.info.yml --- b/core/profiles/testing_subsubprofile/testing_subsubprofile.info.yml +++ b/core/profiles/testing_subsubprofile/testing_subsubprofile.info.yml @@ -8,7 +8,4 @@ -base profile: - name: testing_inherited - excluded_dependencies: - - config +base profile: testing_inherited dependencies: - - page_cache + - syslog diff -u b/core/profiles/testing_subsubprofile/tests/src/Functional/DeepInheritedProfileTest.php b/core/profiles/testing_subsubprofile/tests/src/Functional/DeepInheritedProfileTest.php --- b/core/profiles/testing_subsubprofile/tests/src/Functional/DeepInheritedProfileTest.php +++ b/core/profiles/testing_subsubprofile/tests/src/Functional/DeepInheritedProfileTest.php @@ -23,13 +23,12 @@ // Check that stable is the default theme enabled in parent profile. $this->assertEquals('stable', $this->config('system.theme')->get('default')); - // page_cache was enabled in main profile, disabled in parent and enabled - // in this profile. + // page_cache was enabled in main profile. $this->assertTrue(\Drupal::moduleHandler()->moduleExists('page_cache')); // block was enabled in parent profile. $this->assertTrue(\Drupal::moduleHandler()->moduleExists('block')); - // config was enabled in parent profile and disabled in this. - $this->assertFalse(\Drupal::moduleHandler()->moduleExists('config')); + // syslog was enabled in this profile. + $this->assertTrue(\Drupal::moduleHandler()->moduleExists('syslog')); } } diff -u b/core/tests/Drupal/KernelTests/Core/Extension/ProfileHandlerTest.php b/core/tests/Drupal/KernelTests/Core/Extension/ProfileHandlerTest.php --- b/core/tests/Drupal/KernelTests/Core/Extension/ProfileHandlerTest.php +++ b/core/tests/Drupal/KernelTests/Core/Extension/ProfileHandlerTest.php @@ -32,8 +32,7 @@ $info = $profile_handler->getProfileInfo('testing_inherited'); $this->assertNotEmpty($info); $this->assertEquals($info['name'], 'Testing Inherited'); - $this->assertEquals($info['base profile']['name'], 'testing'); - $this->assertEquals($info['base profile']['excluded_dependencies'], ['page_cache']); + $this->assertEquals($info['base profile'], 'testing'); $this->assertTrue(in_array('config', $info['dependencies'], 'config should be found in dependencies')); $this->assertFalse(in_array('page_cache', $info['dependencies'], 'page_cache should not be found in dependencies')); $this->assertTrue($info['hidden'], 'Profiles should be hidden'); @@ -50,19 +49,11 @@ $this->assertInternalType('array', $info['base profile']); $this->assertArrayHasKey('name', $info['base profile']); - $this->assertEmpty($info['base profile']['name']); - - $this->assertArrayHasKey('excluded_dependencies', $info['base profile']); - $this->assertInternalType('array', $info['base profile']['excluded_dependencies']); - $this->assertEmpty($info['base profile']['excluded_dependencies']); - - $this->assertArrayHasKey('excluded_themes', $info['base profile']); - $this->assertInternalType('array', $info['base profile']['excluded_themes']); - $this->assertEmpty($info['base profile']['excluded_themes']); + $this->assertEmpty($info['base profile']); // Tests three levels profile inheritance. $info = $profile_handler->getProfileInfo('testing_subsubprofile'); - $this->assertEquals($info['base profile']['name'], 'testing_inherited'); + $this->assertEquals($info['base profile'], 'testing_inherited'); $this->assertEquals($info['profile_list'], [ 'testing' => 'testing', 'testing_inherited' => 'testing_inherited',