#91776Use the pid field to associate a redirect with the page it was created for
Description
I have a task which requires me to associate generated redirects (through slug changes) with the page that triggered the generation.
Example:
Example:
- I have the page tree
New TYPO3 site
`- [1] Root Page (slug "/")
|- [2] Something (slug "/somehting")
`- [3] Else (slug "/else")
- I change the slug of “1 Root Page” to “start”, which updates all slugs recursively
New TYPO3 site
`- [1] Root Page (slug "/start")
|- [2] Something (slug "/start/somehting")
`- [3] Else (slug "/start/else")
- This action will create 3 redirects
uid pid source_host source_path target 1 0
/ /start 2 0
/somehting /start/somehting 3 0
/else /start/else
- I would like to have these redirects associated with the page that got changed and triggered the creation of these redirects.
uid pid source_host source_path target 1 1
/ /start 2 1
/somehting /start/somehting 3 1
/else /start/else
- changing the slug of the page “2 Something” to “something” (correcting the typo) would therefore create a redirect with PID 2
uid pid source_host source_path target 4 2
/start/somehting /start/something
- In perspective this could be also used to show editors all redirect sources to a page (a list of all URLs that are redirected to the selected page)
- Should be fully backwards compatible. I did not find an obvious reason to keep them all on pid 0.
- It makes it easier for EXT:in2publish_core to find redirects for pages and publish pages including their redirects.
Reviews 3
Related issues 4
- Task #99044Ensure auto-created redirect are stored on connected site root
- Bug #99697Copying a page with existing sys_redirect throws error
- Feature #99834PSR-14 events around auto create redirects are use full for several use-cases
- Bug #102556Editor is unable to delete a page that contains an automatically created redirect