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

Config scope naming ambiguity #3876

Closed
pantaoran opened this issue Mar 23, 2016 · 3 comments
Closed

Config scope naming ambiguity #3876

pantaoran opened this issue Mar 23, 2016 · 3 comments

Comments

@pantaoran
Copy link

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.

interface ScopeInterface
{
    /**#@+
     * Scope types
     */
    const SCOPE_STORES = 'stores';

    const SCOPE_WEBSITES = 'websites';

    const SCOPE_STORE   = 'store';
    const SCOPE_GROUP   = 'group';
    const SCOPE_WEBSITE = 'website';
    /**#@-*/
}

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...

@oserediuk
Copy link
Contributor

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.

@pantaoran
Copy link
Author

When I opened this issue I was using 2.0.2

@piotrekkaminski
Copy link
Contributor

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.

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

No branches or pull requests

6 participants