X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FUser_group.php;h=1546414011bcf3e3c700cd2a24d26a7dd31a6291;hb=d6b28c64830f632bb2f4b6f3c9369b9e56ad217a;hp=7bfb16e27f67df7e04d2a91c43a2a820fe3c00e3;hpb=4ea396f8718648ef6b900ea2aa8a7cad9f14d721;p=quix0rs-gnu-social.git diff --git a/classes/User_group.php b/classes/User_group.php index 7bfb16e27f..1546414011 100644 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -91,9 +91,22 @@ class User_group extends Managed_DataObject { if (!isset($this->_profile[$this->profile_id])) { $profile = Profile::getKV('id', $this->profile_id); + if (!$profile instanceof Profile) { - throw new GroupNoProfileException($this); + + $profile = new Profile(); + $profile->nickname = $this->nickname; + $profile->fullname = $this->fullname; + $profile->profileurl = $this->mainpage; + $profile->homepage = $this->homepage; + $profile->bio = $this->description; + $profile->location = $this->location; + $profile->created = common_sql_now(); + $this->profile_id = $profile->insert(); + + //throw new GroupNoProfileException($this); } + $this->_profile[$this->profile_id] = $profile; } return $this->_profile[$this->profile_id];