]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17151 DB 2.0 syntax: fixed wrong usage in previous commit
authorstronk7 <stronk7>
Fri, 7 Nov 2008 12:49:11 +0000 (12:49 +0000)
committerstronk7 <stronk7>
Fri, 7 Nov 2008 12:49:11 +0000 (12:49 +0000)
user/profile/lib.php

index 418769bbc0f41a33675dec87245bf419a2b814de..16656aeadc21a5a4b03818c24da54ac68af3a2c0 100644 (file)
@@ -110,10 +110,12 @@ class profile_field_base {
      * @return  string  contains error message otherwise NULL
      **/
     function edit_validate_field($usernew) {
+        global $DB;
+
         $errors = array();
         /// Check for uniqueness of data if required
         if ($this->is_unique()) {
-            if ($userid = get_field('user_info_data', 'userid', 'fieldid', $this->field->id, 'data', $usernew->{$this->inputname})) {
+            if ($userid = $DB->get_field('user_info_data', 'userid', array('fieldid'=>$this->field->id, 'data'=>$usernew->{$this->inputname}))) {
                 if ($userid != $usernew->id) {
                     $errors["{$this->inputname}"] = get_string('valuealreadyused');
                 }