From bb293ccfb5193d2f769af6a8422765784c205536 Mon Sep 17 00:00:00 2001 From: Angie Byron <webchick@24967.no-reply.drupal.org> Date: Mon, 4 Jan 2010 23:08:34 +0000 Subject: [PATCH] #420358 follow-up by Dave Reid: Rename profiles default => standard and expert => minimal, for consistency with labels. --- includes/common.inc | 4 ++-- install.php | 24 +++++++++---------- modules/simpletest/drupal_web_test_case.php | 11 ++++----- modules/system/system.install | 9 +++++++ modules/system/system.module | 4 ++-- .../expert.info => minimal/minimal.info} | 2 +- .../minimal.install} | 4 +--- .../minimal.profile} | 2 +- .../default.info => standard/standard.info} | 2 +- .../standard.install} | 2 +- .../standard.profile} | 2 +- 11 files changed, 36 insertions(+), 30 deletions(-) rename profiles/{expert/expert.info => minimal/minimal.info} (85%) rename profiles/{expert/expert.install => minimal/minimal.install} (98%) rename profiles/{expert/expert.profile => minimal/minimal.profile} (73%) rename profiles/{default/default.info => standard/standard.info} (95%) rename profiles/{default/default.install => standard/standard.install} (99%) rename profiles/{default/default.profile => standard/standard.profile} (82%) diff --git a/includes/common.inc b/includes/common.inc index 70c2f902450d..b6b315b6e83b 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -228,7 +228,7 @@ function drupal_get_profile() { $profile = $install_state['parameters']['profile']; } else { - $profile = variable_get('install_profile', 'default'); + $profile = variable_get('install_profile', 'standard'); } return $profile; @@ -4381,7 +4381,7 @@ function drupal_json_encode($var) { * Converts an HTML-safe JSON string into its PHP equivalent. * * @see drupal_json_encode() - * @ingroup php_wrappers + * @ingroup php_wrappers */ function drupal_json_decode($var) { // json_decode() does not unescape <, > and &, so we do it with str_replace(). diff --git a/install.php b/install.php index f502272ed3a6..9ccb90d23d7f 100644 --- a/install.php +++ b/install.php @@ -909,7 +909,7 @@ function install_settings_form($form, &$form_state, &$install_state) { ); // Table prefix - $db_prefix = ($profile == 'default') ? 'drupal_' : $profile . '_'; + $db_prefix = ($profile == 'standard') ? 'drupal_' : $profile . '_'; $form['advanced_options']['db_prefix'] = array( '#type' => 'textfield', '#title' => st('Table prefix'), @@ -973,7 +973,7 @@ function install_database_errors($database, $settings_file) { try { db_run_tasks($database['driver']); - } + } catch (DatabaseTaskException $e) { // These are generic errors, so we do not have any specific key of the // database connection array to attach them to; therefore, we just put @@ -1094,7 +1094,7 @@ function install_select_profile_form($form, &$form_state, $profile_files) { foreach ($profile_files as $profile) { // TODO: is this right? include_once DRUPAL_ROOT . '/' . $profile->uri; - + $details = install_profile_info($profile->name); $profiles[$profile->name] = $details; @@ -1107,24 +1107,24 @@ function install_select_profile_form($form, &$form_state, $profile_files) { // Display radio buttons alphabetically by human-readable name, but always // put the core profiles first (if they are present in the filesystem). natcasesort($names); - if (isset($names['expert'])) { + if (isset($names['minimal'])) { // If the expert ("Minimal") core profile is present, put it in front of // any non-core profiles rather than including it with them alphabetically, // since the other profiles might be intended to group together in a // particular way. - $names = array('expert' => $names['expert']) + $names; + $names = array('minimal' => $names['minimal']) + $names; } - if (isset($names['default'])) { + if (isset($names['standard'])) { // If the default ("Standard") core profile is present, put it at the very // top of the list. This profile will have its radio button pre-selected, // so we want it to always appear at the top. - $names = array('default' => $names['default']) + $names; + $names = array('standard' => $names['standard']) + $names; } foreach ($names as $profile => $name) { $form['profile'][$name] = array( '#type' => 'radio', - '#value' => 'default', + '#value' => 'standard', '#return_value' => $profile, '#title' => $name, '#description' => isset($profiles[$profile]['description']) ? $profiles[$profile]['description'] : '', @@ -1182,7 +1182,7 @@ function install_select_locale(&$install_state) { // the user that the installer can be localized. Otherwise we assume the // user knows what he is doing. if (count($locales) == 1) { - if ($profilename == 'default' && $install_state['interactive']) { + if ($profilename == 'standard' && $install_state['interactive']) { drupal_set_title(st('Choose language')); if (!empty($install_state['parameters']['localize'])) { $output = '<p>' . st('With the addition of an appropriate translation package, this installer is capable of proceeding in another language of your choice. To install and use Drupal in a language other than English:') . '</p>'; @@ -1240,7 +1240,7 @@ function install_select_locale(&$install_state) { /** * Form API array definition for language selection. */ -function install_select_locale_form($form, &$form_state, $locales, $profilename = 'default') { +function install_select_locale_form($form, &$form_state, $locales, $profilename = 'standard') { include_once DRUPAL_ROOT . '/includes/iso.inc'; $languages = _locale_get_predefined_list(); foreach ($locales as $locale) { @@ -1257,7 +1257,7 @@ function install_select_locale_form($form, &$form_state, $locales, $profilename '#parents' => array('locale') ); } - if ($profilename == 'default') { + if ($profilename == 'standard') { $form['help'] = array( '#markup' => '<p><a href="install.php?profile=' . $profilename . '&localize=true">' . st('Learn how to install Drupal in other languages') . '</a></p>', ); @@ -1710,7 +1710,7 @@ function install_configure_form_submit($form, &$form_state) { // Enable update.module if this option was selected. if ($form_state['values']['update_status_module'][1]) { drupal_install_modules(array('update')); - + // Add the site maintenance account's email address to the list of // addresses to be notified when updates are available, if selected. if ($form_state['values']['update_status_module'][2]) { diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index 6599fa1e17a7..be4dbf016e6f 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -184,12 +184,12 @@ public static function insertAssert($test_id, $test_class, $status, $message = ' /** * Delete an assertion record by message ID. - * + * * @param $message_id * Message ID of the assertion to delete. * @return * TRUE if the assertion was deleted, FALSE otherwise. - * + * * @see DrupalTestCase::insertAssert() */ public static function deleteAssert($message_id) { @@ -1137,8 +1137,8 @@ protected function setUp() { $this->preloadRegistry(); // Include the default profile - variable_set('install_profile', 'default'); - $profile_details = install_profile_info('default', 'en'); + variable_set('install_profile', 'standard'); + $profile_details = install_profile_info('standard', 'en'); // Install the modules specified by the default profile. drupal_install_modules($profile_details['dependencies'], TRUE); @@ -1158,7 +1158,7 @@ protected function setUp() { // Run default profile tasks. $install_state = array(); - drupal_install_modules(array('default'), TRUE); + drupal_install_modules(array('standard'), TRUE); // Rebuild caches. node_types_rebuild(); @@ -1173,7 +1173,6 @@ protected function setUp() { $user = user_load(1); // Restore necessary variables. - variable_set('install_profile', 'default'); variable_set('install_task', 'done'); variable_set('clean_url', $clean_url_original); variable_set('site_mail', 'simpletest@example.com'); diff --git a/modules/system/system.install b/modules/system/system.install index 478a09279d2f..4a1e9ccddc86 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -2718,6 +2718,15 @@ function system_update_7048() { ->execute(); } +/** + * Rename 'Default' profile to 'Standard.' + */ +function system_update_7049() { + if (variable_get('install_profile', 'standard') == 'default') { + variable_set('install_profile', 'standard'); + } +} + /** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. diff --git a/modules/system/system.module b/modules/system/system.module index 850be5446d3a..067f171c8c81 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -642,7 +642,7 @@ function system_menu() { ); } - // Modules + // Modules. $items['admin/modules'] = array( 'title' => 'Modules', 'description' => 'Enable or disable add-on modules for your site.', @@ -675,7 +675,7 @@ function system_menu() { 'file' => 'system.admin.inc', ); - // Configuration and modules. + // Configuration. $items['admin/config'] = array( 'title' => 'Configuration', 'page callback' => 'system_admin_config_page', diff --git a/profiles/expert/expert.info b/profiles/minimal/minimal.info similarity index 85% rename from profiles/expert/expert.info rename to profiles/minimal/minimal.info index 8b07f57a01fb..f4794dfb6282 100644 --- a/profiles/expert/expert.info +++ b/profiles/minimal/minimal.info @@ -5,4 +5,4 @@ version = VERSION core = 7.x dependencies[] = block dependencies[] = dblog -files[] = expert.profile +files[] = minimal.profile diff --git a/profiles/expert/expert.install b/profiles/minimal/minimal.install similarity index 98% rename from profiles/expert/expert.install rename to profiles/minimal/minimal.install index 2ffd36465e7c..73c441c481af 100644 --- a/profiles/expert/expert.install +++ b/profiles/minimal/minimal.install @@ -6,7 +6,7 @@ * * Perform actions to set up the site for this profile. */ -function expert_install() { +function minimal_install() { // Add text formats. $plain_text_format = array( 'name' => 'Plain text', @@ -93,5 +93,3 @@ function expert_install() { user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content', 'use text format 1')); user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content', 'access comments', 'post comments', 'post comments without approval', 'use text format 1')); } - - diff --git a/profiles/expert/expert.profile b/profiles/minimal/minimal.profile similarity index 73% rename from profiles/expert/expert.profile rename to profiles/minimal/minimal.profile index aab82e9c66cf..5fd06c3fc05a 100644 --- a/profiles/expert/expert.profile +++ b/profiles/minimal/minimal.profile @@ -6,6 +6,6 @@ * * Allows the profile to alter the site configuration form. */ -function expert_form_install_configure_form_alter(&$form, $form_state) { +function minimal_form_install_configure_form_alter(&$form, $form_state) { $form['site_information']['site_name']['#default_value'] = $_SERVER['SERVER_NAME']; } diff --git a/profiles/default/default.info b/profiles/standard/standard.info similarity index 95% rename from profiles/default/default.info rename to profiles/standard/standard.info index 85abfe2a206c..ce0df9251444 100644 --- a/profiles/default/default.info +++ b/profiles/standard/standard.info @@ -21,4 +21,4 @@ dependencies[] = overlay dependencies[] = field_ui dependencies[] = file dependencies[] = rdf -files[] = default.profile +files[] = standard.profile diff --git a/profiles/default/default.install b/profiles/standard/standard.install similarity index 99% rename from profiles/default/default.install rename to profiles/standard/standard.install index d9b2e5bcdb8c..5bcf9e39f07b 100644 --- a/profiles/default/default.install +++ b/profiles/standard/standard.install @@ -6,7 +6,7 @@ * * Perform actions to set up the site for this profile. */ -function default_install() { +function standard_install() { // Add text formats. $filtered_html_format = array( 'name' => 'Filtered HTML', diff --git a/profiles/default/default.profile b/profiles/standard/standard.profile similarity index 82% rename from profiles/default/default.profile rename to profiles/standard/standard.profile index 89800f66b5e5..d8203d0e5f24 100644 --- a/profiles/default/default.profile +++ b/profiles/standard/standard.profile @@ -6,7 +6,7 @@ * * Allows the profile to alter the site configuration form. */ -function default_form_alter(&$form, $form_state, $form_id) { +function standard_form_alter(&$form, $form_state, $form_id) { if ($form_id == 'install_configure_form') { // Set default for site name field. $form['site_information']['site_name']['#default_value'] = $_SERVER['SERVER_NAME']; -- GitLab