From 71528b8b48cd9a89b78a17e0f189b975c9bcad10 Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Wed, 6 Jul 2022 14:45:14 +0300 Subject: [PATCH] Hide data of disabled users on picker filters on "People" page (#5800) * Hide data of disabled users on picker filters on "People" page * Factorize query for people filter picker * Update CHANGELOG.md (#5800) --- CHANGELOG.md | 1 + .../humhub/modules/user/widgets/PeopleFilterPicker.php | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2febc8db9..5b75897b7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ HumHub Changelog - Fix #5776: Hide beta modules on disabled filter - Fix #5799: Incorrect selection when multiple custom filters are in place - Fix #5780: Don't hide icon "remove item" on picker +- Fix #5800: Hide data of disabled users on picker filters on "People" page 1.11.3 (June 27, 2022) ---------------------- diff --git a/protected/humhub/modules/user/widgets/PeopleFilterPicker.php b/protected/humhub/modules/user/widgets/PeopleFilterPicker.php index 9ba62cbc13..5ea44f567b 100644 --- a/protected/humhub/modules/user/widgets/PeopleFilterPicker.php +++ b/protected/humhub/modules/user/widgets/PeopleFilterPicker.php @@ -124,12 +124,12 @@ class PeopleFilterPicker extends BasePicker */ public function getSuggestions($keyword = '') { - return Profile::find()->select([ - 'id' => $this->itemKey, - 'text' => $this->itemKey, - ]) + return User::find() + ->select(['id' => $this->itemKey, 'text' => $this->itemKey]) + ->visible() + ->joinWith('profile') + ->andWhere(['LIKE', $this->itemKey, $keyword]) ->groupBy($this->itemKey) - ->where(['LIKE', $this->itemKey, $keyword]) ->limit(100) ->asArray() ->all();