Merge branch 'wip-mdl-37339-m23' of git://github.com/rajeshtaneja/moodle into MOODLE_23_STABLE

This commit is contained in:
Aparup Banerjee
2013-01-22 16:28:53 +08:00
+13 -3
View File
@@ -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}