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

Magento 2 Store Code validation regex: doesn't support uppercase letters in scope code #25668

Closed
attheCube opened this issue Nov 20, 2019 · 21 comments
Labels
Component: Store Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: done Reported on 2.3.3 Indicates original Magento version for the Issue report. Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. stale issue

Comments

@attheCube
Copy link

attheCube commented Nov 20, 2019

Preconditions (*)

  1. Magento v2.3.3
  2. Magento 2.4-develop

Steps to reproduce (*)

  1. Setup stores/store-groups/websites with uppercase scope codes via setup script.
  2. Try to use to show configuration for this store via console.
    => bin/magento config:show --scope=store --scope-code=de_AT

Expected result (*)

  1. Output of store configuration

Actual result (*)

  1. Output of error message:
    "The scope code can include only lowercase letters (a-z), numbers (0-9) and underscores (_). Also, the first character must be a letter."

Similar report: #11996

This report resulted in adjustment of the error message because the former reporter had no good reason.

One good reason why it should be possible to use uppercase letters in store code, is to differentiate regions in store code. Especially for using storecodes within url.
So you could use at least 'de_DE', 'de_AT', 'en_US' or 'en_UK' as store codes, which is very useful in urls.

To be RFC 4646 (https://tools.ietf.org/html/rfc4646) conform, there has to be the possibility to use hyphens for store codes, too.

Surely it would be possible to do something weird by having this possibility, but that lies in the responsibility of the projects lead.

Additonal information:

See comment

@m2-assistant
Copy link

m2-assistant bot commented Nov 20, 2019

Hi @attheCube. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

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

@attheCube do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Nov 20, 2019
@attheCube attheCube changed the title Magento 2 Store Code validation regex: doesn't support uppercase letters in store code Magento 2 Store Code validation regex: doesn't support uppercase letters in scope code Nov 20, 2019
@AnnaShepa
Copy link
Contributor

@magento give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @AnnaShepa. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@AnnaShepa AnnaShepa self-assigned this Nov 20, 2019
@m2-assistant
Copy link

m2-assistant bot commented Nov 20, 2019

Hi @AnnaShepa. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@magento-engcom-team
Copy link
Contributor

Hi @AnnaShepa, here is your Magento instance.
Admin access: https://i-25668-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@attheCube
Copy link
Author

Hi,
thanks for the instance to test.
In administration and in frontend no message are thrown in this instance.
But the message is thrown while using bin/magento config:show --scope=stores --scope-code=de_AT as I mentioned above and I don't have access to console to test.

The error message is thrown in the following files:

  • vendor/magento/framework/App/Config/Scope/Validator.php
  • vendor/magento/framework/App/Scope/Validator.php

The regular expression in these files does not allow uppercase characters.

It seems that this validation functionality is not used for saving scopes and using store codes in url, but it is used for the config-command and may be for setting store-codes via environment variables also.

@AnnaShepa AnnaShepa added Component: Store Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Nov 20, 2019
@ghost ghost unassigned AnnaShepa Nov 20, 2019
@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Nov 20, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @AnnaShepa
Thank you for verifying the issue. Based on the provided information internal tickets MC-29015 were created

Issue Available: @AnnaShepa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@AnnaShepa
Copy link
Contributor

@attheCube thank you for update, I managed to reproduce it as well
One more note: when I tried to change store name from admin BO, on save I've got the same error, but it was saved.

@sargan89 sargan89 self-assigned this Nov 23, 2019
@m2-assistant
Copy link

m2-assistant bot commented Nov 23, 2019

Hi @sargan89. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


@ghost ghost unassigned sargan89 Dec 9, 2019
@Usik2203 Usik2203 self-assigned this Mar 11, 2020
@m2-assistant
Copy link

m2-assistant bot commented Mar 11, 2020

Hi @Usik2203. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


@Usik2203 Usik2203 added the Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch label Mar 11, 2020
@ghost ghost assigned sargan89 and unassigned sargan89 Mar 23, 2020
@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Apr 2, 2020

Hi @attheCube @Usik2203,

Changing of this behavior could negatively affect some merchants, but I can't see any reason why we do need to change it, except just because we want to.
Actually store code IS NOT the same as lang code, so link to RFC isn't relevant. Could you explain your use case, why you can't use for instance de_at instead of de_AT?

@ghost ghost removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development labels Oct 30, 2020
@ghost ghost unassigned Usik2203 Oct 30, 2020
@ihor-sviziev ihor-sviziev added the Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. label Nov 13, 2020
@ihor-sviziev ihor-sviziev removed their assignment Nov 13, 2020
@engcom-Delta engcom-Delta self-assigned this Nov 13, 2020
@m2-assistant
Copy link

m2-assistant bot commented Nov 13, 2020

Hi @engcom-Delta. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Delta engcom-Delta added Reported on 2.3.3 Indicates original Magento version for the Issue report. Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Nov 13, 2020
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Delta
Thank you for verifying the issue. Based on the provided information internal tickets MC-39077 were created

Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@engcom-Delta engcom-Delta added the Priority: P3 May be fixed according to the position in the backlog. label Nov 13, 2020
@stale
Copy link

stale bot commented Jan 28, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!

@stale stale bot added the stale issue label Jan 28, 2021
@stale stale bot closed this as completed Feb 11, 2021
@magento-engcom-team magento-engcom-team removed the Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch label Feb 11, 2021
@magento-engcom-team
Copy link
Contributor

Unfortunately, we are archiving this ticket now as it did not get much attention from both Magento Community and Core developers for an extended period. This is done in an effort to create a quality, community-driven backlog which will allow us to allocate the required attention more easily.

Please feel free to comment or reopen according to the Issue reporting guidelines
the ticket if you are still facing this issue on the latest 2.x-develop branch. Thank you for collaboration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Store Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: done Reported on 2.3.3 Indicates original Magento version for the Issue report. Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. stale issue
Projects
Development

No branches or pull requests

10 participants