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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user