Index: branches/unlabeled/unlabeled-1.18.2/core/kernel/db/dblist.php =================================================================== diff -u -r5858 -r5950 --- branches/unlabeled/unlabeled-1.18.2/core/kernel/db/dblist.php (.../dblist.php) (revision 5858) +++ branches/unlabeled/unlabeled-1.18.2/core/kernel/db/dblist.php (.../dblist.php) (revision 5950) @@ -417,7 +417,7 @@ if (!empty($group)) $q .= ' GROUP BY ' . $group; if (!empty($having)) $q .= ' HAVING ' . $having; if ( !$for_counting && !empty($order) ) $q .= ' ORDER BY ' . $order; - + return $this->replaceModePrefix( str_replace('%1$s', $this->TableName, $q) ); } @@ -433,7 +433,7 @@ $fields = $this->getCalculatedFields($aggregated); if (is_array($fields) && count($fields) > 0) { foreach ($fields as $field_name => $field_expression) { - $clause = preg_replace('/[`]{0,1}'.$field_name.'[`]{0,1}/', $field_expression, $clause); + $clause = preg_replace('/[,` ]{1}'.$field_name.'[` ]{1}/', $field_expression, $clause); } } return $clause;