diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 568fe20..8d27e08 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1273,13 +1273,12 @@ function install_select_profile(&$install_state) { function _install_select_profile(&$install_state) { // Don't need to choose profile if only one available. if (count($install_state['profiles']) == 1) { - $profile = reset($install_state['profiles']); - return $profile->getName(); + return key($install_state['profiles']); } if (!empty($install_state['parameters']['profile'])) { $profile = $install_state['parameters']['profile']; if (isset($install_state['profiles'][$profile])) { - return $install_state['profiles'][$profile]->getName(); + return $profile; } } // Check for a distribution profile. diff --git a/core/includes/install.inc b/core/includes/install.inc index f8b8daf..4b5466d 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -95,16 +95,19 @@ function drupal_load_updates() { function drupal_install_profile_distribution_name() { // During installation, the profile information is stored in the global // installation state (it might not be saved anywhere yet). + $info = array(); if (drupal_installation_attempted()) { global $install_state; - return isset($install_state['profile_info']['distribution']['name']) ? $install_state['profile_info']['distribution']['name'] : 'Drupal'; + if (isset($install_state['profile_info'])) { + $info = $install_state['profile_info']; + } } // At all other times, we load the profile via standard methods. else { $profile = drupal_get_profile(); $info = system_get_info('module', $profile); - return $info['distribution']['name']; } + return isset($info['distribution']['name']) ? $info['distribution']['name'] : 'Drupal'; } /** @@ -1046,14 +1049,19 @@ function drupal_check_module($module) { * Additional, less commonly-used information that can appear in a * profile.info.yml file but not in a normal Drupal module .info.yml file * includes: - * - distribution: Existence of this key denotes that the install profile is - * intended to be the only eligible choice in a distribution and will be + * + * - distribution: Existence of this key denotes that the installation profile + * is intended to be the only eligible choice in a distribution and will be * auto-selected during installation, whereas the installation profile * selection screen will be skipped. If more than one distribution profile is - * found then the first discovered one will be selected. + * found then the first one discovered will be selected. * The following subproperties may be set: - * - name: The name of the Drupal distribution that is being installed, to be - * shown throughout the installation process. Defaults to 'Drupal'. + * - name: The name of the distribution that is being installed, to be shown + * throughout the installation process. If omitted, + * drupal_install_profile_distribution_name() defaults to 'Drupal'. + * - 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. * * 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 --git a/core/modules/system/system.module b/core/modules/system/system.module index 1ee7add..65a8796 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1425,8 +1425,9 @@ function _system_rebuild_module_data() { if ($profile && isset($modules[$profile])) { // The installation profile is required, if it's a valid module. $modules[$profile]->info['required'] = TRUE; - // Add a default distribution name if the profile did not provide one. This - // matches the default value used in install_profile_info(). + // Add a default distribution name if the profile did not provide one. + // @see install_profile_info() + // @see drupal_install_profile_distribution_name() if (!isset($modules[$profile]->info['distribution']['name'])) { $modules[$profile]->info['distribution']['name'] = 'Drupal'; }