General developer forum

Display custom [user profile field] in "Browse list of users"

 
Picture of Kyriakos Mavridis
Display custom [user profile field] in "Browse list of users"
 

I want to display a custom [user profile field] on page [Browse list of users]. I have created a custom [user profile field], with [short name] = [regnum], and added [$CFG->showuseridentity ='regnum';] in [config.php]. Page [Browse list of users] returns [Error reading from database]. When I change [regnum] to [email] (the build-in field) the page displays correctly.

I am thinking that maybe when it comes to custom user profile fields, the short field name must be prepended with a suffix, in [$CFG->showuseridentity ='regnum';]. Thank you for your help and I apologize if this question has already been answered somewhere in the forum.

 
Average of ratings: -
Picture of Michael Aherne
Re: Display custom [user profile field] in "Browse list of users"
Core developersParticularly helpful MoodlersPlugin developers

Only built-in fields can be used in the user identity (i.e. columns in the user table). It would be fantastic to be able to use custom profile fields but that's not a feature of Moodle at the moment.

Quite a few institutions hijack one of the built-in fields to show registration number, so you might want to consider that (we use msn). It's a horrible hack but registration number is such an important identifier in universities that it has to be available in the identity.

 
Average of ratings: Useful (1)
Picture of Kyriakos Mavridis
Re: Display custom [user profile field] in "Browse list of users"
 

Thank you very much for your reply. Indeed, the registration number is maybe the single most important identifier when it comes to university students. Maybe the Moodle development team could consider re-purposing one of the <<least>> important build-in fields to serve as a registration number holder.

 
Average of ratings: -
Picture of AL Rachels
Re: Display custom [user profile field] in "Browse list of users"
Core developersParticularly helpful MoodlersPlugin developersTesters

One of the Optional fields is already named, ID number, and if that is not specific enough, you can use, Language customization, to change it. When customizing, search for those Optional fields in, core.

 
Average of ratings: -
Picture of Michael Aherne
Re: Display custom [user profile field] in "Browse list of users"
Core developersParticularly helpful MoodlersPlugin developers

The problem with that is that staff don't have registration numbers, so if you have some kind of automated user creation process you'll be using something else as idnumber (in our place it's a thing called "person code").

It would definitely be useful to be able to use custom profile fields in the user identity, but I could never see a good way to implement it that wouldn't be detrimental to performance.

 
Average of ratings: -