#615 Posted in ‘Route 66’

Latest post by Lefteris Kavadas on Monday, 21 September 2020 16:15 EEST

Thomas Bille
Hi !

When the plugin is activated and the languagefilter plugin is activated the lines
<link href="https://www.xxx.com/en/" rel="alternate" hreflang="en-EN" />
<link href="https://www.xxx.com/de/" rel="alternate" hreflang="de-DE" />
<link href="https://www.xxx.com/pl/" rel="alternate" hreflang="pl-PL" />

will read

<link href="https://www.xxx.com/de/" rel="alternate" hreflang="de-DE" />
<link href="https://www.xxx.com/pl/" rel="alternate" hreflang="pl-PL" />
<link href="https://www.xxx.com/en/" rel="canonical" />

so

<link href="https://www.xxx.com/en/" rel="alternate" hreflang="en-EN" />

gets deleted.

Correct behaviour would be

<link href="https://www.xxx.com/en/" rel="alternate" hreflang="en-EN" />
<link href="https://www.xxx.com/de/" rel="alternate" hreflang="de-DE" />
<link href="https://www.xxx.com/pl/" rel="alternate" hreflang="pl-PL" />
<link href="https://www.xxx.com/en/" rel="canonical" />

in the header.

Lefteris Kavadas
Hi Thomas,

Route 66 does nothing with the alternate links. Are you sure it's Route 66 that does that? Thank you for reporting this.

Regards

Thomas Bille
Yes, the error/deletion goes away when disabling the plugin. I haven't looked enough into this , but i think the addheadlink funtion just takes one line per URL and deletes other entries if multiple calls are made. i hacked into languagefilter.php
$doc->addHeadLink($server .'/' . $languages[$this-&gt;current_lang]->sef.'/' , 'alternate', 'rel', array('hreflang' => $this->current_lang));
-> gets also deleted
$doc->addCustomTag('<link href="https://www.firecoders.com/' . $server . '/'.$languages[$this-&gt;current_lang]->sef.'/' . '" rel="alternate" hreflang="'.$this->current_lang.'" />');
-> stays
If I would guess you need to call addCustomTag instead of addHeadlink for the canonical tag ?

Lefteris Kavadas
Language filter is a core plugin. I recommend to revert your changes. If you believe that it has an issue then you should report this to https://github.com/joomla/joomla-cms/issues.
I don't see how this is related with Route 66. Can you please verify that everything works fine when Route 66 system plugin is disabled?

Thank you for the feedback.

Regards

Note: An active subscription is required in order to get support for our paid extensions. For our free extensions, if you don't have an account, register and then submit your support request.  In case you just want to ask a question, you can also use the contact form .

Firecoders
Are you using our extensions? Please post a review at the Joomla extensions directory!
Post a review