Skip to content
Snippets Groups Projects
Commit e096263f authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #115540 by Wesley Tanaka, douggreen, WorldFallz, dww: 'no results'...

- Patch #115540 by Wesley Tanaka, douggreen, WorldFallz, dww: 'no results' page was not themeable, and generated invalid HTML.
parent 6a13eb22
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -21,7 +21,13 @@
* @see template_preprocess_search_results()
*/
?>
<dl class="search-results <?php print $type; ?>-results">
<?php print $search_results; ?>
</dl>
<?php print $pager; ?>
<?php if ($search_results) : ?>
<h2><?php print t('Search results');?></h2>
<dl class="search-results <?php print $type; ?>-results">
<?php print $search_results; ?>
</dl>
<?php print $pager; ?>
<?php else : ?>
<h2><?php print t('Your search yielded no results');?></h2>
<?php print search_help('search#noresults', drupal_help_arg()); ?>
<?php endif; ?>
......@@ -968,13 +968,11 @@ function search_data($keys = NULL, $type = 'node') {
if (isset($keys)) {
if (module_hook($type, 'search_execute')) {
$results = module_invoke($type, 'search_execute', $keys);
if (isset($results) && is_array($results) && count($results)) {
if (module_hook($type, 'search_page')) {
return module_invoke($type, 'search_page', $results);
}
else {
return theme('search_results', array('results' => $results, 'type' => $type));
}
if (module_hook($type, 'search_page')) {
return module_invoke($type, 'search_page', $results);
}
else {
return theme('search_results', array('results' => $results, 'type' => $type));
}
}
}
......
......@@ -35,8 +35,7 @@ function search_view($type = 'node') {
$build['search_form'] = drupal_get_form('search_form', NULL, $keys, $type);
$build['search_results'] = array(
'#theme' => 'search_results_listing',
'#title' => empty($results) ? t('Your search yielded no results') : t('Search results'),
'#content' => empty($results) ? search_help('search#noresults', drupal_help_arg()) : $results,
'#content' => $results,
);
return $build;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment