MDL-86063 customfield: internally validate numeric data in persistent.
Move previous validation from the data controller, added in 89dbe63d,
into the persistent class itself so that it can internally validate
itself rather than relying on callers.
This resolves problems with empty/null numeric fields contained within
course backups (e.g. during course copy).
This commit is contained in:
@@ -95,7 +95,7 @@ abstract class persistent {
|
||||
* Data setter.
|
||||
*
|
||||
* This is the main setter for all the properties. Developers can implement their own setters (set_propertyname)
|
||||
* and they will be called by this function. Custom setters should call internal_set() to finally set the value.
|
||||
* and they will be called by this function. Custom setters should call {@see raw_set} to finally set the value.
|
||||
* Internally this is not used {@link self::to_record()} or
|
||||
* {@link self::from_record()} because the data is not expected to be validated or changed when reading/writing
|
||||
* raw records from the DB.
|
||||
|
||||
Reference in New Issue
Block a user