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

lingua.selector causing manager to log out #41

Open
muzzwood opened this issue Mar 19, 2015 · 5 comments
Open

lingua.selector causing manager to log out #41

muzzwood opened this issue Mar 19, 2015 · 5 comments

Comments

@muzzwood
Copy link

muzzwood commented Mar 19, 2015

Testing out Lingua for the first time.
Placed the selector snippet on the home resource to test.
Works fine until I go back to the manager which presents me with the login screen as soon as I try to load another manager page.
It only happens when I click on the language link in the selector drop down on the web context.
Modx 2.3.3

Any ideas what could be causing this?

Edit: I've tried deleting the cache and removing all cookies.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/9737839-lingua-selector-causing-manager-to-log-out?utm_campaign=plugin&utm_content=tracker%2F1919378&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1919378&utm_medium=issues&utm_source=github).
@muzzwood
Copy link
Author

It appears to only happen on the resource set by the "site_start" setting.
Works fine on any other resource. And If I set site_start to a different resource, the original one then works fine.

@muzzwood
Copy link
Author

Tried a fresh modx install.
All worked perfectly until I turned Friendly URLs on. Some kind of issue going on there.

@muzzwood
Copy link
Author

On further examination, it appears the wrong URIs are being generated. I have no idea why that's causing the manager to be logged out but it is anyway...

In my .htaccess file I've got:
RewriteEngine On
RewriteBase /mysite

If I delete the modx cache and clear my cookies, I can load up the resource with lingua.selector on the web context and the link shows it is pointed to http://localhost/mysite/?lang=zh
This is correct and if I click on the link, it works and I don't get logged out of the manager.

Problem is, if I look at where the link is pointing on this newly loaded page, it shows:
http://localhost//mysite/index.html?lang=en

Note the double slash // just after localhost!

Clicking this link will log me out of the manager.

@muzzwood
Copy link
Author

Ok I think I've worked it out.

In the lingua.selector snippet, line 206 needs to be changed from:
$pageURL = $parseUrl['scheme'] . '://' . $parseUrl['host'] . '/' . $parseUrl['path'] . $itemUri;

to
$pageURL = $parseUrl['scheme'] . '://' . $parseUrl['host'] . $parseUrl['path'] . $itemUri;

@ghost
Copy link

ghost commented Mar 19, 2015

I would think this is going to work in some cases but not in others. The logout issue was only affecting me on Localhost, with the .htaccess RewriteBase set to /subdir/. On the MODX Cloud it never happens. This fix does stop the problem on localhost. I haven't checked what it would do on the Cloud installation. I wonder if it's only an issue in a subdir installation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant