summaryrefslogtreecommitdiff
path: root/modules/search/search.module
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-12-06 07:00:30 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-12-06 07:00:30 +0000
commit363256d009bbca4adc5cec0a9a57c47b60c69a1b (patch)
treeb38807be6a02bed9b42014db8356023fd0c87852 /modules/search/search.module
parent2c77be1b606bebf638a5b9b9db5914cd68199cc0 (diff)
downloadbrdo-363256d009bbca4adc5cec0a9a57c47b60c69a1b.tar.gz
brdo-363256d009bbca4adc5cec0a9a57c47b60c69a1b.tar.bz2
#518512 by lelutin, dwong127, jhodgdon, nadavoid: Fixed Search from block with no keywords doesn't display the 'Please enter some keywords' message
Diffstat (limited to 'modules/search/search.module')
-rw-r--r--modules/search/search.module10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/search/search.module b/modules/search/search.module
index 1f4238797..027643485 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -1036,6 +1036,16 @@ function search_box_form_submit($form, &$form_state) {
unset($_GET['destination']);
}
+ // Check to see if the form was submitted empty.
+ // If it is empty, display an error message.
+ // (This method is used instead of setting #required to TRUE for this field
+ // because that results in a confusing error message. It would say a plain
+ // "field is required" because the search keywords field has no title.
+ // The error message would also complain about a missing #title field.)
+ if ($form_state['values']['search_block_form'] == '') {
+ form_set_error('keys', t('Please enter some keywords.'));
+ }
+
$form_id = $form['form_id']['#value'];
$info = search_get_default_module_info();
if ($info) {