diff --git a/protected/humhub/docs/CHANGELOG.md b/protected/humhub/docs/CHANGELOG.md index b2ce3fbbef..187d34b013 100644 --- a/protected/humhub/docs/CHANGELOG.md +++ b/protected/humhub/docs/CHANGELOG.md @@ -19,6 +19,7 @@ HumHub Change Log - Enh: Added `humhub\modules\file\models\isAssignedTo($record)` argument in order to check if a File is attached to a specific record - Fix: rich-text mobile view wrong min-height calculation - Fix #3314: layout container width differences +- Fix #3315: Exception on first login with ldap 1.3.4 (September 25, 2018) diff --git a/protected/humhub/modules/user/models/forms/Registration.php b/protected/humhub/modules/user/models/forms/Registration.php index 4cbc26f599..90553acda2 100644 --- a/protected/humhub/modules/user/models/forms/Registration.php +++ b/protected/humhub/modules/user/models/forms/Registration.php @@ -8,14 +8,14 @@ namespace humhub\modules\user\models\forms; +use humhub\compat\HForm; +use humhub\modules\user\models\Group; +use humhub\modules\user\models\GroupUser; +use humhub\modules\user\models\Password; +use humhub\modules\user\models\Profile; +use humhub\modules\user\models\User; use Yii; use yii\helpers\ArrayHelper; -use humhub\compat\HForm; -use humhub\modules\user\models\User; -use humhub\modules\user\models\Group; -use humhub\modules\user\models\Profile; -use humhub\modules\user\models\Password; -use humhub\modules\user\models\GroupUser; /** * Description of Registration @@ -173,11 +173,11 @@ class Registration extends HForm $groupFieldType = "hidden"; $defaultUserGroup = $groupModels[0]->id; } - - if(!$defaultUserGroup && empty($groupModels)) { + + if (!$defaultUserGroup && empty($groupModels)) { $groupFieldType = "hidden"; } - + return [ 'type' => 'form', 'elements' => [ @@ -255,6 +255,8 @@ class Registration extends HForm $this->models['Profile']->user_id = $this->models['User']->id; $this->models['Profile']->save(); + $this->models['User']->populateRelation('profile', $this->models['Profile']); + if ($this->models['GroupUser']->validate()) { $this->models['GroupUser']->user_id = $this->models['User']->id; $this->models['GroupUser']->save();