Skip to content
Permalink
Browse files

fix(groups): terminate edit action early if group can not be saved

Captures false returns from ElggGroup::save() and terminates edit action early with an error message
  • Loading branch information...
hypeJunction committed May 11, 2015
1 parent f2cbb23 commit 3fe10452163ee151ca3cb98323f1b4823d06f043
Showing with 9 additions and 2 deletions.
  1. +8 −2 mod/groups/actions/groups/edit.php
  2. +1 −0 mod/groups/languages/en.php
@@ -141,7 +141,10 @@ function profile_array_decoder(&$v) {
if ($is_new_group) {
// if new group, we need to save so group acl gets set in event handler
$group->save();
if (!$group->save()) {
register_error(elgg_echo("groups:save_error"));
forward(REFERER);
}
}
// Invisible group support
@@ -164,7 +167,10 @@ function profile_array_decoder(&$v) {
$group->access_id = $visibility;
}
$group->save();
if (!$group->save()) {
register_error(elgg_echo("groups:save_error"));
forward(REFERER);
}
// group saved so clear sticky form
elgg_clear_sticky_form('groups');
@@ -58,6 +58,7 @@
'groups:cantcreate' => 'You can not create a group. Only admins can.',
'groups:cantedit' => 'You can not edit this group',
'groups:saved' => 'Group saved',
'groups:save_error' => 'Group could not be saved',
'groups:featured' => 'Featured groups',
'groups:makeunfeatured' => 'Unfeature',
'groups:makefeatured' => 'Make featured',

0 comments on commit 3fe1045

Please sign in to comment.
You can’t perform that action at this time.