bug in the code. not directly in the feature.
Not sure if this is a bug. But looks like an issue with the code.
In libs/search.php ,
the code is:
if(isset($this->orderBy)){
$this->orderBy = "ORDER BY " . $this->orderBy;
}
When I call it like this .. the this->sql gets multiple ORDER BY in it .. for eg " .... ORDER BY ORDER BY link_vote" ...
So I modified the code to :
if(isset($this->orderBy) && (strstr($this->orderBy, 'ORDER') === false)){
$this->orderBy = "ORDER BY " . $this->orderBy;
}
and it works fine now.
You guys will know best but I think theres a possibility that this->orderBy variable is set multiple times and we get multiple ORDER BY additions to the sql string.
The code I used:
include_once(mnminclude.'search.php');
global $new_search;
$search=new Search();
$search->filterToStatus = 'all';
$search->orderBy = " link_votes ";
$search->doSearch();
$new_search = $search->new_search();
require_once("libs/link_summary.php");
|