aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/upgrades
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-08-26 11:43:05 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-08-26 11:43:05 +0000
commit8862b1f0fc6a7d9d2f3668697e2f658a7e31747e (patch)
treeb75cc5ee28011bfcd14ad544a4e59e03a0ad33c7 /engine/lib/upgrades
parent4bf0d12ffd08f5af82b037a42ba00cce4d5abfdb (diff)
downloadelgg-8862b1f0fc6a7d9d2f3668697e2f658a7e31747e.tar.gz
elgg-8862b1f0fc6a7d9d2f3668697e2f658a7e31747e.tar.bz2
Merged [6857] into trunk
git-svn-id: http://code.elgg.org/elgg/trunk@6865 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/upgrades')
-rw-r--r--engine/lib/upgrades/2010062301.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/engine/lib/upgrades/2010062301.php b/engine/lib/upgrades/2010062301.php
index 96fd6c810..049a93440 100644
--- a/engine/lib/upgrades/2010062301.php
+++ b/engine/lib/upgrades/2010062301.php
@@ -13,8 +13,19 @@ if ($groups) {
foreach ($groups as $group) {
$acl = $group->group_acl;
- $query = "UPDATE {$CONFIG->dbprefix}access_collections SET owner_guid = $group->guid WHERE id = $acl";
- update_data($query);
+ try {
+ $query = "UPDATE {$CONFIG->dbprefix}access_collections SET owner_guid = $group->guid WHERE id = $acl";
+ update_data($query);
+ } catch (Exception $e) {
+ // no acl so create one
+ $ac_name = elgg_echo('groups:group') . ": " . $group->name;
+ $group_acl = create_access_collection($ac_name, $group->guid);
+ if ($group_acl) {
+ create_metadata($group->guid, 'group_acl', $group_acl, 'integer', $group->owner_guid);
+ $object->group_acl = $group_id;
+ }
+ }
+
}
}
elgg_set_ignore_access(FALSE);