From 6a08c83042fcf5465e8527705161f4002304fb89 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Fri, 7 Nov 2008 12:49:11 +0000 Subject: [PATCH] MDL-17151 DB 2.0 syntax: fixed wrong usage in previous commit --- user/profile/lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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'); } -- 2.39.5