From b135dca8270dfd11949adc9ccf2baae49b1cb34a Mon Sep 17 00:00:00 2001 From: GrozaZool Date: Sun, 19 Jan 2025 23:22:51 +0300 Subject: [PATCH 1/2] fix teamUser::getList sort --- wa-apps/team/lib/classes/teamUser.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wa-apps/team/lib/classes/teamUser.class.php b/wa-apps/team/lib/classes/teamUser.class.php index 21fa16e27..2098774ca 100644 --- a/wa-apps/team/lib/classes/teamUser.class.php +++ b/wa-apps/team/lib/classes/teamUser.class.php @@ -106,6 +106,9 @@ public static function getList($collection_hash, $options = array(), &$total_cou // Order by $order_by = ifset($options['order']); + if (!$order_by) { + $order_by = 'name ASC'; + } if ($order_by === 'from_user_settings') { $order_by = wa()->getUser()->getSettings(wa()->getApp(), 'sort', 'last_seen'); if (!$order_by) { @@ -120,9 +123,6 @@ public static function getList($collection_hash, $options = array(), &$total_cou case 'last_seen': $order_by = 'last_datetime DESC'; break; - default: - $order_by = 'name ASC'; - break; } $order_by = explode(' ', $order_by); From bcc67813bfc1de5b644b825836e477fae82b2c7c Mon Sep 17 00:00:00 2001 From: GrozaZool Date: Wed, 28 May 2025 12:05:52 +0300 Subject: [PATCH 2/2] fix teamUser::getList sort --- wa-apps/team/lib/classes/teamUser.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wa-apps/team/lib/classes/teamUser.class.php b/wa-apps/team/lib/classes/teamUser.class.php index 2098774ca..b0859ba53 100644 --- a/wa-apps/team/lib/classes/teamUser.class.php +++ b/wa-apps/team/lib/classes/teamUser.class.php @@ -106,7 +106,9 @@ public static function getList($collection_hash, $options = array(), &$total_cou // Order by $order_by = ifset($options['order']); - if (!$order_by) { + if ($order_by) { + $order_by = preg_replace('/[^\w\s]+/', '', $order_by); + } else { $order_by = 'name ASC'; } if ($order_by === 'from_user_settings') {