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.
This commit is contained in:
Frederic Massart
2016-04-18 10:58:41 +08:00
parent 1896274ff5
commit fdaf46adbb
+3 -3
View File
@@ -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) {