-
Notifications
You must be signed in to change notification settings - Fork 39
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
when WPML uses GET param as lang format #12
Comments
This issue is not limited to multisite - it is apparent for single site, using WPML, timber and routes installed via composer (not plugin version). Even when the lang is in the url (www.afakeurl.com/us/) routing via Routes is broken - this may be due to WPML incorrectly adding a '/' to the url returned by get_bloginfo('url'). Luzel's fix works in this situation too as it removes the '/'. It would make sense to include Luzel's fix, or some version of, in Upstatement/routes. |
Pretty sure I'm running into either this exact bug or a variation of it. In the Routes::map() function the $base_path variable used in the setBasePath() function used to always be something like: "/" or "/lang/", but some where in an update (maybe with WPML), I started getting a $base_path value of: "/lang//". I was able to fix this with a simple:
Right before:
I don't like modifying the local version of Routes.php, so hopefully a fix will be incoming soon for this. |
Same happens to me. I made a more elaborate fix only replacing double dash "//" if is found. A proper fix would be great. |
@n3storm @stevecomrie. Thanks for the nudge, sorry I missed this last year. Just pushed #12 to resolve |
Wordpress 4.9.1 (multisite)
Timber 1.5.2
When WPML language URL format is "Language name added as a parameter" there is issue with calculating base_path in method Routes::map(). Function get_bloginfo('url') returns URL containg "?lang=en" which ends up with wrong base_path (I am not sure but maybe this is bug beacuse of multisite)
Fix on forked github repo:
https://github.com/luzel/routes
The text was updated successfully, but these errors were encountered: