#89301Streamline automatic slug & redirects handling
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.
Related issues 20
- Feature #89115Auto-create Redirects on Slug Changes
- Task #89325Prevent duplicate redirects in backend module
- Bug #89326Prevent duplicate redirects in auto redirects
- Bug #89327Auto redirect: Could not resolve target page
- Bug #89328Auto redirect does not respect language host
- Bug #91557Auto slug update creates not working redirect
- Bug #91792Automatically created redirects are not created using the DataHandler
- Bug #91936Documentation missing to disable automatic creation of redirects on slug change
- Feature #92004Create redirect entry if updated slug is published to live
- Bug #92448changing slug again after reverting an auto update causes wrong URLs on sub pages
- Bug #92748Infinite redirects (redirect loop) when updating slugs
- Bug #93230TYPO3 memory issues when changing slugs
- Bug #93287Avoid creation of unnecessary redirects on Slug changes
- Feature #93288Merge redirect chains
- Task #93294Improve automatic slug handling
- Bug #93370Redirects: non-admin users can not revert redirects via popup (although BE notification claims otherwise)
- Feature #93545Inverse the behaviour of redirect creation after slug update
- Bug #94003Automatic update of subpages slugs not working for copy of subtree
- Bug #94004Automatic update of subpages slugs ignores columnsOverrides
- Bug #102137Problems due to automatic redirects
History 28
Show 3 earlier messages
-
Oliver Hader changed category <span data-processor="relativetime" data-value="2019-09-29T11:04:23+00:00" > 09/29/19, 11:04 </span>
-
Oliver Hader changed Related to #89115 <span data-processor="relativetime" data-value="2019-09-29T11:04:32+00:00" > 09/29/19, 11:04 </span>
-
Oliver Hader changed description <span data-processor="relativetime" data-value="2019-09-29T11:07:13+00:00" > 09/29/19, 11:07 </span>
-
Oliver Hader changed description <span data-processor="relativetime" data-value="2019-10-01T12:26:24+00:00" > 10/01/19, 12:26 </span>
-
Guido Schmechel changed Related to #89325 <span data-processor="relativetime" data-value="2019-10-01T21:02:17+00:00" > 10/01/19, 21:02 </span>
-
Guido Schmechel changed Related to #89326 <span data-processor="relativetime" data-value="2019-10-01T21:04:52+00:00" > 10/01/19, 21:04 </span>
-
Guido Schmechel changed Related to #89327 <span data-processor="relativetime" data-value="2019-10-01T21:11:03+00:00" > 10/01/19, 21:11 </span>
-
Guido Schmechel changed Related to #89328 <span data-processor="relativetime" data-value="2019-10-01T21:35:17+00:00" > 10/01/19, 21:35 </span>
-
Sybille Peters commented <span data-processor="relativetime" data-value="2021-01-14T08:30:43+00:00" > 01/14/21, 08:30 </span>
-
Sybille Peters changed Related to #93288 <span data-processor="relativetime" data-value="2021-01-14T08:31:04+00:00" > 01/14/21, 08:31 </span>
-
Torben Hansen changed Related to #93294 <span data-processor="relativetime" data-value="2021-01-15T09:14:40+00:00" > 01/15/21, 09:14 </span>
-
Daniel Goerz changed Related to #91936 <span data-processor="relativetime" data-value="2021-03-19T09:15:45+00:00" > 03/19/21, 09:15 </span>
-
Daniel Goerz changed Related to #91792 <span data-processor="relativetime" data-value="2021-03-19T09:16:56+00:00" > 03/19/21, 09:16 </span>
-
Daniel Goerz changed Related to #92004 <span data-processor="relativetime" data-value="2021-03-19T09:18:43+00:00" > 03/19/21, 09:18 </span>
-
Daniel Goerz changed Related to #93545 <span data-processor="relativetime" data-value="2021-03-19T09:19:57+00:00" > 03/19/21, 09:19 </span>
-
Daniel Goerz changed Related to #91557 <span data-processor="relativetime" data-value="2021-03-19T09:28:24+00:00" > 03/19/21, 09:28 </span>
-
Sybille Peters changed Related to #94003 <span data-processor="relativetime" data-value="2021-05-16T06:22:39+00:00" > 05/16/21, 06:22 </span>
-
Sybille Peters changed Related to #94004 <span data-processor="relativetime" data-value="2021-05-16T06:22:50+00:00" > 05/16/21, 06:22 </span>
-
Sybille Peters changed Related to #93370 <span data-processor="relativetime" data-value="2021-05-16T06:23:12+00:00" > 05/16/21, 06:23 </span>
-
Dennis Prinse changed Related to #93230 <span data-processor="relativetime" data-value="2021-11-03T10:13:09+00:00" > 11/03/21, 10:13 </span>
-
Oliver Hader changed Sprint Focus On Location Sprint <span data-processor="relativetime" data-value="2022-11-03T13:43:59+00:00" > 11/03/22, 13:43 </span>
-
Oliver Hader changed Related to #93287 <span data-processor="relativetime" data-value="2022-11-03T14:41:47+00:00" > 11/03/22, 14:41 </span>
-
Benni Mack changed Sprint Focus
On Location Sprint<span data-processor="relativetime" data-value="2023-08-02T13:04:56+00:00" > 08/02/23, 13:04 </span> -
Markus Klein changed category <span data-processor="relativetime" data-value="2023-11-09T13:28:27+00:00" > 11/09/23, 13:28 </span>
-
Markus Klein changed Related to #92448 <span data-processor="relativetime" data-value="2023-11-09T13:28:49+00:00" > 11/09/23, 13:28 </span>
-
Markus Klein changed Related to #92748 <span data-processor="relativetime" data-value="2023-11-09T13:29:01+00:00" > 11/09/23, 13:29 </span>
-
Markus Klein changed Related to #102137 <span data-processor="relativetime" data-value="2023-11-09T13:29:42+00:00" > 11/09/23, 13:29 </span>
-
Benni Mack commented and changed status
AcceptedClosed <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, butSlugService::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:
SlugServiceTestcovers 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
RedirectHandlermiddleware (#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.autoCreateRedirectsetc. 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).
- Merge SlugService into the DataHandler hook – not done, and no longer worth doing: SlugService is a separate, injectable service with PSR-14 events (
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.