-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.x]: User's Last Name field letter casing lost when saved via front-end form #14723
Comments
Craft isn’t doing anything to alter the casing, and neither is the name parsing library we use, as far as I can tell. Name casing is preserved on my end whether I submit separate Maybe you have something in your JavaScript that is normalizing names on form submit? Or a plugin/module that is doing something? |
You're right, seems like a Freeform issue. Thank you! |
@brandonkelly Some additional information from the Solspace team regarding this issue can be found in the discussion linked below.
|
Sorry! I’m able to reproduce now. I’m not sure why I couldn’t earlier… I think I might have been testing the opposite of what you were saying – ensuring that lowercased Just got this fixed for the next release. |
@brandonkelly Great, thank you so much! |
Craft 4.8.10 and 5.0.5 are out with that fix. Thanks for bearing with me! |
What happened?
Description
I've read the past issues dealing with Full/First/Last Names, but am a little unclear on how to handle the following:
Let's take last name "van holtz" as an example. I want it always shown as Van Holtz. However, say another person with the same last name wants it displayed as "van Holtz". Craft's Last Name field seems inconsistent on how it handles this. It lower-cases the "van" when saved via a front-end form, but does maintain casing when saved from the CP. I thought maybe including both in
extraLastNamePrefixes
might work, but it seems to only go with one.Note: The Full Name field correctly uses the written case even from a front-end form (even when a "Full Name" field isn't provided and it's generated automatically).
Consideration: Due to how I want to present a user's name on the website I need it to be in 2 parts (first, last) so that I can output and style them individually (I need them on 2 lines).
Steps to reproduce
general.php
'showFirstAndLastNameFields' => true,
Expected behavior
The letter casing of the last name should be kept when saving from a front-end form like it is in the CP. Whether or not the user wants something like "Van Holtz" or "van Holtz".
Actual behavior
The "Van" in "Van Holtz" is saved as "van Holtz".
Craft CMS version
4.8.6
PHP version
8.1.27
Operating system and version
MacOS Sonoma 14.3.1
Database type and version
MySQL 8.0.30
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: