magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Customer name validation is failed if name contains only special characters

Open KaushikChavda opened this issue 1 year ago • 16 comments

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

  • [X] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • [X] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • [X] 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.
  • [X] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

KaushikChavda avatar Nov 17 '23 11:11 KaushikChavda