Bug #94490
closedHrefLangGenerator generate <link rel="alternate".... links for language not visible in frontend
0%
Description
Hello,
Description :¶
If you have a config.yaml file containing (enabled = false for french) :
languages:
-
title: Français-French
enabled: false
base: /fr/
typo3Language: fr
locale: fr_FR.utf-8
iso-639-1: fr
navigationTitle: Français-French
hreflang: fr-FR
direction: ltr
flag: fr
languageId: '0'
solr_core_read: ''
-
title: English
enabled: true
base: /en
typo3Language: default
locale: en_EN.utf-8
iso-639-1: en
navigationTitle: English
hreflang: en-EN
direction: ltr
fallbackType: strict
fallbacks: ''
flag: en-us-gb
languageId: '1'
The file typo3/sysext/seo/Classes/HrefLang/HrefLangGenerator.php
will still generate in frontend the links :
<link rel="alternate" hreflang="fr-FR" href="https://domain.tld/fr/french-version/"/>
<link rel="alternate" hreflang="en-EN" href="https://domain.tld/en/english-version/"/>
<link rel="alternate" hreflang="x-default" href="https://domain.tld/en/english-version/"/>
Problem¶
Link to https://domain.tld/fr/french-version/ generate a 404 page.
Acceptance Criteria¶
- If a language is defined with
enabled: false
in the config.yaml, the link should not be generated. - If a language is defined with
enabled: true
OR no "enabled" attribute
in the config.yaml, the link should be generated.
Updated by Jonathan IROULIN over 3 years ago
- Status changed from New to In Progress
The problem exist because the language test is based on LanguageMenuProcessor who don't verify the config.yaml languages configuration.
I will add a test based on "enabled" attribute.
Updated by Gerrit Code Review over 3 years ago
- Status changed from In Progress to Under Review
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69730
Updated by Gerrit Code Review over 3 years ago
Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69730
Updated by Gerrit Code Review over 3 years ago
Patch set 3 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69730
Updated by Gerrit Code Review over 3 years ago
Patch set 4 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69730
Updated by Gerrit Code Review over 3 years ago
Patch set 5 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69730
Updated by Gerrit Code Review over 3 years ago
Patch set 6 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69730
Updated by Gerrit Code Review over 3 years ago
Patch set 7 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69730
Updated by Gerrit Code Review over 3 years ago
Patch set 8 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69730
Updated by Gerrit Code Review over 3 years ago
Patch set 9 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69730
Updated by Gerrit Code Review over 3 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69900
Updated by Gerrit Code Review over 3 years ago
Patch set 10 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69730
Updated by Gerrit Code Review over 3 years ago
Patch set 2 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69900
Updated by Gerrit Code Review over 3 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69920
Updated by Jonathan IROULIN over 3 years ago
How to reproduce :¶
If you take one TYPO3 installation with two site :
- "Site A" with 4 languages (these languages are in "sys_languages" table and in "siteA.yaml" file)
- "Site B" with 3 of the 4 "site A" languages (these languages are in "siteB.yaml" file. But you choose to disable 1 of the 3 languages)
On your "site B", you create a "mount point" page "page-B" to a page "page-A" from "Site A".
Now if you browse the "page-B" not on the main language you should see in source code that there are "<link rel="alternate" hreflang=" link to the "page-B" for the language you disabled from "siteb.yaml" file.
So when you crawl the "site B" you have 404 page because the requested site (site B) have less languages than the "Site A" where the mount point go because hrefLangGenerator doesnt check the languages available on the requested site.
I will update the ticket with "how to reproduce".
Updated by Gerrit Code Review about 3 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69920
Updated by Gerrit Code Review almost 3 years ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69920
Updated by Gerrit Code Review almost 3 years ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69920
Updated by Gerrit Code Review almost 3 years ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69920
Updated by Gerrit Code Review almost 3 years ago
Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69920
Updated by Benni Mack almost 3 years ago
- Status changed from Under Review to Closed
Should be fixed in the meantime for v10+