From 7d18285720f1e9deaf3c81f7538043e5d4ebcefd Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Fri, 30 Nov 2012 14:45:05 +1300 Subject: [PATCH] MDL-36939 cache: instance form validation now handles errors properly --- cache/forms.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cache/forms.php b/cache/forms.php index 533f1f8713c00..542e7a0046cef 100644 --- a/cache/forms.php +++ b/cache/forms.php @@ -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;