MDL-36939 cache: instance form validation now handles errors properly

This commit is contained in:
Sam Hemelryk
2012-12-07 08:37:03 +13:00
parent 325e266e95
commit f9870842bd
+7 -1
View File
@@ -101,7 +101,13 @@ class cachestore_addinstance_form extends moodleform {
}
if (method_exists($this, 'configuration_validation')) {
$errors = $this->configuration_validation($data, $files);
$newerrors = $this->configuration_validation($data, $files, $errors);
// We need to selectiviliy merge here
foreach ($newerrors as $element => $error) {
if (!array_key_exists($element, $errors)) {
$errors[$element] = $error;
}
}
}
return $errors;