Merge branch 'wip-mdl-37339-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE
This commit is contained in:
+13
-3
@@ -129,9 +129,19 @@ class profile_field_base {
|
||||
global $DB;
|
||||
|
||||
$errors = array();
|
||||
/// Check for uniqueness of data if required
|
||||
if ($this->is_unique()) {
|
||||
$value = (is_array($usernew->{$this->inputname}) and isset($usernew->{$this->inputname}['text'])) ? $usernew->{$this->inputname}['text'] : $usernew->{$this->inputname};
|
||||
// Get input value.
|
||||
if (isset($usernew->{$this->inputname})) {
|
||||
if (is_array($usernew->{$this->inputname}) && isset($usernew->{$this->inputname}['text'])) {
|
||||
$value = $usernew->{$this->inputname}['text'];
|
||||
} else {
|
||||
$value = $usernew->{$this->inputname};
|
||||
}
|
||||
} else {
|
||||
$value = '';
|
||||
}
|
||||
|
||||
// Check for uniqueness of data if required.
|
||||
if ($this->is_unique() && (($value !== '') || $this->is_required())) {
|
||||
$data = $DB->get_records_sql('
|
||||
SELECT id, userid
|
||||
FROM {user_info_data}
|
||||
|
||||
Reference in New Issue
Block a user