From 95a9bc0e4ab6bfd003ed69f0bc82d21d08e672df Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Tue, 15 May 2012 02:01:30 +0800 Subject: [PATCH] MDL-29538 core_condition: ignore any fields that have none selected --- course/moodleform_mod.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/course/moodleform_mod.php b/course/moodleform_mod.php index 9bafe21e2fc..50c62e9e6b6 100644 --- a/course/moodleform_mod.php +++ b/course/moodleform_mod.php @@ -365,6 +365,9 @@ abstract class moodleform_mod extends moodleform { // 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; }