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

Menu item active state not working correctly on all platforms. #60

Open
24HOURSMEDIA opened this issue May 2, 2023 · 0 comments
Open

Comments

@24HOURSMEDIA
Copy link

The menu active state is not working correctly on all platforms.

This is because the 'active state' is based upon the 'server name' ($_SERVER['SERVER_NAME']) which is quite different than the hostname for the request. For example, the server name may be 'phpfpm.docker.local' while the domain names may of course be different.

Changing in v4.0, in services/OlivemenusService.php

line 212

$current_active_url = Craft::$app->request->getServerName() . Craft::$app->request->getUrl();

to

$current_active_url = Craft::$app->request->getHostName() . Craft::$app->request->getUrl();

would fix this.

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