From: stronk7 Date: Fri, 7 Nov 2008 12:49:11 +0000 (+0000) Subject: MDL-17151 DB 2.0 syntax: fixed wrong usage in previous commit X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=6a08c83042fcf5465e8527705161f4002304fb89;p=moodle.git MDL-17151 DB 2.0 syntax: fixed wrong usage in previous commit --- diff --git a/user/profile/lib.php b/user/profile/lib.php index 418769bbc0..16656aeadc 100644 --- a/user/profile/lib.php +++ b/user/profile/lib.php @@ -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'); }