Skip to main content
added 107 characters in body
Source Link
Stephen Callender
  • 3.9k
  • 2
  • 19
  • 44

It's a bug in EE's native Search module. Bug reported here: https://support.ellislab.com/bugs/detail/19828

Here's the fix:

Starting in line 1290 of system/expressionengine/modules/search/mod.search.php

REPLACE

if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{
  return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
}

WITH

if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{           
  if ($query->row('no_result_page') == "")
  {
    return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
  }
  else
  {
    ee()->functions->redirect$path = reduce_double_slashes(ee()->functions->create_url(trim_slashes($query$this->row('no_result_page'>_meta['no_result_page'])).'/'.$hash.'/');
    ee()->security->restore_xid();
    return ee()->functions->redirect($path);
  }
}

It's a bug in EE's native Search module. Bug reported here: https://support.ellislab.com/bugs/detail/19828

Here's the fix:

Starting in line 1290 of system/expressionengine/modules/search/mod.search.php

REPLACE

if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{
  return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
}

WITH

if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{           
  if ($query->row('no_result_page') == "")
  {
    return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
  }
  else
  {
    ee()->functions->redirect(ee()->functions->create_url(($query->row('no_result_page')).'/'.$hash.'/'));
  }
}

It's a bug in EE's native Search module. Bug reported here: https://support.ellislab.com/bugs/detail/19828

Here's the fix:

Starting in line 1290 of system/expressionengine/modules/search/mod.search.php

REPLACE

if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{
  return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
}

WITH

if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{           
  if ($query->row('no_result_page') == "")
  {
    return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
  }
  else
  {
    $path = reduce_double_slashes(ee()->functions->create_url(trim_slashes($this->_meta['no_result_page'])).'/'.$hash.'/');
    ee()->security->restore_xid();
    return ee()->functions->redirect($path);
  }
}
improved answer
Source Link
Stephen Callender
  • 3.9k
  • 2
  • 19
  • 44

It's a bug in EE's native Search module. Bug reported here: https://support.ellislab.com/bugs/detail/19828

Here's the fix:

Starting in line 1290 of system/expressionengine/modules/search/mod.search.php

REPLACE

if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{
  return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
}

WITH

if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{           
  if ($query->row('no_result_page') == "")
  {
    return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
  }
  else
  {
    return;ee()->functions->redirect(ee()->functions->create_url(($query->row('no_result_page')).'/'.$hash.'/'));
  }
}

It's a bug in EE's native Search module. Bug reported here: https://support.ellislab.com/bugs/detail/19828

Here's the fix:

Starting in line 1290 of system/expressionengine/modules/search/mod.search.php

REPLACE

if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{
  return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
}

WITH

if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{           
  if ($query->row('no_result_page') == "")
  {
    return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
  }
  else
  {
    return;
  }
}

It's a bug in EE's native Search module. Bug reported here: https://support.ellislab.com/bugs/detail/19828

Here's the fix:

Starting in line 1290 of system/expressionengine/modules/search/mod.search.php

REPLACE

if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{
  return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
}

WITH

if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{           
  if ($query->row('no_result_page') == "")
  {
    return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
  }
  else
  {
    ee()->functions->redirect(ee()->functions->create_url(($query->row('no_result_page')).'/'.$hash.'/'));
  }
}
Source Link
Stephen Callender
  • 3.9k
  • 2
  • 19
  • 44

It's a bug in EE's native Search module. Bug reported here: https://support.ellislab.com/bugs/detail/19828

Here's the fix:

Starting in line 1290 of system/expressionengine/modules/search/mod.search.php

REPLACE

if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{
  return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
}

WITH

if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{           
  if ($query->row('no_result_page') == "")
  {
    return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
  }
  else
  {
    return;
  }
}