From 61e691d3a6bb1951ed8e196b427c4e1089cbb5a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 12 Feb 2013 10:46:48 +0100 Subject: [PATCH] // small fix for change position --- classes/controller/AdminController.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index e2bfbd17a..bd5789190 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -2041,7 +2041,14 @@ class AdminControllerCore extends Controller /* Cache */ $this->_lang = (int)$id_lang; - $this->_orderBy = (strpos($order_by, '.') !== false) ? substr($order_by, strpos($order_by, '.') + 1) : $order_by; + + if (preg_match('/[.!]/', $order_by)) + { + $order_by_split = preg_split('/[.!]/', $order_by); + $order_by = pSQL($order_by_split[0]).'.`'.pSQL($order_by_split[1]).'`'; + } + + $this->_orderBy = $order_by_split[1]; $this->_orderWay = Tools::strtoupper($order_way); /* SQL table : orders, but class name is Order */ @@ -2100,11 +2107,7 @@ class AdminControllerCore extends Controller $having_clause .= $this->_having.' '; } - if (preg_match('/[.!]/', $order_by)) - { - $order_by = preg_split('/[.!]/', $order_by); - $order_by = pSQL($order_by[0]).'.`'.pSQL($order_by[1]).'`'; - } + $this->_listsql = ' SELECT SQL_CALC_FOUND_ROWS