From fafcbec36266a0542efd4d606d96489cf6fd8270 Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 12 Mar 2013 11:31:17 -0400 Subject: Fixes #4953 added where clause to only change the correct acl --- mod/groups/actions/groups/edit.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mod/groups/actions/groups/edit.php b/mod/groups/actions/groups/edit.php index 632a6412b..c924ef198 100644 --- a/mod/groups/actions/groups/edit.php +++ b/mod/groups/actions/groups/edit.php @@ -54,14 +54,15 @@ if ($group_guid && !$group->canEdit()) { // Assume we can edit or this is a new group if (sizeof($input) > 0) { foreach($input as $shortname => $value) { - // update access collection name ig group name changes + // update access collection name if group name changes if (!$is_new_group && $shortname == 'name' && $value != $group->name) { - $ac_name = elgg_echo('groups:group') . ": " . $group->name; + $ac_name = elgg_echo('groups:group') . ": " . $value; $acl = get_access_collection($group->group_acl); if ($acl) { // @todo Elgg api does not support updating access collection name $db_prefix = elgg_get_config('dbprefix'); - $query = "UPDATE {$db_prefix}access_collections SET name = '$ac_name'"; + $query = "UPDATE {$db_prefix}access_collections SET name = '$ac_name' + WHERE id = $group->group_acl"; update_data($query); } } -- cgit v1.2.3