Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.963 diff -u -u -p -r1.963 node.module --- modules/node/node.module 10 May 2008 13:19:50 -0000 1.963 +++ modules/node/node.module 10 May 2008 20:07:38 -0000 @@ -53,6 +53,13 @@ function node_help($path, $arg) { $node = node_load($arg[1]); $type = node_get_types('type', $node->type); return (!empty($type->help) ? '

' . filter_xss_admin($type->help) . '

' : ''); + case 'search#noresults': + $noresults = array( + t('Check if your spelling is correct.'), + t('Remove quotes around phrases to match each word individually: "blue smurf" will match less than blue smurf.'), + t('Consider loosening your query with OR: blue smurf will match less than blue OR smurf.'), + ); + return theme('item_list', $noresults); } if ($arg[0] == 'node' && $arg[1] == 'add' && $arg[2]) { Index: modules/search/search.module =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.module,v retrieving revision 1.256 diff -u -u -p -r1.256 search.module --- modules/search/search.module 6 May 2008 12:18:50 -0000 1.256 +++ modules/search/search.module 10 May 2008 20:07:38 -0000 @@ -102,12 +102,6 @@ function search_help($path, $arg) { return $output; case 'admin/settings/search': return '

' . t('The search engine maintains an index of words found in your site\'s content. To build and maintain this index, a correctly configured cron maintenance task is required. Indexing behavior can be adjusted using the settings below.', array('@cron' => url('admin/reports/status'))) . '

'; - case 'search#noresults': - return t(''); } } Index: modules/search/search.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.pages.inc,v retrieving revision 1.5 diff -u -u -p -r1.5 search.pages.inc --- modules/search/search.pages.inc 14 Apr 2008 17:48:41 -0000 1.5 +++ modules/search/search.pages.inc 10 May 2008 20:07:38 -0000 @@ -35,7 +35,8 @@ function search_view($type = 'node') { $results = theme('box', t('Search results'), $results); } else { - $results = theme('box', t('Your search yielded no results'), search_help('search#noresults', drupal_help_arg())); + $help = module_invoke($type, 'help', 'search#noresults', drupal_help_arg()); + $results = theme('box', t('Your search yielded no results'), $help); } } Index: modules/search/search.test =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.test,v retrieving revision 1.1 diff -u -u -p -r1.1 search.test --- modules/search/search.test 20 Apr 2008 18:23:29 -0000 1.1 +++ modules/search/search.test 10 May 2008 20:07:38 -0000 @@ -159,4 +159,32 @@ class SearchMatchTestCase extends Drupal // Check range. $this->assertEqual(!count($scores) || (min($scores) > 0.0 && max($scores) <= 1.0001), TRUE, "Query scoring '$query'"); } + +} + +class SearchNoResultsTestCase extends DrupalWebTestCase { + /** + * Implementation of getInfo(). + */ + function getInfo() { + return array( + 'name' => t('Search help test'), + 'description' => t('Tests the search help hook'), + 'group' => t('Search'), + ); + } + + /** + * Implementation setUp(). + */ + function setUp() { + parent::setUp('search'); + } + + function testSearchHelpHook() { + foreach (module_implements('search') as $module) { + $output = module_invoke($module, 'help', 'search#noresults', drupal_help_arg()); + $this->assertTrue($output != '', "Module $module implements noresults help."); + } + } } Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.907 diff -u -u -p -r1.907 user.module --- modules/user/user.module 7 May 2008 19:34:24 -0000 1.907 +++ modules/user/user.module 10 May 2008 20:07:39 -0000 @@ -1852,6 +1852,12 @@ function user_help($path, $arg) { ', array('@permissions' => url('admin/user/permissions'))); case 'admin/user/search': return '

' . t('Enter a simple pattern ("*" may be used as a wildcard match) to search for a username or e-mail address. For example, one may search for "br" and Drupal might return "brian", "brad", and "brenda@example.com".') . '

'; + case 'search#noresults': + $noresults = array( + t('Check if your spelling is correct.'), + t('Beware that search user only looks for the Drupal user name and not the user\'s full name'), + ); + return theme('item_list', $noresults); } }