From 5a8a067ae8df6265664a05cb6d5bf9c27b78cba4 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 2 Apr 2013 13:31:06 +0200 Subject: [PATCH] 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() --- model/DataQuery.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/model/DataQuery.php b/model/DataQuery.php index cda34707c..65460bd95 100644 --- a/model/DataQuery.php +++ b/model/DataQuery.php @@ -279,16 +279,14 @@ 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()