1.20.x search.admin.inc | search_admin_settings_validate($form, &$form_state) |
Form validation handler for search_admin_settings().
File
- modules/
search/ search.admin.inc, line 179 - Admin page callbacks for the Search module.
Code
function search_admin_settings_validate($form, &$form_state) {
// Check whether we selected a valid default.
if ($form_state['triggering_element']['#value'] != t('Reset to defaults')) {
$new_modules = array_filter($form_state['values']['search_active_modules']);
$default = $form_state['values']['search_default_module'];
if (!in_array($default, $new_modules, TRUE)) {
form_set_error('search_default_module', t('Your default search module is not selected as an active module.'));
}
}
}