diff -u b/core/modules/search/config/search.settings.yml b/core/modules/search/config/search.settings.yml --- b/core/modules/search/config/search.settings.yml +++ b/core/modules/search/config/search.settings.yml @@ -1,3 +1,8 @@ +active_modules: + - node + - user +and_or_limit: '7' +default_module: node index: cron_limit: '100' overlap_cjk: '1' @@ -18,6 +22,0 @@ -search: - active_modules: - - node - - user - and_or_limit: '7' - default_module: node diff -u b/core/modules/search/lib/Drupal/search/SearchQuery.php b/core/modules/search/lib/Drupal/search/SearchQuery.php --- b/core/modules/search/lib/Drupal/search/SearchQuery.php +++ b/core/modules/search/lib/Drupal/search/SearchQuery.php @@ -203,7 +203,7 @@ // Classify tokens. $or = FALSE; $warning = ''; - $limit_combinations = config('search.settings')->get('search.and_or_limit'); + $limit_combinations = config('search.settings')->get('and_or_limit'); // The first search expression does not count as AND. $and_count = -1; $or_count = 0; @@ -356,7 +356,7 @@ return FALSE; } if ($this->expressionsIgnored) { - drupal_set_message(t('Your search used too many AND/OR expressions. Only the first @count terms were included in this search.', array('@count' => config('search.settings')->get('search.and_or_limit'))), 'warning'); + drupal_set_message(t('Your search used too many AND/OR expressions. Only the first @count terms were included in this search.', array('@count' => config('search.settings')->get('and_or_limit'))), 'warning'); } $this->executedFirstPass = TRUE; diff -u b/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php --- b/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchKeywordsConditionsTest.php @@ -26,7 +26,7 @@ // Login with sufficient privileges. $this->drupalLogin($this->searching_user); // Test with all search modules enabled. - config('search.settings')->set('search.active_modules', array('node' => 'node', 'user' => 'user', 'search_extra_type' => 'search_extra_type'))->save(); + config('search.settings')->set('active_modules', array('node' => 'node', 'user' => 'user', 'search_extra_type' => 'search_extra_type'))->save(); menu_router_rebuild(); } diff -u b/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php --- b/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchPageOverrideTest.php @@ -29,7 +29,7 @@ $this->drupalLogin($this->search_user); // Enable the extra type module for searching. - config('search.settings')->set('search.active_modules', array('node' => 'node', 'user' => 'user', 'search_extra_type' => 'search_extra_type'))->save(); + config('search.settings')->set('active_modules', array('node' => 'node', 'user' => 'user', 'search_extra_type' => 'search_extra_type'))->save(); menu_router_rebuild(); } diff -u b/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php --- b/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php @@ -60,7 +60,7 @@ // Test a search input exceeding the limit of AND/OR combinations to test // the Denial-of-Service protection. - $limit = config('search.settings')->get('search.and_or_limit'); + $limit = config('search.settings')->get('and_or_limit'); $keys = array(); for ($i = 0; $i < $limit + 1; $i++) { $keys[] = $this->randomName(3); diff -u b/core/modules/search/search.admin.inc b/core/modules/search/search.admin.inc --- b/core/modules/search/search.admin.inc +++ b/core/modules/search/search.admin.inc @@ -55,7 +55,7 @@ // Collect some stats $remaining = 0; $total = 0; - foreach ($config->get('search.active_modules') as $module) { + foreach ($config->get('active_modules') as $module) { if ($status = module_invoke($module, 'search_status')) { $remaining += $status['remaining']; $total += $status['total']; @@ -115,14 +115,14 @@ '#type' => 'checkboxes', '#title' => t('Active modules'), '#title_display' => 'invisible', - '#default_value' => $config->get('search.active_modules'), + '#default_value' => $config->get('active_modules'), '#options' => $module_options, '#description' => t('Choose which search modules are active from the available modules.') ); $form['active']['default_module'] = array( '#title' => t('Default search module'), '#type' => 'radios', - '#default_value' => $config->get('search.default_module'), + '#default_value' => $config->get('default_module'), '#options' => $module_options, '#description' => t('Choose which search module is the default.') ); @@ -130,7 +130,7 @@ $form['#submit'][] = 'search_admin_settings_submit'; // Per module settings - foreach ($config->get('search.active_modules') as $module) { + foreach ($config->get('active_modules') as $module) { $added_form = module_invoke($module, 'search_admin'); if (is_array($added_form)) { $form = array_merge($form, $added_form); @@ -167,7 +167,7 @@ search_reindex(); } $config->set('index.cron_limit', $form_state['values']['cron_limit']); - $config->set('search.default_module', $form_state['values']['default_module']); + $config->set('default_module', $form_state['values']['default_module']); // Check whether we are resetting the values. if ($form_state['triggering_element']['#value'] == t('Reset to defaults')) { @@ -176,8 +176,8 @@ else { $new_modules = array_filter($form_state['values']['active_modules']); } - if ($config->get('search.active_modules') != $new_modules) { - $config->set('search.active_modules', $new_modules); + if ($config->get('active_modules') != $new_modules) { + $config->set('active_modules', $new_modules); drupal_set_message(t('The active search modules have been changed.')); variable_set('menu_rebuild_needed', TRUE); } diff -u b/core/modules/search/search.install b/core/modules/search/search.install --- b/core/modules/search/search.install +++ b/core/modules/search/search.install @@ -157,7 +157,7 @@ 'search_cron_limit' => 'index.cron_limit', 'search_tag_weights' => 'index.tag_weights', - 'search_active_modules' => 'search.active_modules', - 'search_and_or_limit' => 'search.and_or_limit', - 'search_default_module' => 'search.default_module', + 'search_active_modules' => 'active_modules', + 'search_and_or_limit' => 'and_or_limit', + 'search_default_module' => 'default_module', )); } diff -u b/core/modules/search/search.module b/core/modules/search/search.module --- b/core/modules/search/search.module +++ b/core/modules/search/search.module @@ -278,7 +278,7 @@ } // Return only modules that are set to active in search settings. - return array_intersect_key($search_hooks, array_flip(config('search.settings')->get('search.active_modules'))); + return array_intersect_key($search_hooks, array_flip(config('search.settings')->get('active_modules'))); } /** @@ -289,7 +289,7 @@ */ function search_get_default_module_info() { $info = search_get_info(); - $default = config('search.settings')->get('search.default_module'); + $default = config('search.settings')->get('default_module'); if (isset($info[$default])) { return $info[$default]; } @@ -367,7 +367,7 @@ // to date. drupal_register_shutdown_function('search_update_totals'); - foreach (config('search.settings')->get('search.active_modules') as $module) { + foreach (config('search.settings')->get('active_modules') as $module) { // Update word index module_invoke($module, 'update_index'); }