-
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
Magento 2.2 fix Home Page error if store view is not defined #11453
Comments
Patch does not look good to me. On line 168 Obtaining default store code logic is placed in |
@orlangur You have right . from if (null === $this->currentStoreId) { to (solution 1) if (null === $this->currentStoreId || '' === $this->currentStoreId) { or shortest (solution 2 as in Magento 2.1.9 version) if (!$this->currentStoreId) { This works well for me, though there has to be a reason why this line has been modified in Magento 2.2.0 version, but I still do not understand why. Probably because the 'store_id' of the administration panel is '0', in this case solution 1 should be better. Sicurly the null value of |
@selusi, thank you for your report. |
I am working on it at #mm17es |
Impossible to reproduce the error. Magento Version: 2.2.1-dev Open url in a new browser and type url with store code and every thing works properly. No one modified this file '/app/code/Magento/Store/Model/StoreManager.php' since 5/8/17, so maybe someone fix it in a high level. |
I think this was solved with #11337 |
@sbaixauli the error is only displayed if you type a url without a store code. |
Caution: Please note that it even appears, if the home page is generally working, but if you go to the home page with a GET Parameter, any Query String will cause that error. That means you will have big trouble with Google AdWords, because GA adds a Query String to the URL, when clicking the link. This is quite serious in my opinion. |
@selusi 's provided fix helped - if (null === $this->currentStoreId) {
+ if (null === $this->currentStoreId || '' === $this->currentStoreId) { |
The below fix, will hide the buttons "add root category" and "add sub category" under admin->categories...
So, plz go with following solution with little change.
Thanks, |
Preconditions
Steps to reproduce
Expected result
Actual result
To fix the issue
Must change the method getStore() in Magento\Store\Model\StoreManager.
To avoid home page error in frontend. If $storeId is not defined: It retrive data from COOKIE first, otherwise return the default store code.
At line 164 add the below patch:
The text was updated successfully, but these errors were encountered: