Skip to content
Snippets Groups Projects
Commit d29775b3 authored by Stefan Bürk's avatar Stefan Bürk
Browse files

[BUGFIX] Build correct PageTypeZeroSource for hidden or scheduled pages

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.

Resolves: #103436
Resolves: #103798
Related: #103831
Related: #94499
Releases: main, 12.4
Change-Id: I05cf793eacb7fb2f39c1ceeb72fcbd0bd3b16719
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84229


Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: default avatarGarvin Hicking <gh@faktor-e.de>
Reviewed-by: default avatarGarvin Hicking <gh@faktor-e.de>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
parent d6bb232f
Branches
Tags
Showing with 148 additions and 3 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment