From 2045c08e5430ce73b5b709fadb729a1252d0d68c Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 28 Jan 2020 14:05:23 -0700 Subject: [PATCH] * Api: Fix SQL error from doubled table name in group statement "Unknown column 'egw_tracker.egw_tracker.tr_id' in 'group statement'" --- api/src/Storage.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/src/Storage.php b/api/src/Storage.php index 7761aa1ca5..e8ae370e46 100644 --- a/api/src/Storage.php +++ b/api/src/Storage.php @@ -13,6 +13,8 @@ namespace EGroupware\Api; +use EGroupware\Api\Storage\Customfields; + /** * Generalized SQL Storage Object with build in custom field support * @@ -220,7 +222,7 @@ class Storage extends Storage\Base { $id = isset($data[$this->autoinc_id]) ? $data[$this->autoinc_id] : $data[$this->db_key_cols[$this->autoinc_id]]; - \EGroupware\Api\Storage\Customfields::handle_files($this->app, $id, $data, $this->customfields); + Customfields::handle_files($this->app, $id, $data, $this->customfields); foreach (array_keys((array)$this->customfields) as $name) { @@ -586,7 +588,7 @@ class Storage extends Storage\Base else if (stripos($col, 'AS') !== false && $order_by) { list($value, $alias) = explode(' AS ', $col); - if(stripos($order_by, $alias) !== FALSE) + if(stripos($order_by, $alias) !== FALSE && stripos($value, $this->table_name) === FALSE) { $order_by = str_replace($alias, $value, $order_by); }