]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4152 setting access on group creation river item
authorcash <cash.costello@gmail.com>
Sat, 31 Dec 2011 16:13:01 +0000 (11:13 -0500)
committercash <cash.costello@gmail.com>
Sat, 31 Dec 2011 16:13:01 +0000 (11:13 -0500)
mod/groups/actions/groups/edit.php

index c4cf6667e50c0c4878dc8a09aabfb05cb8b01fca..b513a60989a3e76d0beee8ee8e802c3fd1524e11 100644 (file)
@@ -89,14 +89,10 @@ if ($new_group_flag) {
 
 $group->save();
 
-// group creator needs to be member of new group and river entry created
-if ($new_group_flag) {
-       elgg_set_page_owner_guid($group->guid);
-       $group->join($user);
-       add_to_river('river/group/create', 'create', $user->guid, $group->guid);
-}
-
 // Invisible group support
+// @todo this requires save to be called to create the acl for the group. This
+// is an odd requirement and should be removed. Either the acl creation happens
+// in the action or the visibility moves to a plugin hook
 if (elgg_get_plugin_setting('hidden_groups', 'groups') == 'yes') {
        $visibility = (int)get_input('vis', '', false);
        if ($visibility != ACCESS_PUBLIC && $visibility != ACCESS_LOGGED_IN) {
@@ -105,10 +101,18 @@ if (elgg_get_plugin_setting('hidden_groups', 'groups') == 'yes') {
 
        if ($group->access_id != $visibility) {
                $group->access_id = $visibility;
-               $group->save();
        }
 }
 
+$group->save();
+
+// group creator needs to be member of new group and river entry created
+if ($new_group_flag) {
+       elgg_set_page_owner_guid($group->guid);
+       $group->join($user);
+       add_to_river('river/group/create', 'create', $user->guid, $group->guid, $group->access_id);
+}
+
 // Now see if we have a file icon
 if ((isset($_FILES['icon'])) && (substr_count($_FILES['icon']['type'],'image/'))) {