?
avatar v912485
v912485
23 Dec 2016

Steps to reproduce the issue

Have a multi-lingual installation with language filter installed and enabled
Install custom component
Create 2 menus for each language
Create a menu item for the component in each menu and set the appropriate language for the menu items
Associated the menu items of the two languages

Expected result

Alternate links are generated in the header of the page such as:
<link href="http://example.com/es/my-page" rel="alternate" hreflang="es" />

Actual result

These links are missing for the different languages

System information (as much as possible)

Joomla! 3.6.5 Stable

Additional comments

The hreflang links are generated fine for normal article pages.

avatar v912485 v912485 - open - 23 Dec 2016
avatar joomla-cms-bot joomla-cms-bot - labeled - 23 Dec 2016
avatar v912485 v912485 - change - 23 Dec 2016
The description was changed
avatar v912485 v912485 - edited - 23 Dec 2016
avatar infograf768
infograf768 - comment - 23 Dec 2016

Which component is that?

avatar v912485
v912485 - comment - 23 Dec 2016

BreezingForms, JComments and my own custom built components are the ones where I have noticed it so far.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13359.

avatar infograf768
infograf768 - comment - 24 Dec 2016

Please install a test site with https://github.com/joomla/joomla-cms/archive/staging.zip
Install as multilang and then your components and test again.

avatar infograf768
infograf768 - comment - 24 Dec 2016

Hmm, I confirm the issue with JComments when sef is on when using staging.
$active_link is NOT equal to $current_link, therefore $associations is not checked.
It works fine when sef is off.

@andrepereiradasilva
can you have a look at this please?

avatar v912485
v912485 - comment - 24 Dec 2016

Given that it's now confirmed, do I still need to test with staging?
Yes, I also have sef enabled.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13359.

avatar infograf768
infograf768 - comment - 24 Dec 2016

No need indeed to test in staging until we find a solution, if possible.
At this time I think that the issue is with the component itself (JComment in my tests)

I get here on a staging test site
'/sqltest/trunkgitnew/index.php/fr/comments-list-fr?view=comments' for $active_link
and
'/sqltest/trunkgitnew/index.php/fr/comments-list-fr' for $current_link

any core component gets these fine and equal
Example: a contact list categories gets
'/sqltest/trunkgitnew/index.php/fr/list-contacts-categories-fr'
for both variables.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 6 Feb 2017

Issue also on latest 3.7-staging.

avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Apr 2017
Priority Medium Low
Status New Confirmed
avatar franz-wohlkoenig franz-wohlkoenig - change - 8 Nov 2017
Status Confirmed Discussion
avatar ethernidee
ethernidee - comment - 30 Jan 2018

Having 3 menu items for different languages (all associated) is a problem, when you decide to unpublish/move to trash any item and even article/category for that item.

languagefilter inserts the following links:

<link href="https://domain.tld/?id=10" rel="alternate" hreflang="en-GB" />

?id=10 is category ID. Seems like only removing association at all helps in this case.

avatar infograf768
infograf768 - comment - 30 Jan 2018

Moving to trash or Deleting?

avatar infograf768
infograf768 - comment - 30 Jan 2018

Also @ethernidee
Your issue has nothing to do with this one which deals with hreflang.

avatar ethernidee
ethernidee - comment - 30 Jan 2018

I've tried unpublishing and moving to trash. Updated previous comment, parser consumed html link. Deleting association from both category and menu item works. Simple unpublishing/moving to trash does not work (still generates garbage hreflang and language switcher flag link).

avatar infograf768
infograf768 - comment - 31 Jan 2018

I can't reproduce your issue. Testing on 3.8.4.
When an associated item is Unpublished or Trashed (not even deleted), the corresponding hreflang is not present in Source.
It still appears as Associated though in the manager until deleted.

avatar ethernidee
ethernidee - comment - 31 Jan 2018

Did you try to unpublish/delete item with default site language and navigate to associated item in another language?

avatar infograf768
infograf768 - comment - 2 Feb 2018

Yes, for menu items, but see further as your case looks different.
Example here for a menu item
Categories_gb is unpublished but still associated to Catégories(fr)
screen shot 2018-02-02 at 09 36 30

Then, in frontend, I display Catégories(fr)
screen shot 2018-02-02 at 09 41 39

No hreflang
screen shot 2018-02-02 at 09 42 59

As home pages are associated by default I do get the hreflang there
screen shot 2018-02-02 at 09 44 49


But I found an error when there is no specific menu item and an associated category is unpublished.
That may be your case.
screen shot 2018-02-02 at 09 51 24

In that case I evidently get a 404 for the unpublished category and its articles when switching via the module (IN 3.8.4. This will be corrected in 3.8.5 by #19512 , BUT also a wrong hreflang when I display Catégorie (fr-fr)

<link href="http://localhost:8888/installmulti/trunkgitnew/fr/catégories-fr/9-categorie-fr-fr.html" rel="alternate" hreflang="fr-FR" />
	<link href="http://localhost:8888/installmulti/trunkgitnew/en/component/content/category.html?id=8" rel="alternate" hreflang="en-GB" />

After merging #19512 I will get the same you had , i.e.

<link href="http://localhost:8888/installmulti/trunkgitnew/fr/catégories-fr/9-categorie-fr-fr.html" rel="alternate" hreflang="fr-FR" />
	<link href="http://localhost:8888/installmulti/trunkgitnew/en/?id=8" rel="alternate" hreflang="en-GB" />

Therefore I confirm the bug for hreflang

avatar infograf768
infograf768 - comment - 2 Feb 2018

@andrepereiradasilva
Do you see a way to solve this issue.

avatar ethernidee
ethernidee - comment - 2 Feb 2018

@infograf768, thanks for investigation.
I've tried creating 3 categories in different languages and three menu items for them, then unpublished/deleted to trash 1 category or 1 menu item, or category and item at the same time. Mainly, the one of default site language.
Let's say it's "News" with blog layout. Then whenever I navigate to any of the rest 2 menu items I see 3 hreflang with ?id=... for unpublished/removed one. Trying to access it gives 404.
Moreover, language switcher plugin displays 3 flags (it's ok) and link for default site language is the same as for hreflang.

avatar infograf768
infograf768 - comment - 3 Feb 2018

I am working on a patch.

avatar infograf768 infograf768 - change - 3 Feb 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-02-03 11:07:04
Closed_By infograf768
avatar infograf768 infograf768 - close - 3 Feb 2018
avatar infograf768
infograf768 - comment - 3 Feb 2018

Please test #19551

Closing as we have a PR

avatar infograf768
infograf768 - comment - 4 Feb 2018

@ethernidee
Please test #19551

Add a Comment

Login with GitHub to post a comment