1
It is not in XOOPS255 and XOOPS256.
In XOOPS26/class/criteria.php line 219:
public function render()
{
$ret = '';
foreach ($this->criteriaElements as $i => $element) {
/* @var $element CriteriaElement */
if ($i == 0) {
$ret = $element->render();
} else {
if (!$render = $element->render()) {
continue;
}
$ret .= ' ' . $this->conditions[$i] . ' ' . $render;
}
$ret = "({$ret})";
}
return $ret;
}
It will return () when $ret is empty.
so finally we have a query error:
SELECT * FROM `TABLE` WHERE () ORDER BY id DESC LIMIT 0, 10
solution:
public function render()
{
$ret = '';
foreach ($this->criteriaElements as $i => $element) {
/* @var $element CriteriaElement */
if ($i == 0) {
$ret = $element->render();
} else {
if (!$render = $element->render()) {
continue;
}
$ret .= ' ' . $this->conditions[$i] . ' ' . $render;
}
$ret = empty($ret) ? '' : "({$ret})"; // irmtfan change this
}
return $ret;
}
PS: please somebody add this to sf.net bug tracker