#242 When we save GroupSpace we add all user of the user Group to all default Spaces

This commit is contained in:
Master_Hans 2020-10-28 00:37:56 +03:00
parent 52085b8300
commit 8ab6ac842a
2 changed files with 3 additions and 2 deletions

View File

@ -69,7 +69,9 @@ class GroupSpaces extends \yii\db\ActiveRecord
if ($this->group !== null && $this->space !== null) {
foreach ($this->group->groupUsers as $user) {
/**@var GroupUser $user**/
$this->space->addMember($user->user_id);
foreach ($this->group->groupSpaces as $group_space) {
$group_space->space->addMember($user->user_id);
}
}
}
}

View File

@ -84,7 +84,6 @@ class GroupUser extends ActiveRecord
if ($insert) {
if ($this->group !== null && $this->group->groupSpaces !== null) {
foreach ($this->group->groupSpaces as $group_space) {
/**@var GroupUser $user**/
$group_space->space->addMember($this->user->id);
}
}