Cannot edit user profiles set up via LDAP sync

Cannot edit user profiles set up via LDAP sync

by Matt Crouch -
Number of replies: 3

Hi,

This is a bit of an odd one. We've just upgraded from Moodle 3.5 to Moodle 3.7 both using LDAP authentication for our staff. 

On our user profiles we have 3 custom fields (an ID number specific to training, an indicator for if they're bank staff or permanent and a code to show their training profile). These fields are not in our Active Directory, so on Moodle they are left with Data mapping as blank, Update local as On creation, Update external as never, and Lock value as unlocked.

When a new member of staff joins, their account is set up by the LDAP sync job, which is really convenient smile we then add in the info to these other fields and save to set them up fully. This worked brilliantly on the 3.5 site, but there is a problem with the 3.7 site.

When the user profile is edited for any of these fields, it won't save and flags the username as being blank, even though the username is clearly visible in there.

I've tried switching it to a manual account, saving then switching back to an LDAP account and the same thing happens, the username is flagged as empty.

The same issue doesn't occur with accounts set up manually and kept as manual accounts, just those using LDAP. What am I missing?

Average of ratings: -
In reply to Matt Crouch

Re: Cannot edit user profiles set up via LDAP sync

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

There's a change in Moodle 3.7.1 causing this: MDL-64383. A new Tracker issue has been added, MDL-66071, but it's not resolved yet.

You could work around this by removing the change by editing user/editadvanced_form.php and commenting out the following line (should be line 102):

        $mform->addRule('username', get_string('required'), 'required', null, 'client');

Back up any files before changing them. (Usual disclaimer: In general modifying Moodle's source code isn't recommended as it gets in the way of keeping the version up to date and can introduce support issues).

Average of ratings: Useful (1)
In reply to Leon Stringer

Re: Cannot edit user profiles set up via LDAP sync

by Matt Crouch -

Thank you Leon, you're an absolute star smile That worked a treat!

In reply to Matt Crouch

Re: Cannot edit user profiles set up via LDAP sync [Solved]

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Just noting that MDL-66071 is fixed in Moodle 3.6.6 and 3.7.2. smile

Average of ratings: Useful (1)