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 sometimes doesn't select the correct store if the scope code is null #16298

Closed
wants to merge 1 commit into from
Closed

Magento sometimes doesn't select the correct store if the scope code is null #16298

wants to merge 1 commit into from

Conversation

fratob85
Copy link

@fratob85 fratob85 commented Jun 21, 2018

Description:
The method resolve() of the class Magento/framework/App/Config/ScopeCodeResolver doesn't select the correct store if the $scopeCode parameter in null on multi-store sites. In this case the value is retrieved with the wrong $scopeCode value.

Preconditions:
Magento v. 2.2.x or 2.3dev

Expected result:
The site switch to correct store in any cases.

Current result:
When the resolve method is called with null value then the resolvedScopeCodes[$scopeType] array gets an entry with null key wich has the resolved scope as value. If then the scope is switched and the resolve method is again called with null value then the value returned is not correct. This has been seen happening by us randomly in store language resolution.

Proposed solution:
If the store code of the method resolve() is called with a null scopeCode parameter then the scopeCode is changed after its evaluation so that the resolvedScopeCodes[$scopeType] array never has a null key value.

…Code

parameter then the scopeCode is changed after its evaluation so that the
resolvedScopeCodes[$scopeType] array never has a null key value.
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Jun 21, 2018

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team
Copy link
Contributor

Hi @fratob85. 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-engcom-team give me test instance - deploy test instance based on Pull Request changes
  • @magento-engcom-team give me new test instance - deploy NEW test instance based on Pull Request changes
  • @magento-engcom-team give me {$VERSION} instance - deploy Vanilla Magento instance for Issue or Pull Request

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

@phoenix128 phoenix128 added Partner: MageSpecialist partners-contribution Pull Request is created by Magento Partner labels Jun 21, 2018
@sidolov
Copy link
Contributor

sidolov commented Jun 22, 2018

Hi @fratob85 , looks like your commit was pushed with the different email. Please, make the new commit with email used for your GitHub account or add email from the commit to your profile.

@fratob85
Copy link
Author

fratob85 commented Jun 22, 2018

Hi @sidolov, I just added and verified the correct email to my profile.

@magento-engcom-team
Copy link
Contributor

@fratob85 thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@molneek
Copy link
Contributor

molneek commented Sep 8, 2018

#khcd2018

@molneek molneek self-assigned this Sep 8, 2018
molneek added a commit to molneek/magento2 that referenced this pull request Sep 8, 2018
molneek added a commit to molneek/magento2 that referenced this pull request Sep 8, 2018
molneek added a commit to molneek/magento2 that referenced this pull request Sep 8, 2018
@molneek molneek mentioned this pull request Sep 8, 2018
4 tasks
molneek added a commit to molneek/magento2 that referenced this pull request Sep 8, 2018
molneek added a commit to molneek/magento2 that referenced this pull request Sep 8, 2018
molneek added a commit to molneek/magento2 that referenced this pull request Sep 8, 2018
molneek added a commit to molneek/magento2 that referenced this pull request Sep 8, 2018
@matthew-muscat
Copy link
Contributor

@fratob85 @molneek — this looks like a duplicate of issue #16939 (pull ref #16940)

Does pull ref #16940 resolve this? I noted that this implementation is a little different?

@sivaschenko
Copy link
Member

Close as duplicate to #18820

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.

8 participants