Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'wip-mdl-37339-m24' of git://github.com/rajeshtaneja/moo…

…dle into MOODLE_24_STABLE
  • Loading branch information...
commit 1c7c33b314e1787d03fe8e486a8526427f37a666 2 parents 13d0393 + 30595c2
@nebgor nebgor authored
Showing with 13 additions and 3 deletions.
  1. +13 −3 user/profile/lib.php
View
16 user/profile/lib.php
@@ -129,9 +129,19 @@ function edit_validate_field($usernew) {
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}
Please sign in to comment.
Something went wrong with that request. Please try again.