Skip to content

Customer name validation is failed if name contains only special characters #38199

Open
@KaushikChavda

Description

@KaushikChavda

Preconditions and environment

  • Magento version Adobe Commerce ver. 2.4.5-p5
  • Suppose you have various old customer which was created in 2020 and only contains special characters
  • then name validator \Magento\Customer\Model\Validator\Name::isValidName is failed
  • Method should be validated name like this.
private function isValidName($nameValue)
    {
        if ($nameValue != null) {
            if (preg_match(self::PATTERN_NAME, $nameValue, $matches)) {
                return $matches[0] == $nameValue;
            } else {
                return false;
            }
        }

        return true;
    }
  • Anything else that would help a developer reproduce the bug

Steps to reproduce

  • Update any customer's first name and last name with special characters only
  • then open that customer from the backend Magento
  • and just shave that customer Magento

Expected result

we should get the errors like this,

  1. First Name is not valid!
  2. Middle Name is not valid!
  3. Last Name is not valid!

Actual result

its saved the customer with the special charactersIt

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area: AccountComponent: UserIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Progress: PR in progressReported on 2.4.5-p5Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions