Fix customer email length validation before save (#40842)#40844
Open
ajith107 wants to merge 2 commits into
Open
Fix customer email length validation before save (#40842)#40844ajith107 wants to merge 2 commits into
ajith107 wants to merge 2 commits into
Conversation
Validate email length against the 255-character database limit during customer save to return a user-friendly error instead of exposing websiteId in a NoSuchEntityException. Fixes magento#40842 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Hi @ajith107. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
Contributor
Author
|
@magento run all tests |
Address PR review feedback by reusing the existing Customer module i18n string that states the 255-character limit. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
@magento run all tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Magento\Customer\Model\Validator\Emailto validate customer email length against the 255-character database limit (customer_entity.email).savevalidation group so validation runs for storefront registration, admin, API, and other save paths."Email" uses too many characters.message instead of a rawNoSuchEntityExceptionthat exposeswebsiteId.Fixes #40842
Issue
When registering with an email longer than 255 characters, Magento attempted to save to the database and then failed with:
Manual testing
/customer/account/createwith 256+ character email shows"Email" uses too many characters.Automated testing
Test plan