Only lowercase letters allowed

Only lowercase letters allowed

by Kenneth Mentor -
Number of replies: 8

I get the "Only lowercase letters allowed" error when trying to update a user profile, even if no changes are made.

Using 3.3.2, have looked at comments from 2014-15, tried offered solutions, but none seem to apply. 

Debug info:

Only lowercase letters allowed

More information about this error

×Debug info: 
Error code: usernamelowercase
×Stack trace:
  • line 141 of /user/lib.php: moodle_exception thrown
  • line 207 of /user/editadvanced.php: call to user_update_user()

Average of ratings: -
In reply to Kenneth Mentor

Re: Only lowercase letters allowed

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Kenneth,

even if no changes are made.

What do you mean? Just by entering that user profile?
What is the case of the letters composing the username in that profile?
Does it happen for each user profile?

TIA,
Matteo

In reply to Matteo Scaramuccia

Re: Only lowercase letters allowed

by Kenneth Mentor -

Thank you, Matteo,

Your question pointed me to a solution, which I will share since others may have the same problem.

This is a newly installed site, with only an administrative user. I tried to update that user's profile but the error occurred with each change. The username was capitalized and could only be changed with database access, which fixed the problem.

Not sure how the capitalized username was allowed from the start, but that was the problem. The installation process probably should have caught this, or perhaps this is an issue with the installation process provided by my web host.

Ken

In reply to Kenneth Mentor

Re: Only lowercase letters allowed

by Ken Task -
Picture of Particularly helpful Moodlers

Was going to ask similar questions but Matteo already posted a response. 

However, not sure this is a moodle issue if installed manually, but how it was installed by provider ... the default suggested initial user which would be the 1st account and the 1st admin level user is lower case.   In moodle itself the setting for allowing caps/other characters is by default off.

This to say, if you used some script provided by your hosting provider, it could have been that script.   Informing the customer of their admin level accounts in whatever app installed by script is usually presented to the customer.   The described problem  sorta indicates it was already a cap and op (you) were trying to correct it/make it lower case.

The only other possibility would be if installers browser auto caps the first letter of dialog boxes asking for a 'name'.

The only reason I'm even posting this is that I've had previous experiences in assisting others remotely hosted that had similar issue.

'spirit of sharing', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: Only lowercase letters allowed

by Kenneth Mentor -

I retraced my steps after suspecting the Softaculous installation at my remote host was the problem. The default "admin" was in lower case, but I (who should have known better) changed this and used a capital letter. The installation went well but the user had a capital letter that could not be changed without editing the database.

Thanks for sharing. This problem may have taken me days to figure out when I first started using Moodle. The 'spirit of sharing" has saved me many hours and I've learned a great deal in the process.

In reply to Kenneth Mentor

Re: Only lowercase letters allowed

by Ken Task -
Picture of Particularly helpful Moodlers

Thanks ... for kind comment and re-tracing steps.   When one installs via command using the install.php file that comes with the code, one cannot use uppercase (don't think - never tried to really) and one has to follow the 8-1-1-1 restriction on the password.  Plus the setting for not to allow caps/other charactors is already set.  

It appears that Softaculous doesn't use the built in moodle code but something of it's own.   Softaculous is commercial and they don't open source their code so good chance that no one in Moodle community forums can correct the script.  Maybe someone from Softaculous should lurk in these forums to see what's wrong with their script! ;)

If you want to help them out, report the issue to your provider who will then hopefully work with Softaculous to fix it.

'spirit of sharing', Ken

Average of ratings: Useful (1)
In reply to Kenneth Mentor

Re: Only lowercase letters allowed

by College of Opticians of Alberta COA -

Thank you for sharing your solution, Kenneth. I'm having the exact same problem; I installed Moodle with Softaculous, and used my organization's acronym as the admin name (all caps), and when I try to make changes, it gives me the same error. I don't know where specifically to look to fix this problem. Do you have more details about what to modify in the database for someone with limited knowledge and experience (hence the reason I used Softaculous to install Moodle in the first place)?


Thank you again for taking the time to document it. I'm glad to have found this information right away, or I would have had no idea how to proceed.

Kalen

In reply to College of Opticians of Alberta COA

Re: Only lowercase letters allowed

by Kenneth Mentor -

Kalen,

You will need to access the database, which is not difficult if you have cPanel hosting or other phpMyAdmin access. Open the Moodle database (probably named _mdl, _mooxx, or similar), find the mdl_user table (or mdlxx_user, but always _user), click that file name, find the capitalized user, edit, and save. 

This should work, although more seasoned users may have a better method (or offer clearer instructions).

Ken

In reply to Kenneth Mentor

Re: Only lowercase letters allowed

by Marcel Van Amelsvoort -

I realize that this thread is a little dated now, but I'm having the same problem, where I'm unable to change the profile of the admin because of the capitalization of the username.  My Moodle was installed by Softaculous.

I've looked at  (searched)  the files in the cPanel but can't seem to find the one what contains the name to edit it. Ken's description pointed me in the direction of a solution, but I can't seem to find the file. If anyone can be more specific, I'd appreciate it.