69730[BUGFIX] No hrefLang if language enabled is false
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 1
Review log 2636
Show 611 earlier messages
-
Jonathan IROULIN uploaded patch set 1 07/06/21, 16:09
-
core-ci voted on patch set 1 V -1 07/06/21, 16:11 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13028
-
Jonathan IROULIN uploaded patch set 2 07/07/21, 08:23
-
core-ci voted on patch set 2 V +1 07/07/21, 08:34 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13045
-
Richard Haeser updated the commit message in patch set 3 07/07/21, 08:53
-
Geert Boetzkes commented on patch set 3 07/07/21, 09:00
Code looks good, but there are some optimization opportunities.HrefLangGenerator.php:88UnresolvedI suggest starting with the $isLanguageEnabled, if the variable is false the comparison is way lighter. ``` if ($isLanguageEnabled && $language['available'] === 1 && !empty($language['link'])) { ```HrefLangGenerator.php:157UnresolvedUsing the array_method the code could be way faster: ``` return array_map(static function ($language) { return $language->getLanguageId(); }, $this->request->getAttribute('site')->getLanguages()); ``` -
core-ci voted on patch set 3 V +1 07/07/21, 09:03 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13046
-
Jonathan IROULIN uploaded patch set 4 07/09/21, 14:28
-
core-ci voted on patch set 4 V -1 07/09/21, 14:30 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13153
-
Jonathan IROULIN uploaded patch set 5 07/09/21, 14:32
-
core-ci voted on patch set 5 V +1 07/09/21, 14:41 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13154
-
Mathias Brodala commented on patch set 5 CR -1 07/09/21, 15:06
HrefLangGenerator.php:87The 3rd argument for in_array() (true for strict type checking) is missing here.HrefLangGenerator.php:157This comment does not perform any checks but reduces SiteLanguage objects to their language ID ... -
Jonathan IROULIN uploaded patch set 6 07/12/21, 07:53
-
Jonathan IROULIN commented on patch set 6 07/12/21, 07:57
Unresolved
Hello Mathias, Thank you for your comments. I added the "true" argument to "in_array()" For the second comment, can you explain me what could i do to resolve your comment ?HrefLangGenerator.php:87ReplyThank you Mathias, i'll addHrefLangGenerator.php:157Reply UnresolvedDo you mean that we should just change the name of the method ? Or something else ? What do you think would be the right name? -
core-ci voted on patch set 6 V +1 07/12/21, 08:04 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13205
-
Jonathan IROULIN uploaded patch set 7 07/15/21, 07:03
-
core-ci voted on patch set 7 V +1 07/15/21, 07:15 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13349
-
Henrik Elsner commented on patch set 7 07/15/21, 12:19
your commit message is missing a bracket -
Oliver Klee commented on patch set 7 07/15/21, 13:17
Is this 9.5-only, i.e., 10.4 and master are note affected by the problem? -
Jonathan IROULIN updated the commit message in patch set 8 07/15/21, 13:36
-
Jonathan IROULIN commented on patch set 8 07/15/21, 13:43
Reply
Thank you, i addedReply
I don't know yet because our site is on 9.5. I looked the code on 10.4 and it seems that the requestSiteLanguage are not verified. So i think the problem affect these versions but i am not sure. -
core-ci voted on patch set 8 V +1 07/15/21, 13:46 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13358
-
Oliver Klee commented on patch set 8 07/15/21, 15:00
Reply
Then we need to verify this. (The workflow is to create the change for master first with the relevant branches listed in the "Releases:" line, and that backport the change after the master change has been merged.)HrefLangGenerator.php:87UnresolvedCould we cover this change with a regression test to make sure it works as advertised (and won't break later)? -
Jonathan IROULIN commented on patch set 8 07/15/21, 15:34
Reply
Ok, do you want i test on a ddev and introduction Package 10.4 ? Or you trying ? -
Oliver Klee commented on patch set 8 07/15/21, 17:04
Reply
Please do. (I'm currently working on something different.) Thanks! -
Jonathan IROULIN commented on patch set 8 07/16/21, 15:03
Reply
Version 10.4 is also affected. I will try to do a patch. Does i need to open an other ticket or just update the "Releases" line ? -
Oliver Klee commented on patch set 8 07/16/21, 15:59
Reply Unresolved
Updating the "Releases" line should suffice: Releases: master, 10.4, 9.5 -
Jonathan IROULIN updated the commit message in patch set 9 07/16/21, 16:18
-
core-ci voted on patch set 9 V +1 07/16/21, 16:28 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13398
-
Georg Ringer commented on patch set 9 07/18/21, 06:05
HrefLangGenerator.php:152Unresolvedso this could be int[] to have better type information -
Jonathan IROULIN uploaded patch set 10 07/19/21, 05:56
-
core-ci voted on patch set 10 V +1 07/19/21, 06:08 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13467
-
Geert Boetzkes voted on patch set 10 CR +1 07/19/21, 12:07
-
Riny van Tiggelen commented on patch set 10 V -1 CR -1 07/19/21, 15:16
I'm not able to reproduce this problem, isn't there something different in your installation which causes this problem? The HrefLangGenerator uses the HMENU with special=languages, this retrieves the languages from the Site Entity (getLanguages) and the check for enabled is done there. If the problem does exist, the change needs to be done in a different area but not within the HrefLangGenerator. -
Jonathan IROULIN commented on patch set 10 07/19/21, 17:37
Thank you Riny for your comment. I will update "How to reproduce" ticket sectionReply Unresolved
Hello, If you take one TYPO3 installation with two site : - "Site A" with 4 languages (these languages are in database and on "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". -
Benni Mack abandoned the change 10/03/21, 14:54
This change is abandoned as there is no upcoming free-of-charge 9.5 release anymore. Let's concentrate on the master/10.4 changes