Review 12.4 Merged

84205[BUGFIX] Enhance duplicate source detection for auto-redirect creation

Stefan Bürk CR +2 V +2 Normal +72 −8 updated 05/13/24, 20:08

Commit message

With #94499 creating redirects on page slug changes has been
enhanced to determine the source based on real url building
respecting available site configuration route enhancer options,
for example PageTypeSuffix for page-type zero (`0`) in addition
to plain slug replacement generation.

This included a check to drop the `PlainSlugReplacementSource`
if they match - which should be the case as long as no suffix
are defined for `page-type 0`.

Sadly, a default pagetype suffix is configured as slash similar to:

  routeEnhancers:
    PageTypeSuffix:
      type: PageType
      default: '/'
      map:
        '/': 0,
        '.json': 123

the generated slugs differs by the tailing slash - and thus creating
two similar redirects instead of one, which is expected.

This change modifies the duplicate detection in the corresponding
`\TYPO3\CMS\Redirects\EventListener\AddPageTypeZeroSource` method
`sourceEqualsPageTypeZeroSource()` to ignore tailing slashes for
the comparision. A functional test is added to ensure this behaviour.

Review

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

Issues 2

Files 4

Review log 46

  1. Stefan Bürk commented on patch set 1 05/13/24, 19:47

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V -1 05/13/24, 19:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57642

  3. Stefan Bürk uploaded patch set 2 V -1 05/13/24, 20:00

  4. core-ci voted on patch set 2 V +1 05/13/24, 20:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57645

  5. Stefan Bürk voted on patch set 2 CR +2 V +2 05/13/24, 20:08

  6. Stefan Bürk merged patch set 3 05/13/24, 20:08