mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX Consistently quote orderby in DataQuery->ensureSelectContainsOrderbyColumns()
Otherwise aggregate queries through DataQuery->column() fail unless the passed in field is specifically quoted already. This fixes ManyManyListTest->testRemoveAll()
This commit is contained in:
parent
fb5ef0293e
commit
5a8a067ae8
@ -279,17 +279,15 @@ class DataQuery {
|
||||
|
||||
if(isset($databaseFields[$parts[0]])) {
|
||||
$qualCol = "\"$baseClass\".\"{$parts[0]}\"";
|
||||
|
||||
// remove original sort
|
||||
unset($orderby[$k]);
|
||||
|
||||
// add new columns sort
|
||||
$orderby[$qualCol] = $dir;
|
||||
|
||||
} else {
|
||||
$qualCol = "\"$parts[0]\"";
|
||||
}
|
||||
|
||||
// remove original sort
|
||||
unset($orderby[$k]);
|
||||
// add new columns sort
|
||||
$orderby[$qualCol] = $dir;
|
||||
|
||||
// To-do: Remove this if block once SQLQuery::$select has been refactored to store getSelect()
|
||||
// format internally; then this check can be part of selectField()
|
||||
$selects = $query->getSelect();
|
||||
|
Loading…
Reference in New Issue
Block a user