Permalink
Browse files

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

  • Loading branch information...
1 parent 0395306 commit 7d18285720f1e9deaf3c81f7538043e5d4ebcefd Sam Hemelryk committed Nov 30, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 cache/forms.php
View
@@ -101,7 +101,13 @@ public function validation($data, $files) {
}
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;

0 comments on commit 7d18285

Please sign in to comment.