-
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
[2.2.0-rc3.0] Language switcher is broken when using multiple times #10908
Comments
@hostep thank you for your bug report. |
Apparently the issue only occurs from the homepage, starting working on it. |
@vrootwoot you still working on this? I have this issue too while I'm working on some other issue in the store switcher |
@BlackIkeEagle won't have the time to fix it. Apparently correct way would be to add changes to getTargetStorePostData |
In addition to changing the line of code suggested by hostep, to also remove "?___ store". Change line 228 "$store->getCurrentUrl(false)," to "$this->getUrl ('stores/store/switch' ), "from the file" module-store \ Block \ Switcher.php " |
However, the bug is much more complex, because if you change the language on page of the product details or on a category page the app give a not found page, because does not translate the urlrewrite. |
The @LuisChaves solution solves the problem definitively, but at this point the getCurrentUrl method in the Store class is absolutely useless. I've deleted the getCurrentUrl () method from Magento \ Store \ Model \ Store and modified line 228 of the getTargetStorePostData function in Magento \ Store \ Block \ Switcher as follows: $this->getUrl('stores/store/switch', ['_secure' => $this->_storeManager->getStore()->isCurrentlySecure()]), Finally everything works well. NOTE: I would like to point out another bug in the store module, which I found a solution to the following link: |
@selusi: just FYI, you've changed the code back to how it was before commit 508f1ef, in this commit, they fixed the storeswitcher when you work with multiple domain names since it used to store the wrong store code in a cookie which has as a result that we ended up in an endless redirect from one domain name to the other. (unrelated, but this page might be worth checking out for formatting your comments on github a bit better: https://guides.github.com/features/mastering-markdown/, please check the 'code' tab in the Examples 😉) |
the issue has been fixed and delivered to 2.2-develop branch. WIll be available with 2.2.2 release |
Hi @hostep. Thank you for your report.
The fix will be available with the upcoming patch release. |
@magento-engcom-team the link doesn't work .. |
It's not good code, and it's not thoroughly tested, but here's a temp fix if you're currently experiencing this issue:
Let me know if it works for you. |
Preconditions
Steps to reproduce
https://example.com/?___store=en
https://example.com/?___store=en?___store=nl
and the shop crashesExpected result
https://example.com/?___store=nl
and the shop shouldn't crashActual result
https://example.com/?___store=en?___store=nl
and the shop crashes with the message:Discussion
This was only very recently broken, in commit: c3ea1f5, the changes in the file
lib/internal/Magento/Framework/App/Request/Http.php
cause this.Also: please change this typo from
removeRepitedSlashes
toremoveRepeatedSlashes
, so this method has the same name as in Magento 2.1Possible solution
If we change this line from:
to:
It works again as expected, but I'm not sure yet if this is the correct solution.
The text was updated successfully, but these errors were encountered: