diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 2db037ecec..803299af70 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -847,18 +847,22 @@ function install_tasks($install_state) { // Now add any tasks defined by the installation profile. if (!empty($install_state['parameters']['profile'])) { - // Load the profile install file, because it is not always loaded when - // hook_install_tasks() is invoked (e.g. batch processing). - $profile = $install_state['parameters']['profile']; - $profile_install_file = $install_state['profiles'][$profile]->getPath() . '/' . $profile . '.install'; - if (file_exists($profile_install_file)) { - include_once \Drupal::root() . '/' . $profile_install_file; - } - $function = $install_state['parameters']['profile'] . '_install_tasks'; - if (function_exists($function)) { - $result = $function($install_state); - if (is_array($result)) { - $tasks += $result; + $profiles = \Drupal::service('extension.list.profile')->getAncestors($install_state['parameters']['profile']); + foreach (array_keys($profiles) as $profile_name) { + $profile = $install_state['profiles'][$profile_name]; + // Load the profile install file, because it is not always loaded when + // hook_install_tasks() is invoked (e.g. batch processing). + $profile_install_file = $profile->getPath() . '/' . $profile_name . '.install'; + if (file_exists($profile_install_file)) { + include_once \Drupal::root() . '/' . $profile_install_file; + } + // If this is a base profile then the profile isn't loaded + $function = $profile_name . '_install_tasks'; + if (function_exists($function)) { + $result = $function($install_state); + if (is_array($result)) { + $tasks += $result; + } } } } @@ -876,11 +880,13 @@ function install_tasks($install_state) { // Allow the installation profile to modify the full list of tasks. if (!empty($install_state['parameters']['profile'])) { - $profile = $install_state['parameters']['profile']; - if ($install_state['profiles'][$profile]->load()) { - $function = $install_state['parameters']['profile'] . '_install_tasks_alter'; - if (function_exists($function)) { - $function($tasks, $install_state); + $profiles = \Drupal::service('extension.list.profile')->getAncestors($install_state['parameters']['profile']); + foreach (array_keys($profiles) as $profile_name) { + if ($install_state['profiles'][$profile_name]->load()) { + $function = $profile_name . '_install_tasks_alter'; + if (function_exists($function)) { + $function($tasks, $install_state); + } } } } @@ -1522,7 +1528,9 @@ function _install_get_version_info($version) { */ function install_load_profile(&$install_state) { $profile = $install_state['parameters']['profile']; - $install_state['profiles'][$profile]->load(); + foreach (array_keys(\Drupal::service('extension.list.profile')->getAncestors($profile)) as $profile_id) { + $install_state['profiles'][$profile_id]->load(); + } $install_state['profile_info'] = install_profile_info($profile, isset($install_state['parameters']['langcode']) ? $install_state['parameters']['langcode'] : 'en'); $sync_directory = Settings::get('config_sync_directory');