Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

sargan89
Copy link

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 (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Nov 23, 2019

Hi @sargan89. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

Copy link
Member

@sivaschenko sivaschenko left a 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 (_). '
Copy link
Member

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.

@sidolov sidolov changed the base branch from 2.3-develop to 2.4-develop December 5, 2019 17:12
@VladimirZaets VladimirZaets self-assigned this Dec 9, 2019
@VladimirZaets
Copy link
Contributor

@sargan89 , I am closing this PR now due to inactivity.
Please reopen and update if you wish to continue.
Thank you for collaboration

@m2-assistant
Copy link

m2-assistant bot commented Dec 9, 2019

Hi @sargan89, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@sargan89 sargan89 reopened this Mar 23, 2020
@m2-assistant
Copy link

m2-assistant bot commented Mar 23, 2020

Hi @sargan89. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@m2-assistant
Copy link

m2-assistant bot commented Mar 23, 2020

Hi @sargan89, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

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

Successfully merging this pull request may close these issues.

5 participants