diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-06-12 21:07:49 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-06-12 21:07:49 +0000 |
commit | ba88a1c96ab89b4afcc574e3fc8a71df640a9fd8 (patch) | |
tree | c188d7946545e73b63517387c8b5d65d13fec059 /engine/classes | |
parent | cf30721c8fa78bd9b2d10a387735c0080021b3c5 (diff) | |
download | elgg-ba88a1c96ab89b4afcc574e3fc8a71df640a9fd8.tar.gz elgg-ba88a1c96ab89b4afcc574e3fc8a71df640a9fd8.tar.bz2 |
Fixes #2910 set the site_guid of site entities
git-svn-id: http://code.elgg.org/elgg/trunk@9192 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes')
-rw-r--r-- | engine/classes/ElggSite.php | 9 |
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')); |