Review main Merged

71775[BUGFIX] Consider language in redirects:checkintegrity

Sybille Peters CR +2 V +2 Hard +195 −66 updated 10/21/21, 10:26

Commit message

The ext:redirects integrity check was implemented
without considering site language host and prefix for
the integrity check, thus reporting false positive
redirect conflicts.

This patch collects page uris, respecting the site
language configuration for the page language. This way,
the same slugs for multiple languages are not detected
as conflicting anymore. Furthermore tests are extended
to verify that the same slugs within several language
variants of one page are covered correctly.

Example for false positive redirect conflict:

- pages.slug=/test
- pages.sys_language_uid=1
- url: https://example.com/de/test

Now, assuming no other page of the same language has
the slug /test and a redirect has a source_path=/test,
there should be no match.

Several @todo were added which need deeper research
and are out of the scope of this patch.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Sybille Peters +1
  • Verified V +2 Done
    • Benni Mack +2
    • Sybille Peters +1
    • core-ci +1 CI

Issues 1

Files 5

Review log 3249

Show 1624 earlier messages
  1. Sybille Peters uploaded patch set 1 10/14/21, 16:37

  2. Sybille Peters marked it work in progress 10/14/21, 16:38

  3. core-ci voted on patch set 1 V -1 10/14/21, 16:41 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18111

  4. Sybille Peters uploaded patch set 2 10/14/21, 16:43

  5. core-ci voted on patch set 2 V -1 10/14/21, 16:59 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18112

  6. Sybille Peters uploaded patch set 3 10/14/21, 17:39

  7. Sybille Peters marked it ready for review 10/14/21, 17:40

  8. Sybille Peters uploaded patch set 4 10/14/21, 17:41

  9. core-ci voted on patch set 3 V -1 10/14/21, 17:43 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18115

  10. core-ci voted on patch set 4 V -1 10/14/21, 18:00 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18116

  11. Sybille Peters rebased onto patch set 5 10/14/21, 18:18

  12. core-ci voted on patch set 5 V -1 10/14/21, 18:43 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18123

  13. Sybille Peters uploaded patch set 6 10/14/21, 19:09

  14. Sybille Peters updated the commit message in patch set 7 10/14/21, 19:16

  15. core-ci voted on patch set 6 V +1 10/14/21, 19:23 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18129

  16. core-ci voted on patch set 7 V +1 10/14/21, 19:31 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18130

  17. Benni Mack updated the commit message in patch set 8 10/15/21, 08:16

  18. Benni Mack voted on patch set 8 CR +1 10/15/21, 08:17

  19. core-ci voted on patch set 8 V +1 10/15/21, 08:34 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18146

  20. Sybille Peters commented on patch set 8 V -1 10/15/21, 13:50

    I backported patch to v10 and tested on copy of my site. I get infinite calling of subfunction getSlugsOfSubPages(). I should check out first what is the reason and if this can happen on v11 too.
  21. Stefan Bürk commented on patch set 8 CR -1 10/15/21, 19:53

    Reply

    Do you get an error message in some kind ? Or are you sure it is an infinit recursion ?

    IntegrityService.php:155

    As method is bound to one language now, we should at least add a condition to narrow down page languguas to 0 (because of traversion) and additional the language '$languageId'. Otherwise in a installation with a lot of languagees it will retrieve for each language all language kinds, to filter out some lines below only the current language. In this logic we only need to retrieve at maximum 2 page language versions, default and selected language.
  22. Sybille Peters commented on patch set 8 10/15/21, 20:54

    Reply

    yes. However, I "backported" to v10, meaning I had to patch some stuff because it did not work from scratch. I cannot reproduce this problem with "master". We should probably just make sure it can't happen. I assume some other problem. Uncaught TYPO3 Exception Maximum function nesting level of '2000' reached, aborting! thrown in file vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php in line 93 --- in the TYPO3 log: multiple entries of: 2.8888 74596120 1958. TYPO3\\CMS\\Redirects\\Service\\IntegrityService->getSlugsOfSubPages() typo3/sysext/redirects/Classes/Service/IntegrityService.php:166 2.8904 74630720 1959. TYPO3\\CMS\\Redirects\\Service\\IntegrityService->getSlugsOfSubPages() typo3/sysext/redirects/Classes/Service/IntegrityService.php:166 2.8919 74665320 1960. TYPO3\\CMS\\Redirects\\Service\\IntegrityService->getSlugsOfSubPages() typo3/sysext/redirects/Classes/Service/IntegrityService.php:166
  23. Sybille Peters uploaded patch set 9 10/15/21, 21:14

  24. Sybille Peters commented on patch set 9 V -1 10/15/21, 21:15

    We are still optimizing solution ...
  1. Sybille Peters commented on patch set 9 10/15/21, 21:15

    IntegrityService.php:155 Reply

    Done
  2. core-ci voted on patch set 9 V -1 10/15/21, 21:19 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18211

  3. Sybille Peters uploaded patch set 10 10/15/21, 21:21

  4. core-ci voted on patch set 10 V +1 10/15/21, 21:36 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18212

  5. Sybille Peters updated the commit message in patch set 11 10/16/21, 09:34

  6. core-ci voted on patch set 11 V +1 10/16/21, 09:54 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18222

  7. Stefan Bürk commented on patch set 11 CR -1 10/16/21, 10:30

    on it
  8. Stefan Bürk uploaded patch set 12 10/16/21, 14:39

  9. Stefan Bürk commented on patch set 12 CR -1 10/16/21, 14:40

    Forgot something. Will repush.
  10. core-ci voted on patch set 12 V -1 10/16/21, 14:55 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18225

  11. Stefan Bürk uploaded patch set 13 10/16/21, 16:50

  12. core-ci voted on patch set 13 V -1 10/16/21, 17:05 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18226

  13. Stefan Bürk uploaded patch set 14 10/16/21, 17:16

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

  15. Stefan Bürk uploaded patch set 15 10/16/21, 17:53

  16. core-ci voted on patch set 15 V +1 10/16/21, 18:08 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18228

  17. Sybille Peters voted on patch set 15 V +1 10/16/21, 18:13

  18. Sybille Peters updated the commit message in patch set 16 10/17/21, 06:33

  19. core-ci voted on patch set 16 V +1 10/17/21, 06:51 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18235

  20. Sybille Peters commented on patch set 16 V +1 CR +1 10/17/21, 06:55

    Reply

    Done
    My last 2 patches only changed some texts in commit message and comment. Final code was adapted by Stefan - thank you very much :)
  21. Sybille Peters uploaded patch set 17 10/17/21, 06:58

  22. Sybille Peters voted on patch set 17 V +1 CR +1 10/17/21, 06:59

  23. core-ci voted on patch set 17 V +1 10/17/21, 07:14 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18236

  24. Benni Mack voted on patch set 17 V +2 CR +2 10/21/21, 10:26

  25. Benni Mack merged patch set 18 10/21/21, 10:26