-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
3.4
-
MOODLE_34_STABLE
-
Example of issue:
If Joe Bloggs has a UserInfoField of Department with the value: Computing
and the external DB changes the department to Music it updates correctly.
However if Joe Bloggs was created with an empty Department field.
When the external DB changes the department to Music it does not update.
Code at fault:
if (isset($user->{$key}) and $user->{$key} != $value) { |
Should not have the isset part as if the value is not set yet the new value needs to be set.
Proposed solution (two options)
if ($user->{$key} != $value) { |
OR:
if ((isset($user->{$key}) AND $user->{$key} != $value) OR (!isset($user->{$key}) AND isset($value)) { |
For Simplicity I would recommend the first option, but either would work.
- will be (partly) resolved by
-
MDL-40613 Auth LDAP does not sync custom fields from LDAP to local moodle DB
-
- Closed
-