Review main Ready for review Orphaned

91313[FEATURE] Skip auto-redirect for never-published hidden pages

Regis TEDONE CR 0 V -1 Normal +114 −4 updated 02/27/26, 18:00

Commit message

Prevents automatic redirect creation when updating slugs on pages
that are currently hidden and have never been published. This avoids
creating redirects for draft pages still in development.

The implementation checks the page history to determine if the page
has ever transitioned from hidden to visible state.

Note: Performance may be impacted for pages with extensive history.
Consider caching publication status in future iterations.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 7
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/13/91313/7 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/13/91313/7 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V -1 Blocked
    • core-ci -1 CI

Merge conflicts 1

Issues 1

Files 2

Review log 1017

  1. Regis TEDONE uploaded patch set 1 10/28/25, 16:16

  2. core-ci voted on patch set 1 V -1 10/28/25, 16:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87861

  3. Regis TEDONE uploaded patch set 2 V -1 10/28/25, 16:36

  4. core-ci voted on patch set 2 V +1 10/28/25, 16:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87864

  5. Stefan Bürk commented on patch set 2 10/28/25, 20:07

    DataHandlerSlugUpdateHook.php:72 Unresolved

    Is it not possible to handle that check in factory method ``` SlugRedirectChangeItemFactory::create() ``` which already includes a todo ``` // @todo Consider to omit hidden or scheduled records completly, eventually based on configuration. $original ??= BackendUtility::getRecordWSOL('pages', $pageId); if (!$original) { return null; } ``` Not sure if it makes a difference that getRecordWSOL() is used in the factory versus used `getRecord()` here. I'm asking, because I guess this should also be done in ``` SlugService::checkSubPages() ``` In case the "direct" page is not hidden OR it was already published beside beeing currently hidden, it is changed ... and also subpages. Does that make sense ? In any case a valid not hidden page is given, how should sub pages be handled if hidden and not already published ? not updated, updated ?! I guess this needs some more thinking. Still, I would love to see if it could be moved into the factory if possible.

    DataHandlerSlugUpdateHook.php:76 Unresolved

    I have some performance consideration regarding the record history check: * First, we could make this conditional and only check that in case the page is hidden and in case it is not hidden we can avoid that check (page history can be grow large). * Second, not sure .. but we maybe could invest some time if we could come up with a clever query to avid retrieving the whole record history items here to check for this .... maybe not. At least we should add a @todo to rethink this for the future.

    DataHandlerSlugUpdateHook.php:79 Unresolved

    Regarding the history check ... that is not really reliable at all, despite the above mentioned performance considerations. In case a page is hidden and have been published in the past, but the history has been cleared for example with `Admin Tools -> Maintenance -> Clear Persistent Database Tables -> sys_history` than this would not handle the redirect anymore and introducing a inconsistency behaviour in instances which will give developers, integrators, consultants or support members hard times to figure out why some hidden pages get auto-redirects created and other not. That would also kick in for older instances upgraded with real old content published one time and set back to hidden .. but history data got lost, either by considering not to migrate the history or by clearing it from time to time. Not sure about a good solution or how to work here, but wanted to state that already so other can think also about this fact.
  6. Oliver Hader commented on patch set 2 10/29/25, 14:34

    Thanks Regis for your contribution and the idea of using the history service. If we had several of these analyses (has a page or record already been published, translated, moved, or whatever), it would make sense to derive a small materialized view from the historical items and keep it updated repeatedly (either explicitly like the reference index, or by using hooks/events). And if the history does not exist or is unreliable, the previous behavior is used. In any way, it helps to improve the user experience and scenario. --- Thus, what I actually wanted to suggest, is having a new dedicated service for that, e.g. `AuditTrailService::recordWasPublished(tableName: 'pages', uid: 123, workspace: <optional>)` that could be used by other TYPO3 components as well.
  7. Oliver Hader commented on patch set 2 10/29/25, 14:36

    Reply Unresolved

    And for this use-case here `recordWasVisible(tableName: 'pages', uid: 123)`, wrapping all the history related lookup in that dedicated service.
  8. Oliver Hader updated the commit message in patch set 3 V +1 10/29/25, 14:37

  9. core-ci voted on patch set 3 V +1 10/29/25, 14:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87990

  10. Regis TEDONE uploaded patch set 4 V +1 10/30/25, 17:16

  11. core-ci voted on patch set 4 V +1 10/30/25, 17:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88173

  12. Regis TEDONE uploaded patch set 5 V +1 10/30/25, 19:29

  13. core-ci voted on patch set 5 V -1 10/30/25, 19:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88182

  14. Regis TEDONE uploaded patch set 6 V -1 10/31/25, 09:39

  15. core-ci voted on patch set 6 V +1 10/31/25, 09:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88235

  16. Regis TEDONE rebased onto patch set 7 V +1 02/27/26, 17:20

  17. core-ci voted on patch set 7 V -1 02/27/26, 18:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96986