adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
730 stars 736 forks source link

Core Components alternate language inside the head meta not working #2505

Open adellanegra opened 1 year ago

adellanegra commented 1 year ago

Bug Report

Current Behavior My current sites structure is the below one: /content/project/language-masters/it <-- master /content/project/it/it <-- livecopy /content/project/us/en <-- livecopy

I'am extending all the pages from apps/core/wcm/components/page/v2/page and based upon the head.links.html <link data-sly-use.page="com.adobe.cq.wcm.core.components.models.Page" data-sly-test="${page.canonicalLink}" rel="canonical" href="${page.canonicalLink}"> <link data-sly-test="${page.alternateLanguageLinks}" data-sly-repeat="${page.alternateLanguageLinks.entrySet}" rel="alternate" hreflang="${item.key.toLanguageTag}" href="${item.value}">

I am expecting to see the alternate pages but instead it's returning only the master page url:

debugging the method com.adobe.cq.wcm.core.components.internal.models.v2.PageImpl#getAlternateLanguageLinks, the interface method com.adobe.aem.wcm.seo.SeoTags#getAlternateLanguages returns only the master page url.

Debugging deeply the method com.adobe.aem.wcm.seo.SeoTags#getAlternateLanguages is not possible. Which is the logic to get the altenates on com.adobe.aem.wcm.seo.SeoTags#getAlternateLanguages? the code for reverse engineering is bot available.

Expected behavior/code Should return map of alternate language links about each livecopy

Environment

Additional context / Screenshots image

Blaris commented 8 months ago

I am also running into this issue.