-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
25668: Adjust store code validation #25712
Conversation
Hi @sargan89. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sargan89 thanks for the pull request!
Please take a look at my comment. The validation message should be changed as well for consistency.
Also, it would be really good to cover this code with unit tests to ensure the validation works as expected and to avoid future possible bugs.
Finally, please take a look at failed static tests - your change triggered the static tests revalidation for the whole file, it would great if can fix those!
Thank you!
@@ -83,7 +83,7 @@ private function validateScopeCode($scopeCode) | |||
throw new LocalizedException(new Phrase('A scope code is missing. Enter a code and try again.')); | |||
} | |||
|
|||
if (!preg_match('/^[a-z]+[a-z0-9_]*$/', $scopeCode)) { | |||
if (!preg_match('/^[a-z]+[a-z0-9_]*$/i', $scopeCode)) { | |||
throw new LocalizedException(new Phrase( | |||
'The scope code can include only lowercase letters (a-z), numbers (0-9) and underscores (_). ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please correct the exception message as well (remove lowercase
from it) as it now accesses both lowercase and uppercase letters.
@sargan89 , I am closing this PR now due to inactivity. |
Hi @sargan89, thank you for your contribution! |
…validateScopeCode for uppercase.
Hi @sargan89. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
Hi @sargan89, thank you for your contribution! |
Description (*)
According to the issue request, I adjusted the store code validation to able uppercase letters.
Fixed Issues (if relevant)
#25668
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)