-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,7 +224,7 @@ public function getTargetStorePostData(\Magento\Store\Model\Store $store, $data | |
{ | ||
$data[\Magento\Store\Api\StoreResolverInterface::PARAM_NAME] = $store->getCode(); | ||
return $this->_postDataHelper->getPostData( | ||
$this->getUrl('stores/store/switch'), | ||
$store->getCurrentUrl(false), | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
hostep
Contributor
|
||
$data | ||
); | ||
} | ||
|
@nikshostko, @balex13: I believe this change is incorrect.
We backported MAGETWO-64885 on top of Magento 2.1.7, because we were getting endless redirect loops when using multiple domains, which this commit seems to fix.
But when you now switch using the language switcher, you go to a url with '?___store=storeLanguage1', and then when you switch back again, you end up with the '?___store=storeLanguage1?___store=storeLanguage2' query in your url and this crashes then because Magento can't find a storecode 'storeLanguage1?___store=storeLanguage2'
I can get rid of the problem by using:
But this doesn't feel like the correct solution.
I believe the issue may be deeper, probably in:
Magento\Store\Model\Store::getCurrentUrl
I think the assignment of the
$requestString
variable is a mistake, because the query parameters are included in that variable, and then later at the bottom, some extra query parameters are added, so it is possible to end up with two '?___store=xxxx' params in the url.I think
$this->_request->getRequestString()
should be replaced with$this->_request->getOriginalPathInfo()
, but I'm not sure if this will break other functionalities in Magento...This is just what I quickly discovered, I'll try to verify this on a clean installation from the develop branch later on and create a proper issue, but I'm in a bit of a hury now, so I decided to quickly write down what I discovered for now.