People with only one name

People with only one name

by Patrick Mulvany -
Number of replies: 1

We have some people who only have one name that they normally use as their surname.

What is the best way to deal with these people as user profile etc normally treat first name as mandatory and are there any areas of Moodle that may be particually destablaised by such users?

Thanks

Average of ratings: -
In reply to Patrick Mulvany

Re: People with only one name

by Purnendu Dash -
Picture of Plugin developers

Hello Patrick,

It’s so nice to meet fellow Moodlers in this virtual space. I’ve seen your problem and allow me to try my hands on so that your problem gets resolved.

Coming to your problem; well, there’s an option, but this needs to be implemented with little touch of coding.

When an user profile is created, the First name and the Last name fields are mandatory.  If you don’t want the First name field to be mandatory, please follow the steps mentioned below:

1.)    Go to your Moodle folder; browse the user folder and open the file editlib.ph with any editor, for example notepad

Path: -  your_Moodle_folder/user/editlib.php

2.)    Search with the following keyword (using ctrl+f)

$mform->addRule('firstname', $strrequired, 'required', null, 'client');

Then replace the above line with

$mform->addRule('firstname', $strrequired, ' ', null, 'client');

 Save the file.

After performing this, please feel free to create any user.

Hope this’ll resolve your issue. Keep Moodling!

Purnendu

Developer