Skip to content

Commit

Permalink
do not require placeholder in group name template when only one reque…
Browse files Browse the repository at this point in the history
…sted
  • Loading branch information
skodak committed Jul 13, 2010
1 parent f87eab7 commit 96445d4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions group/autogroup_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,13 @@ function validation($data, $files) {
}

/// Check the naming scheme
$matchcnt = preg_match_all('/[#@]{1,1}/', $data['namingscheme'], $matches);

if ($matchcnt != 1) {
$errors['namingscheme'] = get_string('badnamingscheme', 'group');
if ($data['groupby'] == 'groups' and $data['number'] == 1) {
// we can use the name as is because there will be only one group max
} else {
$matchcnt = preg_match_all('/[#@]{1,1}/', $data['namingscheme'], $matches);
if ($matchcnt != 1) {
$errors['namingscheme'] = get_string('badnamingscheme', 'group');
}
}

return $errors;
Expand Down

0 comments on commit 96445d4

Please sign in to comment.