Search code examples
settingscase-sensitivetypo3-9.x

TYPO3 9.5.x feuser with uppercase letters


I want to allow upper case letters for frontendusers in TYPO3 9.5.x. When a new feuser self-registers via sfregister_form, it works, but when I add a feuser in the backend, the username gets converted to only lowercase letters. I found solutions here in the forum https://www.typo3.net/forum/thematik/zeige/thema/47903/ how to (propably) change it, but they only work in older versions of TYPO3. Since there has been lot of changes in TYPO3 since the 10 years old post and I found nothing that talks about TYPO3 9.5.x I ask the question here.


Solution

  • By default username field has set lower eval among others, the fast solution is rewriting it, i.e. if you have some own extension you can add this to its ext_table.php or Configuration/TCA/Overrides/fe_users.php

    $GLOBALS['TCA']['fe_users']['columns']['username']['config']['eval'] = 'nospace,trim,uniqueInPid,required';
    

    Note: you can do it within two files, and nowadays the second is more advised

    Note 2: Since TYPO3 ver 7.3 typo3conf/extTables.php is deprecated https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/7.3/Deprecation-65344-ExtTables.html

    • typo3conf/ext/yourext/ext_tables.php
    • typo3conf/ext/yourext/Configuration/TCA/Overrides/fe_users.php

    Works with 9.5.x as shown on screenshots:

    feuser editing

    TCA Configuration preview