You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
We are using the latest version, 1.1.56, and found an issue when using the plugin on a site with multiple languages where there are no entries related to the URL. Here is an example how you can reproduce the issue:
In < head > we show the canonical and the alternative language meta tags.
All pages that have entries work like they should, but pages buildt straight from templates will get a duplicate language-segment in the meta tags if we visit the page from other languages than the default language.
Example from the /cart page that doesn’t have an entry, but only the templates/cart.twig template:
Here the Spanish language has two /es/ in the URL and the english has one /es/ as well
The problem seems to be from the getLocalizedUrls() method in SeomaticService.php (row 3037) where there is no entry for the URL so it goes to the ‘else’ condition:
We are using the latest version, 1.1.56, and found an issue when using the plugin on a site with multiple languages where there are no entries related to the URL. Here is an example how you can reproduce the issue:
site.com [English - default language]
site.com/es [Spanish]
In < head > we show the canonical and the alternative language meta tags.
All pages that have entries work like they should, but pages buildt straight from templates will get a duplicate language-segment in the meta tags if we visit the page from other languages than the default language.
Example from the /cart page that doesn’t have an entry, but only the templates/cart.twig template:
site.com/cart [English]
Here, everything looks good. But if I visit the page in Spanish I get:
site.com/es/cart [Spanish]
Here the Spanish language has two /es/ in the URL and the english has one /es/ as well
The problem seems to be from the getLocalizedUrls() method in SeomaticService.php (row 3037) where there is no entry for the URL so it goes to the ‘else’ condition:
where $requestUri = craft()->request->getRequestUri(); includes the /es/ in the URI.
So when the siteUrl is appended in the function UrlHelper::getSiteUrl($requestUri, null, null, $localeId); the language segment (es) is added as well.
We’ve temporarly fixed the issue by changing the else condition to this:
Best Regards,
Ragnar
The text was updated successfully, but these errors were encountered: