From fdaf46adbbf20f2e05132eb2fb18e5df7ab24b2d Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Thu, 12 Nov 2015 15:40:27 +0800 Subject: [PATCH] MDL-51029 tool_lp: Before validate was not always called When the validation already happened we did not call before_validate(). It must always be called as before_validate() can be used as if it was a before_all() callback. --- admin/tool/lp/classes/persistent.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/tool/lp/classes/persistent.php b/admin/tool/lp/classes/persistent.php index 84b2c55afe9..3dedc8d95db 100644 --- a/admin/tool/lp/classes/persistent.php +++ b/admin/tool/lp/classes/persistent.php @@ -533,12 +533,12 @@ abstract class persistent { final public function validate() { global $CFG; + // Before validate hook. + $this->before_validate(); + // If this object has not been validated yet. if ($this->validated !== true) { - // Before validate hook. - $this->before_validate(); - $errors = array(); $properties = static::properties_definition(); foreach ($properties as $property => $definition) {