From 73c06b16a2e9353b2345f4ac9b318aae285ea2dc Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Thu, 22 Apr 2021 15:01:51 +0300 Subject: [PATCH] Fix assign default group on user registration (#5033) --- CHANGELOG.md | 4 +++- protected/humhub/modules/user/models/Group.php | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0eec03cbc0..7cbab5da75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ HumHub Changelog ================ -1.8.2 (April 20, 2021) + +1.8.2 (Unreleased) ---------------------- - Fix #4959: Horizontal scrollbar for images @@ -19,6 +20,7 @@ HumHub Changelog - Fix #5004: Preview text maxLength issue - Fix #5017: File CLI Command fails due to manually deleted files - Fix: Space visibility options shown to users without permission +- Fix #5022: Fix assign default group on user registration 1.8.1 (March 12, 2021) diff --git a/protected/humhub/modules/user/models/Group.php b/protected/humhub/modules/user/models/Group.php index 67fefd4d98..837821b375 100644 --- a/protected/humhub/modules/user/models/Group.php +++ b/protected/humhub/modules/user/models/Group.php @@ -451,10 +451,13 @@ class Group extends ActiveRecord public static function getRegistrationGroups() { if (Yii::$app->getModule('user')->settings->get('auth.showRegistrationUserGroup')) { - return self::find() + $groups = self::find() ->where(['show_at_registration' => 1, 'is_admin_group' => 0]) ->orderBy('name ASC') ->all(); + if (count($groups) > 0) { + return $groups; + } } $groups = [];