Project

General

Profile

Actions

Bug #96427

closed

Redirects module generates endless redirect loop ("Too many redirects") when renaming slug back and forth

Added by Jörn Wagner over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Miscellaneous
Target version:
-
Start date:
2021-12-22
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In TYPO3 10.4.22 (but also ever since I've used the redirects module) there is a bug when you enable autoCreateRedirects and rename slugs back and forth.

Steps to reproduce:
  1. Install TYPO3 v10 from scratch
  2. Add redirects: composer req typo3/cms-redirects ^10.4
  3. Create a homepage and site configuration
  4. Add the following to your site configuration config.yml:
settings:
redirects:
autoCreateRedirects: true
  1. Create a page below the homepage and give it the slug "demo". Save.
  2. Change the slug to "demo2", a redirect will be created.
  3. Change the slug back to "demo" and the first redirect will now be a circular reference.

This is the resulting situation in the backend:

The culprit is the fact that as target there is not a URL defined but a Typolink of the form t3://page?uid=2&_language=0. This means that the "old" slug will always redirect to whatever the current slug is ... but it is the same after these operations, resulting in a "Too many redirects" error in the browser.

The entries in sys_redirects look like this with the first line being the problematic one:


Files

typo3_redirects_bug.png (13 KB) typo3_redirects_bug.png Jörn Wagner, 2021-12-22 19:25
clipboard-202112222026-koo38.png (39.5 KB) clipboard-202112222026-koo38.png Jörn Wagner, 2021-12-22 19:26
Actions #1

Updated by Thomas Oliver Moll over 2 years ago

Hi,

I observed this behavior right away, when we switched to v9 ... I never regarded it really as a bug, but it is a huge trap for novice users.

I have no good idea how one would resolve this...
... When a Redirect is autocreated , check if it points to a redirect, that points to itself... and then what .. disable both? Or just show a Warning to the user (most of my users would not see/understand this though)

Actions #2

Updated by Jörn Wagner over 2 years ago

Thomas Oliver Moll wrote in #note-1:

Hi,

I observed this behavior right away, when we switched to v9 ... I never regarded it really as a bug, but it is a huge trap for novice users.

I have no good idea how one would resolve this...
... When a Redirect is autocreated , check if it points to a redirect, that points to itself... and then what .. disable both? Or just show a Warning to the user (most of my users would not see/understand this though)

I've also noticed it right away, that's why we always set autoCreateRedirects to false...

I think it could be solved in the RedirectService: If source and target are the same, don't issue a 301 or 307 redirect but just let the page load. Like, don't "match" if source and target are the same. This would not touch upon the redirect entry, which might be needed if the slug is changed again, but would prevent the "Too many redirects" error msg.

Actions #3

Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72808

Actions #4

Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72808

Actions #5

Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856

Actions #6

Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856

Actions #7

Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856

Actions #8

Updated by Gerrit Code Review over 2 years ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856

Actions #9

Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856

Actions #10

Updated by Gerrit Code Review over 2 years ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856

Actions #11

Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72808

Actions #12

Updated by Gerrit Code Review over 2 years ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856

Actions #13

Updated by Gerrit Code Review over 2 years ago

Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856

Actions #14

Updated by Gerrit Code Review over 2 years ago

Patch set 9 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856

Actions #15

Updated by Gerrit Code Review over 2 years ago

Patch set 10 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856

Actions #16

Updated by Gerrit Code Review over 2 years ago

Patch set 4 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72808

Actions #17

Updated by Gerrit Code Review over 2 years ago

Patch set 11 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856

Actions #18

Updated by Gerrit Code Review over 2 years ago

Patch set 12 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856

Actions #19

Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72808

Actions #20

Updated by Gerrit Code Review over 2 years ago

Patch set 13 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856

Actions #21

Updated by Gerrit Code Review over 2 years ago

Patch set 6 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72808

Actions #22

Updated by Gerrit Code Review over 2 years ago

Patch set 14 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856

Actions #23

Updated by Gerrit Code Review over 2 years ago

Patch set 7 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72808

Actions #24

Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72918

Actions #25

Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72918

Actions #26

Updated by Jörn Wagner over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #27

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF