]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/User_group.php
Introduced common_get_temp_dir() which wraps getting temporary path.
[quix0rs-gnu-social.git] / classes / User_group.php
index aad38b635885540a29bf2b63e3b4b330744172b1..89731ee2644160cf06eabf6e7c1cd9cde1d0b1ce 100644 (file)
@@ -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];