diff --git a/protected/humhub/docs/CHANGELOG.md b/protected/humhub/docs/CHANGELOG.md index f8cbefc007..8298d2e7f6 100644 --- a/protected/humhub/docs/CHANGELOG.md +++ b/protected/humhub/docs/CHANGELOG.md @@ -19,6 +19,8 @@ HumHub Change Log - Fix #3452: Soft deleted user remain in other users as friends - Fix #3170: Wrong cancel invitation mail handling - Enh: Added `humhub\modules\space\models\Membership::isCurrentUser()` +- Enh: Added `humhub\widgets\Link::post()` for `data-method="POST` requests +- Fix: Use `humhub\modules\user\components\ActiveQueryUser::active()` on UserPicker fillquery by default 1.3.8 (December 10, 2018) diff --git a/protected/humhub/modules/user/models/UserPicker.php b/protected/humhub/modules/user/models/UserPicker.php index 1a5b20417d..e88bec1e31 100644 --- a/protected/humhub/modules/user/models/UserPicker.php +++ b/protected/humhub/modules/user/models/UserPicker.php @@ -15,29 +15,30 @@ use humhub\modules\user\models\UserFilter; */ class UserPicker { - + /** * Creates a json user array used in the userpicker js frontend. * The $cfg is used to specify the filter values the following values are available: - * + * * query - (ActiveQuery) The initial query which is used to append additional filters. - default = User Friends if friendship module is enabled else User::find() - * + * * active - (boolean) Specifies if only active user should be included in the result - default = true - * + * * maxResults - (int) The max number of entries returned in the array - default = 10 - * + * * keyword - (string) A keyword which filters user by username, firstname, lastname, email and title - * + * * permission - (BasePermission) An additional permission filter - * + * * fillQuery - (ActiveQuery) Can be used to fill the result array if the initial query does not return the maxResults, these results will have a lower priority - * + * * fillUser - (boolean) When set to true and no fillQuery is given the result is filled with User::find() results - * + * * disableFillUser - Specifies if the results of the fillQuery should be disabled in the userpicker results - default = true - * + * * @param type $cfg filter configuration * @return type json representation used by the userpicker + * @throws \Throwable */ public static function filter($cfg = null) { @@ -70,7 +71,7 @@ class UserPicker if(count($user) < $cfg['maxResult'] && (isset($cfg['fillQuery']) || $cfg['fillUser']) ) { //Filter out users by means of the fillQuery or default the fillQuery - $fillQuery = (isset($cfg['fillQuery'])) ? $cfg['fillQuery'] : UserFilter::find(); + $fillQuery = (isset($cfg['fillQuery'])) ? $cfg['fillQuery'] : UserFilter::find()->active(); UserFilter::addKeywordFilter($fillQuery, $cfg['keyword'], ($cfg['maxResult'] - count($user))); $fillQuery->andFilterWhere(['not in', 'id', self::getUserIdArray($user)]); $fillUser = $fillQuery->all();