aboutsummaryrefslogtreecommitdiff
path: root/engine/classes
diff options
context:
space:
mode:
Diffstat (limited to 'engine/classes')
-rw-r--r--engine/classes/ElggSite.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/engine/classes/ElggSite.php b/engine/classes/ElggSite.php
index 30b222c24..e3b8b8f1a 100644
--- a/engine/classes/ElggSite.php
+++ b/engine/classes/ElggSite.php
@@ -148,11 +148,20 @@ class ElggSite extends ElggEntity {
* @return bool
*/
public function save() {
+ global $CONFIG;
+
// Save generic stuff
if (!parent::save()) {
return false;
}
+ // make sure the site guid is set (if not, set to self)
+ if (!$this->get('site_guid')) {
+ $guid = $this->get('guid');
+ update_data("UPDATE {$CONFIG->dbprefix}entities SET site_guid=$guid
+ WHERE guid=$guid");
+ }
+
// Now save specific stuff
return create_site_entity($this->get('guid'), $this->get('name'),
$this->get('description'), $this->get('url'));