X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FUser_group.php;h=89731ee2644160cf06eabf6e7c1cd9cde1d0b1ce;hb=299c7571fa6b114c63805a319780d53b3274b850;hp=aad38b635885540a29bf2b63e3b4b330744172b1;hpb=2c1873fe73b616e7eac2f2144be0c08d0498b9e8;p=quix0rs-gnu-social.git diff --git a/classes/User_group.php b/classes/User_group.php index aad38b6358..89731ee264 100644 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -85,9 +85,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];