diff --git a/modules/search/search.module b/modules/search/search.module
index 518272a..7068f90 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -951,11 +951,13 @@ function search_expression_insert($expression, $option, $value = NULL) {
  * @param $prompt
  *   Label for the keywords field. Defaults to t('Enter your keywords') if NULL.
  *   Supply '' to omit.
+ * @param $conditions
+ *   Optional extra search conditions supplied by a conditions callback.1
  *
  * @return
  *   A Form API array for the search form.
  */
-function search_form($form, &$form_state, $action = '', $keys = '', $module = NULL, $prompt = NULL) {
+function search_form($form, &$form_state, $action = '', $keys = '', $module = NULL, $prompt = NULL, $conditions = NULL) {
   $module_info = FALSE;
   if (!$module) {
     $module_info = search_get_default_module_info();
@@ -983,6 +985,12 @@ function search_form($form, &$form_state, $action = '', $keys = '', $module = NU
   $form_state['action'] = $action;
   $form['#attributes']['class'][] = 'search-form';
   $form['module'] = array('#type' => 'value', '#value' => $module);
+  // Conditions is stored as hidden, since search_view() always passes in an empty
+  // value when there is POST data.
+  $form['conditions'] = array(
+    '#type' => 'hidden',
+    '#default_value' => (bool) $conditions,
+  );
   $form['basic'] = array('#type' => 'container', '#attributes' => array('class' => array('container-inline')));
   $form['basic']['keys'] = array(
     '#type' => 'textfield',
@@ -995,7 +1003,6 @@ function search_form($form, &$form_state, $action = '', $keys = '', $module = NU
   // that hook into the basic search form.
   $form['basic']['processed_keys'] = array('#type' => 'value', '#value' => '');
   $form['basic']['submit'] = array('#type' => 'submit', '#value' => t('Search'));
-
   return $form;
 }
 
@@ -1033,7 +1040,7 @@ function search_box_form_submit($form, &$form_state) {
   if (isset($_GET['destination'])) {
     unset($_GET['destination']);
   }
-
+  $info = search_get_default_module_info();
   // 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
@@ -1041,16 +1048,22 @@ function search_box_form_submit($form, &$form_state) {
   // "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.'));
+    $conditions= NULL;
+    if (isset($info['conditions_callback']) && function_exists($info['conditions_callback'])) {
+      // Build an optional array of more search conditions.
+      $conditions = call_user_func($info['conditions_callback'], $keys);
+    }
+    if (empty($conditions)) {
+      form_set_error('keys', t('Please enter some keywords.'));
+    }
   }
 
   $form_id = $form['form_id']['#value'];
-  $info = search_get_default_module_info();
   if ($info) {
     $form_state['redirect'] = 'search/' . $info['path'] . '/' . trim($form_state['values'][$form_id]);
   }
   else {
-    form_set_error(NULL, t('Search is currently disabled.'), 'error');
+    drupal_set_message(t('Search is currently disabled.'), 'error');
   }
 }
 
diff --git a/modules/search/search.pages.inc b/modules/search/search.pages.inc
index 833ea8b..7863440 100644
--- a/modules/search/search.pages.inc
+++ b/modules/search/search.pages.inc
@@ -45,13 +45,13 @@ function search_view($module = NULL, $keys = '') {
 
   // Default results output is an empty string.
   $results = array('#markup' => '');
+  $conditions =  NULL;
   // Process the search form. Note that if there is $_POST data,
   // search_form_submit() will cause a redirect to search/[module path]/[keys],
   // which will get us back to this page callback. In other words, the search
   // form submits with POST but redirects to GET. This way we can keep
   // the search query URL clean as a whistle.
   if (empty($_POST['form_id']) || $_POST['form_id'] != 'search_form') {
-    $conditions =  NULL;
     if (isset($info['conditions_callback']) && function_exists($info['conditions_callback'])) {
       // Build an optional array of more search conditions.
       $conditions = call_user_func($info['conditions_callback'], $keys);
@@ -66,7 +66,7 @@ function search_view($module = NULL, $keys = '') {
     }
   }
   // The form may be altered based on whether the search was run.
-  $build['search_form'] = drupal_get_form('search_form', NULL, $keys, $info['module']);
+  $build['search_form'] = drupal_get_form('search_form', NULL, $keys, $info['module'], NULL, $conditions);
   $build['search_results'] = $results;
 
   return $build;
@@ -150,7 +150,7 @@ function search_form_validate($form, &$form_state) {
  */
 function search_form_submit($form, &$form_state) {
   $keys = $form_state['values']['processed_keys'];
-  if ($keys == '') {
+  if ($keys == '' && empty($form_state['values']['conditions'])) {
     form_set_error('keys', t('Please enter some keywords.'));
     // Fall through to the form redirect.
   }
