Project

General

Profile

Actions

Bug #94490

closed

HrefLangGenerator generate <link rel="alternate".... links for language not visible in frontend

Added by Jonathan IROULIN over 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Category:
Frontend
Target version:
-
Start date:
2021-07-06
Due date:
2021-07-06
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
seo, sysext, language, frontend, 404
Complexity:
Is Regression:
Sprint Focus:

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

  1. If a language is defined with
    enabled: false
    

    in the config.yaml, the link should not be generated.
  2. If a language is defined with
    enabled: true
    

    OR no "enabled" attribute
    in the config.yaml, the link should be generated.
Actions #1

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.

Actions #2

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

Actions #3

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

Actions #4

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

Actions #5

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

Actions #6

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

Actions #7

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

Actions #8

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

Actions #9

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

Actions #10

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

Actions #11

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

Actions #12

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

Actions #13

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

Actions #14

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

Actions #15

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".

Actions #16

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

Actions #17

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

Actions #18

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

Actions #19

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

Actions #20

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

Actions #21

Updated by Benni Mack almost 3 years ago

  • Status changed from Under Review to Closed

Should be fixed in the meantime for v10+

Actions

Also available in: Atom PDF