Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 95a9bc0e4ab6bfd003ed69f0bc82d21d08e672df 1 parent d2170cb
Mark Nelson markn86 authored

Showing 1 changed file with 3 additions and 0 deletions. Show diff stats Hide diff stats

  1. +3 0  course/moodleform_mod.php
3  course/moodleform_mod.php
@@ -365,6 +365,9 @@ function validation($data, $files) {
365 365 // Error message displayed if any condition is declared more than once
366 366 $stralreadydeclaredwarning = get_string('fielddeclaredmultipletimes', 'condition');
367 367 foreach ($data['conditionfieldgroup'] as $i => $fielddata) {
  368 + if ($fielddata['conditionfield'] == 0) { // Don't need to bother if none is selected
  369 + continue;
  370 + }
368 371 if (in_array($fielddata['conditionfield'], $arrcurrentfields)) {
369 372 $errors["conditionfieldgroup[{$i}]"] = $stralreadydeclaredwarning;
370 373 }

0 comments on commit 95a9bc0

Please sign in to comment.
Something went wrong with that request. Please try again.