Skip to content

Commit

Permalink
Fix form url
Browse files Browse the repository at this point in the history
  • Loading branch information
almasaeed2010 committed Feb 2, 2018
1 parent 9efa046 commit d635ac6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions includes/tripal_elasticsearch.website_search.form.inc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
* @return mixed
*/
function website_search_box_form($form, &$form_state) {
$default = isset($_GET['search_box']) ? $_GET['search_box'] : '';
$category = isset($_GET['category']) ? $_GET['category'] : '';
global $base_url;

$default = isset($_GET['search_box']) && $_GET['search_box'] ? $_GET['search_box'] : '';
$category = isset($_GET['category']) && $_GET['category'] ? $_GET['category'] : '';
$form['container'] = [
'#type' => 'container',
'#attributes' => [
Expand Down Expand Up @@ -46,7 +48,7 @@ function website_search_box_form($form, &$form_state) {
];

$form['#method'] = 'GET';
$form['#action'] = '/tripal_elasticsearch/search_website/' . $category;
$form['#action'] = $base_url . '/tripal_elasticsearch/search_website/' . $category;

return $form;
}
Expand Down Expand Up @@ -159,7 +161,7 @@ function tripal_elasticsearch_build_search_block_form($form, &$form_state, $inde
try {
$es = new ESInstance();
$results_count = $es->setTableSearchParams($index_name, $index_type, $query)
->count();
->count();
$count = '<span style="color: red"><b>' . $results_count . '</b> results match your search.</span>';
} catch (\Exception $e) {
drupal_set_message($e->getMessage(), 'warning');
Expand Down

0 comments on commit d635ac6

Please sign in to comment.