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)
This commit is contained in:
Yuriy Bakhtin 2022-07-06 14:45:14 +03:00 committed by GitHub
parent e924bb0302
commit 71528b8b48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -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)
----------------------

View File

@ -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();