Permalink
Browse files

MDL-29538 core_condition: ignore any fields that have none selected

  • Loading branch information...
1 parent d2170cb commit 95a9bc0e4ab6bfd003ed69f0bc82d21d08e672df @markn86 markn86 committed May 14, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 course/moodleform_mod.php
@@ -365,6 +365,9 @@ function validation($data, $files) {
// Error message displayed if any condition is declared more than once
$stralreadydeclaredwarning = get_string('fielddeclaredmultipletimes', 'condition');
foreach ($data['conditionfieldgroup'] as $i => $fielddata) {
+ if ($fielddata['conditionfield'] == 0) { // Don't need to bother if none is selected
+ continue;
+ }
if (in_array($fielddata['conditionfield'], $arrcurrentfields)) {
$errors["conditionfieldgroup[{$i}]"] = $stralreadydeclaredwarning;
}

0 comments on commit 95a9bc0

Please sign in to comment.