Review main Merged

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

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

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
    • Georg Ringer +1
    • Garvin Hicking +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Georg Ringer +1
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 4

Files 8

Review log 1418

  1. Stefan Bürk uploaded patch set 1 05/13/24, 11:22

  2. Stefan Bürk wrote 05/13/24, 11:22

    Topic set to Redirects
  3. core-ci voted on patch set 1 V -1 05/13/24, 11:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57611

  4. Stefan Bürk updated the commit message in patch set 2 V -1 05/13/24, 11:39

  5. core-ci voted on patch set 2 V -1 05/13/24, 11:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57614

  6. Stefan Bürk uploaded patch set 3 V -1 05/13/24, 11:48

  7. core-ci voted on patch set 3 V +1 05/13/24, 11:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57616

  8. Stefan Bürk voted on patch set 3 CR -2 05/13/24, 16:22

  9. Stefan Bürk commented on patch set 3 05/13/24, 16:35

    ``` @param bool $includeScheduledRecords whether to ignore access time in tables except for pages ``` VisibilityAspect->includeScheduledRecords does not count for pages. Needs deeper investigation how to create a link for such pages in that case.
  10. Stefan Bürk uploaded patch set 4 V +1 05/13/24, 17:49

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  11. Stefan Bürk commented on patch set 4 CR -2 05/13/24, 17:50

    Reply

    Blocked until I2e7f038a04d957751bba1181c3d5324c6e0674b5 has been merged.
  12. core-ci voted on patch set 4 V +1 05/13/24, 17:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57639

  13. Georg Ringer voted on patch set 4 CR +1 V +1 05/13/24, 18:12

  14. Stefan Bürk voted on patch set 4 CR 0 05/13/24, 19:36

  15. Stefan Bürk commented on patch set 4 05/13/24, 20:09

    Reply

    Done
  16. Garvin Hicking commented on patch set 4 CR +1 V +1 05/13/24, 21:17

    true, true, false, true, up up, down down, left right, left right, a b a b select start. scnr.
  17. Stefan Bürk voted on patch set 4 CR +2 V +2 05/13/24, 22:00

  18. Stefan Bürk merged patch set 5 05/13/24, 22:18