Preconditions:
- Magento 2.2
 - With 2 store views ( default and en )
 
Steps to reproduce:
- Load home page: url = myeshop.com/
 - Switch store view: url = myeshop.com/?___store=en
 - Switch again store view: url = myeshop.com/?___store=en?___store=default
 
Result:
- There has been an error processing your request
 
When I set "Add Store Code to URL" to 'Yes' in Stores> Configuration> General> Web it works properly. But it is not accepted.
Previously, at 2.1.9 the url remained the same after any store view switch.
Any advice?
- 
 This bug fixed in Magento v2.2.2.likemusic– likemusic2017年12月14日 04:40:23 +00:00Commented Dec 14, 2017 at 4:40
 
2 Answers 2
I solve the same problem with a pice of Javascript code:
define([
 "jquery"
 ],
 function ($) {
 "use strict";
 $('a[data-post*="?___store=en?___store=tr"]').each(function(){
 var $link = $(this);
 var post = $link.attr('data-post');
 $link.attr('data-post', post.replace('?___store=en?___store=tr', '?___store=tr'));
 });
 $('a[data-post*="?___store=tr?___store=en"]').each(function(){
 var $link = $(this);
 var post = $link.attr('data-post');
 $link.attr('data-post', post.replace('?___store=tr?___store=en', '?___store=en'));
 });
 }
);
But I know that this is not the right approach.
Any other advice?
Thanks.
This problem has been reported and discussed here : https://github.com/magento/magento2/issues/10908
And the bug has been fixed here : https://github.com/magento/magento2/pull/11337
I guess it will be automatically fixed with the next release of Magento 2.2.
- 
 Unfortunately the problem remains in 2.2.0. Now we are waiting for 2.2.1.George A.B.– George A.B.2017年10月29日 16:41:43 +00:00Commented Oct 29, 2017 at 16:41
 - 
 The problem remains in 2.2.1George A.B.– George A.B.2017年11月11日 15:04:36 +00:00Commented Nov 11, 2017 at 15:04