-
Notifications
You must be signed in to change notification settings - Fork 9.4k
#14674 Add ChangeStoreCode switcher to StoreSwither pool of swichers … #20851
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
Conversation
…that changes store code in redirect url from current store code to target store code
Hi @vgerassimov. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
@vgerassimov: does this fix the same issue as #19798 attempts to fix? Also I'm not sure if doing a simple |
Hi!
No this is a separate one and related to switching scopes when web/url/use_store is enabled, i.e. http://example.com/en_us switch to http://example.com/en_gb using /stores/store/switch (Magento\Store\Controller\Store\SwitchAction) which is used by data-post elements.
If we do not apply this str_replace than after all switch actions is done $targetUrl parameter is still = http://example.com/en_us which leads us to stay on same page in same scope, while all action from switch pool (vendor/magento/module-store/etc/di.xml:428) has been applied including changing scope in cookies (\Magento\Store\Model\StoreSwitcher\ManagePrivateContent::switch).
Reason why str_replace is used – that it was in origin Magento code, which has been deleted during refactoring described in PR Description (68a2605#diff-285a7e574ab3ef96f4df4d9b1d326428L144), which means it was working before as well.
Best regards,
Vladimir Gerassimov
… On 31 Jan 2019, at 14:59, Pieter Hoste ***@***.***> wrote:
@vgerassimov <https://github.com/vgerassimov>: does this fix the same issue as #19798 <#19798> attempts to fix?
Also I'm not sure if doing a simple str_replace will be able to handle translated category or product url's?
For example, you can have a category with url 'cat-english.html' in an English storeview and 'cat-french.html' in a French storeview.
I don't think this solution is capable of handling that?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#20851 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ASQuyCEoiqLVQx_N84Yr0PMFSjQHO-4fks5vIujFgaJpZM4acGB6>.
|
Hi @vgerassimov Can you help me out a little bit by explaining exactly what you are trying to achieve with this PR? Here are steps I followed with some test cases:
The results in bold are the ones which don't match the expected result. If I'm mistaken in any of these steps, please let me know and I can re-test then. Thanks! |
@magento run all tests |
Hey @vgerassimov Thank you for the contribution. Could you please review the comment #20851 (comment) because it seems that there are issues in your solution. |
@slavvka Hello! After upgrading to the latest magento versions this issue has been fixed, sorry for long answering, missed previous comment notification probably. |
Hi @vgerassimov, thank you for your contribution! |
Oh, Thank you for verification and for your efforts! |
…that changes store code in redirect url from current store code to target store code
Description (*)
Issue started after deleting part of code responsible for replacing store codes in URL in this commit: 68a2605#diff-285a7e574ab3ef96f4df4d9b1d326428L144
Fixed Issues (if relevant)
Manual testing scenarios (*)
Contribution checklist (*)