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

Store View switcher not working on front-end and it throws an error #11211

Closed
latypatil opened this issue Oct 4, 2017 · 8 comments
Closed

Store View switcher not working on front-end and it throws an error #11211

latypatil opened this issue Oct 4, 2017 · 8 comments
Labels
Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@latypatil
Copy link

latypatil commented Oct 4, 2017

If we select any store then site will go to that store and again we select another store then it throws an error because the url is wrong.

Preconditions

  1. Magento ver. 2.2.0
  2. PHP 7.0.24, mysql Ver 14.14

Steps to reproduce

  1. Create different store view from admin panel and all will appear on front-end
  2. Select any store view (No error)
  3. Again select another store view(error will be there)

Expected result

  1. It should show all store views without any error
    Ex. http://10.16.16.141/magento2.2/?___store=aus ==>this is for one of store view
    http://10.16.16.141/magento2.2/?___store=usa ==> This should be for different store view
    OR
    Base url should be the same for any store ,only store will get switch!

Actual result

  1. [Screenshot, logs]
    error

After changing the store view second time it redirect to below url :
http://10.16.16.141/magento2.2/?___store=aus?___store=usa

(URL is only for reference , it will not work)

@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed labels Oct 4, 2017
@magento-engcom-team
Copy link
Contributor

@latypatil, thank you for your report.
We've created internal ticket(s) MAGETWO-80840 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.2.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 4, 2017
@latypatil
Copy link
Author

The issue is in /vendor/magento/module-store/Block/Switcher.php with function getTargetStorePostData () where $store->getCurrentUrl(false) , Current url has been passed there and It should be $this->getUrl('stores/store/switch').

@duckchip
Copy link
Contributor

duckchip commented Oct 9, 2017

this issue is a result of merge in issue [https://github.com//issues/8509] which fixes cookie redirect problems with multidomains

@thiagolima-bm
Copy link
Member

Hey @okorshenko PR #11337

@TomashKhamlai
Copy link
Contributor

@latypatil, I think that this issue is similar to issue #10908? Do you have logs in var/logs/exception.log?

thiagolima-bm added a commit to thiagolima-bm/magento2 that referenced this issue Oct 20, 2017
thiagolima-bm added a commit to thiagolima-bm/magento2 that referenced this issue Oct 21, 2017
magento-team pushed a commit that referenced this issue Oct 31, 2017
magento-team pushed a commit that referenced this issue Oct 31, 2017
 - Merge Pull Request #11337 from thiagolima-bm/magento2:fix#11211
 - Merged commits:
   1. ce4fb97
   2. beccd7d
   3. 84729b5
magento-team pushed a commit that referenced this issue Oct 31, 2017
[EngCom] Public Pull Requests - 2.2-develop
 - MAGETWO-82955: [Backport 2.2-develop] FIX show visual swatches in admin - product attribute #11747
 - MAGETWO-82943: Magetwo 70954: Remove the component.clear from the custom options type. This causes the 'elem' array to become out of sync with the recordData #11824
 - MAGETWO-82710: Fix issue #10032 - Download back-up .tgz always takes the latest that's created (2.2-develop) #11595
 - MAGETWO-81994: Products added to cart with REST API give total prices equal to zero #11458
 - MAGETWO-81422: #11211 Fix Store View switcher #11337
@okorshenko
Copy link
Contributor

the issue has been fixed and delivered to 2.2-develop branch. WIll be available with 2.2.2 release

@davidroberto
Copy link

davidroberto commented Nov 24, 2017

@latypatil, i had the same problem and was able to fix it with this small fix.

I know it's not perfect and that i should overwrite the core module in a custom plugin, but anyway i'll not need this fix anymore when i'll update the code with the new release containing the official fix.

In /vendor/magento/module-store/block/switcher.php, in getTargetStorePostData method, replace

return $this->_postDataHelper->getPostData( $store->getCurrentUrl(false), $data );

by:

$currentUrl = strtok($store->getCurrentUrl(false), '?'); return $this->_postDataHelper->getPostData( $currentUrl, $data );

@magento-engcom-team
Copy link
Contributor

Hi @latypatil. Thank you for your report.
The issue has been fixed in magento-engcom/magento2ce#1285 by @magento-engcom-team in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming patch release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

7 participants