MDL-19907 rewrote validation for required fields in forms, including support for editor field. Added parameter to use strict (no spaces) required fields validation
This commit is contained in:
@@ -1502,13 +1502,6 @@ class HTML_QuickForm extends HTML_Common {
|
||||
$values[] = $this->getSubmitValue($elName);
|
||||
}
|
||||
$result = $registry->validate($rule['type'], $values, $rule['format'], true);
|
||||
} else if ($rule['type'] === 'required' and $this->getElement($target)->_type === 'editor') {
|
||||
//horrible horrible hack
|
||||
if (!isset($submitValue['text']) or $submitValue['text'] === '') {
|
||||
$result = false;
|
||||
} else {
|
||||
$result = true;
|
||||
}
|
||||
} elseif (is_array($submitValue) && !isset($rule['howmany'])) {
|
||||
$result = $registry->validate($rule['type'], $submitValue, $rule['format'], true);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user