mirror of
https://github.com/moodle/moodle.git
synced 2025-03-22 08:30:04 +01:00
MDL-29538 core_condition: ignore any fields that have none selected
This commit is contained in:
parent
d2170cb542
commit
95a9bc0e4a
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user