Skip to content

[5.x]: useEmailAsUsername(true) is set, but the Username field is still visible. #15401

@pbmills

Description

@pbmills

What happened?

Description

I have added useEmailAsUsername(true) in general.php, but the Username field is still visible in the CMS users.

General.php

<?php
/**
 * General Configuration
 *
 * All of your system's general configuration settings go in here. You can see a
 * list of the available settings in vendor/craftcms/cms/src/config/GeneralConfig.php.
 *
 * @see \craft\config\GeneralConfig
 */

use craft\config\GeneralConfig;
use craft\helpers\App;

return GeneralConfig::create()
    ->isSystemLive(App::env('IS_SYSTEM_LIVE') ?? true)
    ->devMode(App::env('DEV_MODE') ?? false)
    ->allowAdminChanges(App::env('ALLOW_ADMIN_CHANGES') ?? false)
    ->disallowRobots(App::env('DISALLOW_ROBOTS') ?? false)
    ->testToEmailAddress(App::env('TEST_TO_EMAIL_ADDRESS') ?? false)
    ->cpTrigger(App::env('CP_TRIGGER') ?? 'admin')
    ->allowUpdates(App::env('ALLOW_UPDATES') ?? true)
    ->errorTemplatePrefix('_exceptions/')
    ->brokenImagePath('@webroot/dist/images/fallback.png')
    ->maxUploadFileSize('25M')
    ->omitScriptNameInUrls(true)
    ->defaultWeekStartDay(1)
    ->useEmailAsUsername(true)
    ->cpHeadTags([
        ['link', ['rel' => 'icon', 'href' => '/dist/favicons/favicon.ico']],
    ])
    ->cpTrigger('webadmin')
    ->aliases([
        '@webroot' => dirname(__DIR__) . '/web',
    ])
;
Screenshot 2024-07-23 at 12 10 24 PM

Can you help me if I am missing something?

Craft CMS version

5.2.8

PHP version

8.2.18

Operating system and version

Linux 6.6.31-linuxkit

Database type and version

MySQL 8.0.33

Image driver and version

Imagick 3.7.0 (ImageMagick 6.9.11-60)

Installed plugins and versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions