Issue Task Closed

#89301Streamline automatic slug & redirects handling

Oliver Hader 09/29/19, 11:04 updated 11/11/26, 16:32

Description

Issue #89115 introduce automatic slug handling as a new feature (which is great). However, there are a couple of things that need to be streamlined

  • probably refactor or even merge SlugService into according DataHandler hook
  • get rid of disableHook, enableHook calls (currently in SlugService) – but still avoid nested hook invocations (hook calling itself)
  • enhance test cases, consider using YAML scenario having more levels in the page tree
  • introduce sys_redirects loop detection, e.g. a -> b -> c -> a (in this case (temporary) redirects created in between could be reverted)
  • introduce UI component (settings currently only can be modified using config.yaml directly)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 28

Show 3 earlier messages
  1. Sybille Peters commented <span data-processor="relativetime" data-value="2021-01-14T08:30:43+00:00" > 01/14/21, 08:30 </span>

    You mentioned:

    > introduce sys_redirects loop detection, e.g. a -> b -> c -> a (in this case (temporary) redirects created in between could be reverted)

    There are redirect loops, but there are also redirect chains (without loops), e.g.

    a -> b -> c

    Would be good if these can be handled as well, see #93288

    And there are duplicates, see #89325. #89326

    I am not sure, if all this handling can or should be done on the fly. It would already help a lot if there were a command which would clean up all of these. (however the conflicts may be a bit difficult). I assume this should be much easier to implement.
    There is already a redirect:cleanup command.

  2. Benni Mack commented and changed status Accepted Closed <span data-processor="relativetime" data-value="2026-11-11T16:32:00+00:00" > 11/11/26, 16:32 </span>

    Status check against current main (14.x):

    • Merge SlugService into the DataHandler hook – not done, and no longer worth doing: SlugService is a separate, injectable service with PSR-14 events (ModifyAutoCreateRedirectRecordBeforePersistingEvent, AfterAutoCreateRedirectHasBeenPersistedEvent).
    • Get rid of disableHook()/enableHook() – half done: DataHandlerSlugUpdateHook::isNestedHookInvocation() already prevents nested calls via the correlation ID, but SlugService::persistNewSlug() still toggles the hook in $GLOBALS['TYPO3_CONF_VARS']. This looks redundant and can be removed in a small cleanup.
    • Improve tests with deeper page trees – mostly done: SlugServiceTest covers several page trees with CSV fixtures.
    • Redirect loop detection (a -> b -> c -> a) – open. Only direct self-redirects are caught, at request time in the RedirectHandler middleware (#96427). Multi-step loops are not detected when redirects are created, and chains are not merged (#93288 was closed on request, not fixed).
    • UI for the settings – done: redirects.autoUpdateSlugs, redirects.autoCreateRedirects etc. are site set settings and can be edited in the site settings module.

    The remaining work is tracked in more specific issues: #89326, #93294, #92004, #93545, #94003, #102137.

    I suggest closing this umbrella issue and opening a separate issue for loop detection (or covering it in #89326).