]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12133 - Errors calling parent::validation in a moodle form subclass because the...
authortjhunt <tjhunt>
Tue, 20 Nov 2007 15:08:05 +0000 (15:08 +0000)
committertjhunt <tjhunt>
Tue, 20 Nov 2007 15:08:05 +0000 (15:08 +0000)
$errors = parent::validation($data, $files);

which is what you naturally want to do if you are used to object oriented programming.

Merged from MOODLE_19_STABLE.

lib/formslib.php

index 0ad3809f93e3e1ffdc620c9b47d5b285af978acc..f4285da203f3474378b86f0bce5633989926010d 100644 (file)
@@ -511,10 +511,11 @@ class moodleform {
      *
      * @param array $data array of ("fieldname"=>value) of submitted data
      * @param array $files array of uploaded files "element_name"=>tmp_file_path
-     * @return bool array of errors or true if ok "element_name"=>"error_description"
+     * @return mixed an array of "element_name"=>"error_description" if there are errors.
+     *      true or an empty array if everything is OK.
      */
     function validation($data, $files) {
-        return true;
+        return array();
     }
 
     /**