-
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
Config scope naming ambiguity #3876
Comments
Hello! Please, provide the used version. If the problem is actual for a specific branch, please, specify it and be sure that the latest update was used. |
When I opened this issue I was using 2.0.2 |
Thank you for your submission. We recently made some changes to the way we process GitHub submissions to more quickly identify and respond to core code issues. Feature Requests and Improvements should now be submitted to the new Magento 2 Feature Requests and Improvements forum (see details here). We are closing this GitHub ticket and have moved your request to the new forum. |
[2.3.1-release] Bug Fixes
I observe that in
app/code/Magento/Store/Model/ScopeInterface.php
there are 5 different scope type constants which are ambiguous and probably should be unified.Both "store/stores" and "website/websites" exist once in singular and once in plural. It is not clear to the developer in any way which one should be used.
We ran into this problem today in our team, where I wrote code to set some config values, and another team member wrote code to read them, but I used the plural constants and he used the singular ones. We didn't notice the problem for weeks because we always tested with the default config values and didn't bother to set storeview-specific ones, and even when we did, I guess they must use a fall-back to default scope values when the store specific ones are not found.
I searched through the core code for use, and both versions seem to be used, although the singular versions are used much more often. Can we please simplify this important interface to only use one spelling per type?
Or is there a compelling reason to keep both singular and plural for these that I'm not understanding? I feel strange for bringing this up here because I can't possibly be the first person to notice this...
The text was updated successfully, but these errors were encountered: