Review main Merged

69919[BUGFIX] Render hreflang only for translated pages

Guido Schmechel CR +2 V +2 Easy +20 −5 updated 12/15/21, 07:31

Commit message

If a language in the SiteConfig is set to the fallbackType
free and there is no translated page for this language, then
there is now no generated hreflang.

Previously, a link was always generated with default language
slug, which lead to 404 page not found.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
  • Verified V +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 4558

Show 2533 earlier messages
  1. Guido Schmechel uploaded patch set 1 07/18/21, 23:55

  2. Guido Schmechel uploaded patch set 2 07/18/21, 23:57

  3. core-ci voted on patch set 1 V -1 07/18/21, 23:58 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13461

  4. core-ci voted on patch set 2 V +1 07/19/21, 00:07 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13462

  5. Guido Schmechel rebased onto patch set 3 08/13/21, 17:21

  6. core-ci voted on patch set 3 V +1 08/13/21, 17:40 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15006

  7. Stefan Busemann commented on patch set 3 08/14/21, 11:57

    i am on it
  8. Stefan Busemann commented on patch set 3 V +1 CR +1 08/14/21, 12:03

    Works as decribed
  9. Stefan Bürk commented on patch set 3 08/14/21, 13:05

    i'm on it
  10. Rudy Gnodde voted on patch set 3 CR +1 08/14/21, 13:07

  11. Stefan Bürk commented on patch set 3 V +1 08/14/21, 13:17

    HrefLangGenerator.php:78

    Would move this to the check in line 73 as empty($page) to continue and leave here simply processing if page is empty instead having a secion

    HrefLangGeneratorTest.php:229

    missing tailing comma
  12. Guido Schmechel uploaded patch set 4 08/14/21, 13:24

  13. Guido Schmechel commented on patch set 4 08/14/21, 13:27

    HrefLangGenerator.php:78 Reply

    Good point! I have adjusted it.

    HrefLangGeneratorTest.php:229 Reply

    I had followed the rest of the test here, so I did not add a trailing comma.
  14. core-ci voted on patch set 4 V +1 08/14/21, 13:44 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15082

  15. Stefan Bürk commented on patch set 4 08/14/21, 13:56

    HrefLangGenerator.php:74

    comment not correct now. should also state that "if no page for language" or better remove the comment, as i would say the condition explaines why it is skipped and would say this comment is unneeded here and now not in sync

    HrefLangGenerator.php:78 Reply

    Yes, but now the comment is not correct in the condittion block - see comment (sry did not see this at the time stating this comment - sry for that)

    HrefLangGeneratorTest.php:229 Reply

    Was not to bother you, but as it seems that there is an effort to add tailing comma to multline arrays as in the states merge conflict review https://review.typo3.org/c/Packages/TYPO3.CMS/+/69825 was just a comment to add it directly ;)
  16. Guido Schmechel uploaded patch set 5 08/14/21, 15:45

  17. core-ci voted on patch set 5 V +1 08/14/21, 16:04 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15090

  18. Guido Schmechel commented on patch set 5 08/14/21, 16:10

    HrefLangGenerator.php:74 Reply

    Done

    HrefLangGenerator.php:78 Reply

    No problem, done :-)

    HrefLangGeneratorTest.php:229 Reply

    Done ;-)
  19. Stefan Bürk voted on patch set 5 V +1 CR +1 08/14/21, 18:28

  20. Stefan Busemann commented on patch set 5 V +1 CR +1 09/13/21, 08:36

    works fine
  21. Stefan Froemken voted on patch set 5 V +1 CR +1 09/13/21, 20:07

  22. Guido Schmechel uploaded patch set 6 09/28/21, 19:57

  23. core-ci voted on patch set 6 V +1 09/28/21, 20:11 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17278

  24. Guido Schmechel commented on patch set 6 09/28/21, 20:20

    Just a rebase after the trailing comma patch. Please revote
  25. Stefan Froemken voted on patch set 6 V +1 CR +1 09/29/21, 05:52

  26. Nikita Hovratov voted on patch set 6 V +1 CR +1 09/29/21, 08:08

  27. Stefan Bürk commented on patch set 6 CR -1 09/29/21, 08:17

    There's a point which I want to checked deeper, as I'm not sure if this eventually has a side effect. Just want to be sure, otherwise patch is per-se good and working at first sight. Just give me time today to re-check that for my soul.
  28. Stefan Bürk commented on patch set 6 V +1 CR +1 09/29/21, 16:13

    Reply

    Nevermind. It's okay.
  29. Benni Mack commented on patch set 7 10/04/21, 09:18

    Published edit on patch set 6.
  30. Benni Mack commented on patch set 8 10/04/21, 09:18

    Published edit on patch set 7.
  31. core-ci voted on patch set 7 V +1 10/04/21, 09:40 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17542

  32. core-ci voted on patch set 8 V +1 10/04/21, 09:43 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17543

  33. Stefan Bürk voted on patch set 8 CR +1 10/04/21, 09:43

  1. Stefan Bürk voted on patch set 8 V +1 10/04/21, 09:48

  2. Nikita Hovratov voted on patch set 8 V +1 CR +1 10/04/21, 09:53

  3. Simon Schaufelberger commented on patch set 8 10/04/21, 10:55

    HrefLangGeneratorTest.php:82

    please annotate the data type correctly
  4. Nikita Hovratov uploaded patch set 9 10/04/21, 11:00

  5. Nikita Hovratov commented on patch set 9 10/04/21, 11:01

    HrefLangGeneratorTest.php:82 Reply

    Done
  6. Nikita Hovratov voted on patch set 9 V +1 CR +1 10/04/21, 11:01

  7. Simon Schaufelberger voted on patch set 9 CR +1 10/04/21, 11:06

  8. Stefan Bürk voted on patch set 9 V +1 CR +1 10/04/21, 11:07

  9. core-ci voted on patch set 9 V +1 10/04/21, 11:15 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17549

  10. Richard Haeser commented on patch set 9 V -1 10/14/21, 09:21

    Not sure if it is just me, but in my test installation the language menu (and so hreflang) is broken in master. Anyone with the same issue? For that, a verified -1 just to check if we do not have other issues. If others don't have the issue just let me know. I will remove my -1 in that case. Otherwise I will try to debug and fix this tomorrow.
  11. Benni Mack updated the commit message in patch set 10 11/18/21, 10:41

  12. core-ci voted on patch set 10 V +1 11/18/21, 11:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19454

  13. Benni Mack wrote 11/29/21, 10:16

    Change destination moved from master to main
  14. Benni Mack updated the commit message in patch set 11 11/29/21, 14:02

  15. core-ci voted on patch set 11 V +1 11/29/21, 15:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20075

  16. Benni Mack commented on patch set 11 12/13/21, 23:04

    Cannot reproduce this issue in TYPO3 v11.5.3 anymore.
  17. Stefan Bürk uploaded patch set 12 12/14/21, 02:34

  18. Stefan Bürk commented on patch set 12 12/14/21, 02:42

    Reply

    I can reproduce and verify it with 11.5 branch, used introduction package. Also I can verify this patch fixes this issue. We also having a "backport" as composer-patch running in a v10 instance, which fixes this issue in a real v10 instance. Included test verifies this also. If "fix" in HrefLangGenerator is reverted, test fails, even on 'main'. Could not "reproduce" it on 'main' yet, with styleguide ... but I do not get thes hreflang tags at all there, maybe I'm missing something, seo ext installed - and I thought this href language tags in the head are done automaticlly by the seo extension. Anyway I updated the patch to be compatible with current main.
    Updated for current main, removed HrefLangScenario language entries from patch, as sys_language has been removed with: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72534 On backport to 11.5, following entry must be added to 'typo3/sysext/seo/Tests/Functional/Fixtures/HrefLangScenario.yml ``` entities: language: ... - self: {id: 5, title: 'Dansk', code: 'dk'} ```
    Would be nice to have this as bugfix in 10.4 also
  19. core-ci voted on patch set 12 V +1 12/14/21, 02:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21054

  20. Stefan Bürk uploaded patch set 13 12/15/21, 04:34

  21. core-ci voted on patch set 13 V +1 12/15/21, 04:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21114

  22. Stefan Bürk commented on patch set 13 V +1 CR +1 12/15/21, 04:56

    Reply

    Some time passed now. What did you meant by this is completly broken ? How did you tested it ? Maybe against Styleguide ? Maybe hreflang entries for language in site-config are missing ?

    Reply

    I have re-done verification in branch-10.4 instance, branch 11.5 instance and branch-main instance. 10.4 and 11.5 with introduction package AND styleguide-frontend, main only with styleguide frontend. Note: To get a href-lang menu you need to add the "hreflang" keys in the corresponding site-configuration to the language variants. They are missing, thus not generating href-lang entries if not set. This is an issue in styleguide generator, and I will add a PR to fix this there. Re-verification means, that I could verify that without the fix/patch, for a language in free-mode where the page is not translated to, a entry would be generated which is wrong. With this patch, this entry will be not generated. So patch works as intended.
    Thanks for this patch Guido. Works like described, and fixes a real issue. Tested and verified deeply.

    Reply

    Added 10.4.
  23. Stefan Bürk commented on patch set 13 12/15/21, 04:57

    Note: If accepted and wanted, and main patch has +2, I would offer to do the backports for 11.5 and 10.4 if wanted, to verify before main patch is "merged".
  24. Benni Mack voted on patch set 13 V +2 CR +2 12/15/21, 07:31

  25. Benni Mack merged patch set 14 12/15/21, 07:31