aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2013-03-12 11:54:42 -0400
committercash <cash.costello@gmail.com>2013-03-12 11:54:42 -0400
commit648cc5da8f89be53408ce28970da78cb29888276 (patch)
treeb66204c69edf5ae82d6949a0e3d36a40d3837c73
parentfafcbec36266a0542efd4d606d96489cf6fd8270 (diff)
downloadelgg-648cc5da8f89be53408ce28970da78cb29888276.tar.gz
elgg-648cc5da8f89be53408ce28970da78cb29888276.tar.bz2
Fixes #5224 transfering container and metadata ownership
-rw-r--r--mod/groups/actions/groups/edit.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/mod/groups/actions/groups/edit.php b/mod/groups/actions/groups/edit.php
index c924ef198..f04ef60db 100644
--- a/mod/groups/actions/groups/edit.php
+++ b/mod/groups/actions/groups/edit.php
@@ -105,7 +105,21 @@ if (!$is_new_group && $new_owner_guid && $new_owner_guid != $old_owner_guid) {
// verify new owner is member and old owner/admin is logged in
if (is_group_member($group_guid, $new_owner_guid) && ($old_owner_guid == $user->guid || $user->isAdmin())) {
$group->owner_guid = $new_owner_guid;
-
+ $group->container_guid = $new_owner_guid;
+
+ $metadata = elgg_get_metadata(array(
+ 'guid' => $group_guid,
+ 'limit' => false,
+ ));
+ if ($metadata) {
+ foreach ($metadata as $md) {
+ if ($md->owner_guid == $old_owner_guid) {
+ $md->owner_guid = $new_owner_guid;
+ $md->save();
+ }
+ }
+ }
+
// @todo Remove this when #4683 fixed
$owner_has_changed = true;
$old_icontime = $group->icontime;