Commit 69d52388 authored by Nigel McNie's avatar Nigel McNie
Browse files

Prevent crash if a user edits a group and gives it the same name as an existing group.

parent f2f05f54
......@@ -89,7 +89,7 @@ function editgroup_validate(Pieform $form, $values) {
global $USER;
global $SESSION;
$cid = get_field('group', 'id', 'owner', $USER->get('id'), 'name', $values['name']);
$cid = get_field('group', 'id', 'name', $values['name']);
if ($cid && $cid != $values['id']) {
$form->set_error('name', get_string('groupalreadyexists', 'group'));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment