From f8c184d860e01568276dd7a027bea1639ec819e9 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 20 Jul 2013 15:56:41 +0000 Subject: [PATCH] * All apps/custom fields: fixed multiple identical rows, if custom fields where set (introduced in last package) --- etemplate/inc/class.so_sql_cf.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etemplate/inc/class.so_sql_cf.inc.php b/etemplate/inc/class.so_sql_cf.inc.php index 1738026e8b..17372dffcf 100644 --- a/etemplate/inc/class.so_sql_cf.inc.php +++ b/etemplate/inc/class.so_sql_cf.inc.php @@ -500,6 +500,11 @@ class so_sql_cf extends so_sql $col = $this->table_name .'.'.array_search($col, $this->db_cols).' AS '.$col; } } + $only_keys[0] = 'DISTINCT '.$only_keys[0]; + } + else + { + $only_keys = 'DISTINCT '.$only_keys; } // check if we order by a custom field --> join cf table for given cf and order by it's value if (strpos($order_by,self::CF_PREFIX) !== false)