Bug #89871
closedEpic #89797: HrefLang / Canonical issues
HrefLangGenerator: Wrong links generated with page translations that use a shortcut
100%
Description
Steps to reproduce:
- Create a site config with the languages "*Default*", "*German*", "*Spanish*"
- Create a page "Page A" and translate it to all languages
- Create a page "Page B" and translate it to all languages
- On "Page A", make the german translation to a "Shortcut" to "Page B"
- Now open the spanish version of "Page A".
Expected:
- The hreflang for "de" looks like https://www.sitename.com/de/page-b
Actual:
- The hreflang for "de" now looks like https://www.sitename.com/es/page-b
- This will also easily result in a 404 error, if the page title is different in the translation.
The HreflangGenerator incorrectly uses the language parameter of the current language instead of the one of the target language, if shortcuts are used.