Commit 387f7aae authored by Damyon Wiese's avatar Damyon Wiese Committed by jun

MDL-36056 forms: Don't validate disabled fields

When fields are disabled, the value comes through as null so we need to specifically check for it
before validation.
parent 9e51dc40
......@@ -101,8 +101,7 @@ class MoodleQuickForm_passwordunmask extends MoodleQuickForm_password {
* @return string|null Validation error message or null.
*/
public function validateSubmitValue($value) {
if ($value !== trim($value)) {
if ($value !== null && $value !== trim($value)) {
return get_string('err_wrappingwhitespace', 'core_form');
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment