mirror of
https://github.com/humhub/humhub.git
synced 2025-02-24 03:06:04 +01:00
Merge pull request #4741 from humhub/fix/4740-save-group-without-default-space
Fix saving a group without Default Space
This commit is contained in:
commit
811da3ff95
@ -52,10 +52,12 @@ class EditGroupForm extends Group
|
||||
|
||||
$existingSpaceIds = GroupSpace::find()->where(['group_id' => $this->id])->select('space_id')->column();
|
||||
$newSpaceIds = [];
|
||||
foreach ($this->defaultSpaceGuid as $spaceGuid) {
|
||||
$space = Space::findOne(['guid' => $spaceGuid]);
|
||||
if ($space !== null) {
|
||||
$newSpaceIds[] = $space->id;
|
||||
if (is_array($this->defaultSpaceGuid)) {
|
||||
foreach ($this->defaultSpaceGuid as $spaceGuid) {
|
||||
$space = Space::findOne(['guid' => $spaceGuid]);
|
||||
if ($space !== null) {
|
||||
$newSpaceIds[] = $space->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user