From ba88a1c96ab89b4afcc574e3fc8a71df640a9fd8 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 12 Jun 2011 21:07:49 +0000 Subject: Fixes #2910 set the site_guid of site entities git-svn-id: http://code.elgg.org/elgg/trunk@9192 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggSite.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'engine/classes') 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')); -- cgit v1.2.3