[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:Stefan Bürk <stefan@buerk.tech> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Georg Ringer <georg.ringer@gmail.com> Tested-by:
Georg Ringer <georg.ringer@gmail.com> Tested-by:
Garvin Hicking <gh@faktor-e.de> Reviewed-by:
Garvin Hicking <gh@faktor-e.de> Reviewed-by:
Stefan Bürk <stefan@buerk.tech>
Showing
- typo3/sysext/core/Documentation/Changelog/12.3/Feature-94499-ProvideAdditionalPageTypeSourceAuto-createRedirectSourceType.rst 19 additions, 2 deletions...AdditionalPageTypeSourceAuto-createRedirectSourceType.rst
- typo3/sysext/redirects/Classes/EventListener/AddPageTypeZeroSource.php 23 additions, 1 deletion...redirects/Classes/EventListener/AddPageTypeZeroSource.php
- typo3/sysext/redirects/Classes/EventListener/AddPlainSlugReplacementSource.php 3 additions, 0 deletions...s/Classes/EventListener/AddPlainSlugReplacementSource.php
- typo3/sysext/redirects/Classes/RedirectUpdate/SlugRedirectChangeItemFactory.php 1 addition, 0 deletions.../Classes/RedirectUpdate/SlugRedirectChangeItemFactory.php
- typo3/sysext/redirects/Tests/Functional/Service/Fixtures/SlugServiceTest_endtime.csv 4 additions, 0 deletions...s/Functional/Service/Fixtures/SlugServiceTest_endtime.csv
- typo3/sysext/redirects/Tests/Functional/Service/Fixtures/SlugServiceTest_hiddenPage.csv 4 additions, 0 deletions...unctional/Service/Fixtures/SlugServiceTest_hiddenPage.csv
- typo3/sysext/redirects/Tests/Functional/Service/Fixtures/SlugServiceTest_starttime.csv 4 additions, 0 deletions...Functional/Service/Fixtures/SlugServiceTest_starttime.csv
- typo3/sysext/redirects/Tests/Functional/Service/SlugServiceTest.php 90 additions, 0 deletions...xt/redirects/Tests/Functional/Service/SlugServiceTest.php
Please register or sign in to comment