-
Notifications
You must be signed in to change notification settings - Fork 46
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
LangSwitcher should keep query string in URL (or at least have a such option) #220
Comments
yes indeed. adding query params should and must be possible. for quick fix: add an url rule, better for seo anyhow :-) would you like to send a PR? |
Sure, but a little bit later |
Would be nice. otherwise i will pick the issue but not within next few days. If you need assistance, let me know. The check for exisiting params should be done here i assume: luya-module-cms/src/widgets/LangSwitcher.php Lines 199 to 208 in 8639b26
But we have to compare the get parameters against the current url - as get params will also be resolved when using url rules |
I've made some investigations. The LangSwitcher widget itself can add additional params to URL (see line 229). luya-module-cms/src/widgets/LangSwitcher.php Lines 214 to 231 in 9ce31a8
The URL rule in my case comes from ModuleReflection class My question is what is 'args' and 'originalArgs' and how they should be populated from parseRequest method (line 156)? If we use $route = $this->request->resolve() instead, then the 'path' parameter from CatchAllUrlRule will be added also. |
Does that help? |
One of the typical scenarios on page is to update some model. In this case an URL looks like http://host/lang/module/controller/update?id=5.
Switching the language should keep the same form but change the labels and so on.
At present the widget drops a query string, so the URL becomes http://host/lang2/module/controller/update. It causes Bad Request since the id is missed.
LUYA Core Version: 1.0.20
LUYA CMS Version: 2.1.0
The text was updated successfully, but these errors were encountered: