Review main Merged

64655[BUGFIX] Re-allow pages with a trailing slash

Benni Mack CR +2 V +2 Normal +58 −12 updated 06/01/21, 18:43

Commit message

This change enables the usage of pages containing a
trailing slash in their "slug" like "/my-page/subpage/"
to be working, and modifies tests to cover this use-case.

The main routing first fetches all records including the trailing slash
(= also fetches pages with a trailing slash in their slug).

The symfony routing then checks for e.g. "/my-page/" at the very end, but will fail
if the page was named "/my-page", and then re-runs the symfony routing
to find the "/my-page" request (same behavior as before).

This change therefore solves two issues:
1. Pages with a slug with a trailing slash are properly resolved
2. Pages with a slug with trailing slash can be also called via "/my-page" and (new)
  pages without a trailing slash can be called WITH the trailing slash (as before)
  keeping maximum backwards-compatibility with RealURL logic.

Review

  • Code review CR +2 Done
    • Anja Leichsenring +2
    • Jochen Roth +1
  • Verified V +2 Done
    • Anja Leichsenring +2
    • Jochen Roth +1
    • core-ci +1 CI

Issues 1

Files 6

Review log 1925

  1. Benni Mack uploaded patch set 1 06/02/20, 15:08

  2. TYPO3com voted on patch set 1 V -1 06/02/20, 15:23 Completed build in 15m 23s on Tue, 2 Jun, 03:23 PM Test Summary: 72842 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3747

  3. Benni Mack uploaded patch set 2 06/02/20, 16:18

  4. TYPO3com voted on patch set 2 V +1 06/02/20, 16:36 Completed build in 17m 52s on Tue, 2 Jun, 04:36 PM Test Summary: 72842 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3751

  5. Benni Mack uploaded patch set 3 06/03/20, 07:56

  6. TYPO3com voted on patch set 3 V +1 06/03/20, 08:08 Completed build in 11m 51s on Wed, 3 Jun, 08:08 AM Test Summary: 72845 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3761

  7. Oliver Hader voted on patch set 3 CR +1 06/04/20, 11:59

  8. Markus Klein voted on patch set 3 CR +1 06/04/20, 12:01

  9. Tomas Norre Mikkelsen commented on patch set 3 V -1 06/05/20, 13:41

    When I test this with dev-master tested. Following work: slug is: /page-name /page-name /page-name/ Following doesn't work: slug is: /page-name/ /page-name/ That means the one without trailing slash doesn't work with the patch if the slug is set with trailing slash. If I click the "recalculate pagesegment for page title" then it will be saved as /page-name without trailing slash, but it's still possible to save a "false" one with trailing slash, therefore I've given this a -1.
  10. Benni Mack abandoned the change 06/19/20, 14:39

    that was a bad approach, will drop it.
  11. Sybille Peters commented on patch set 3 09/11/20, 20:28

    Would it be possible to just remove the trailing slash from the slug field when saving? This would be a very simple solution that should solve the problem.
  12. Riccardo De Contardi commented on patch set 3 09/11/20, 20:42

    As far as I have seen, the slash is removed when you hit the refresh slug button
  13. Benni Mack restored the change 05/10/21, 11:07

  14. Benni Mack uploaded patch set 4 05/10/21, 11:07

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

  16. Benni Mack commented on patch set 4 05/10/21, 11:39

    Better solution, better tests. Would be great if you could re-test.
  17. Benni Mack rebased onto patch set 5 05/10/21, 19:27

  18. core-ci voted on patch set 5 V +1 05/10/21, 19:41 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11360

  19. Anja Leichsenring voted on patch set 5 V +1 CR +1 05/11/21, 17:33

  20. Benni Mack updated the commit message in patch set 6 05/12/21, 15:26

  21. core-ci voted on patch set 6 V +1 05/12/21, 15:39 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11445

  22. Jochen Roth voted on patch set 6 V +1 CR +1 05/19/21, 09:43

  23. Anja Leichsenring voted on patch set 6 V +1 CR +1 06/01/21, 17:52

  24. Anja Leichsenring voted on patch set 6 V +2 CR +2 06/01/21, 18:43

  25. Anja Leichsenring merged patch set 7 06/01/21, 18:43