]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/User_group.php
Merge remote-tracking branch 'upstream/master'
[quix0rs-gnu-social.git] / classes / User_group.php
index 2484f3f265252d8c375684b983cd5bac22bb1175..d89f3376f8028adc9a1b020da23eb0eaa027d88b 100644 (file)
@@ -92,9 +92,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];