Review 12.4 Merged

84207[BUGFIX] Build correct PageTypeZeroSource for hidden or scheduled pages

Stefan Bürk CR +2 V +2 Normal +148 −3 updated 05/13/24, 22:19

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.

The plain slug replacement does not take disabled state (`hidden`)
or scheduled state `starttime/endtime` into account, the advanced
url building using the PageRouter respected the context - which
discards hidden pages or pages outside the scheduled range.

To solve this issue, the `VisibilityAspect` in the context can be
changed to allow hidden and scheduled records which also revealed
a inconsistency between the option comment and the behaviour, and
the fact that this option has been missed. This has been addressed
with #103831 to enable this solution to work properly.

This change introduces a new internal method `getAdjustedContext()`
to `\TYPO3\CMS\Redirects\EventListener\AddPageTypeZeroSource` to
ensure a context to build uris for hidden pages and/or pages which
are scheduled and outside the constraint. The modified context is
used in `createPageTypeZeroSource()` instead of the current index.

Functional tests are added to cover 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 4

Files 8

Review log 34

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

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

  3. Stefan Bürk voted on patch set 1 CR +2 V +2 05/13/24, 22:19

  4. Stefan Bürk merged patch set 2 05/13/24, 22:19