Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-35402 forms - prevent crash when multiple rules defined on an edi…

…tor element
  • Loading branch information...
commit 5ef9103c67045e43af971a2aa34c48adde8718e9 1 parent 5c74090
@davosmith davosmith authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/formslib.php
View
7 lib/formslib.php
@@ -2133,8 +2133,9 @@ function getValidationScript()
}
}
//for editor element, [text] is appended to the name.
+ $fullelementname = $elementName;
if ($element->getType() == 'editor') {
- $elementName .= '[text]';
+ $fullelementname .= '[text]';
//Add format to rule as moodleform check which format is supported by browser
//it is not set anywhere... So small hack to make sure we pass it down to quickform
if (is_null($rule['format'])) {
@@ -2142,8 +2143,8 @@ function getValidationScript()
}
}
// Fix for bug displaying errors for elements in a group
- $test[$elementName][0][] = $registry->getValidationScript($element, $elementName, $rule);
- $test[$elementName][1]=$element;
+ $test[$fullelementname][0][] = $registry->getValidationScript($element, $fullelementname, $rule);
+ $test[$fullelementname][1]=$element;
//end of fix
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.