Issue Bug Closed

#91792Automatically created redirects are not created using the DataHandler

Oliver Eglseder 07/13/20, 13:21 updated 03/31/26, 09:00

Description

Method this is about: \TYPO3\CMS\Redirects\Service\SlugService::createRedirect

Redirects created when a page slug was updated are directly written to the database via DBAL instead of the DataHandler (“DH”).
This has following drawbacks:
  • There is no access check. Redirects are created even if the user is not allowed to create redirects.
  • You can not use any hook to intercept, alter or get notfied of the redirect creation
  • The sys_history entry is written by a different function than the DH would use. The manual implementation might be forgotten when changes are made to DH’s implementation
  • You have no way of knowing the uid of the created redirect to do something with it after the creation.

Actions done by backend users should always be processed by the DH.

Reviews 2

History 1635

Show 10 earlier messages
  1. Andreas Kießling commented <span data-processor="relativetime" data-value="2020-08-04T23:27:09+00:00" > 08/04/20, 23:27 </span>

    > There is no access check. Redirects are created even if the user is not allowed to create redirects.

    And this gets even worse: after a redirect is automatically created, the info popup offers to revert the created redirects.
    But since this now uses the RecordHistory, the redirects can not be removed due to missing access rights.

  2. Richard Vollebregt commented <span data-processor="relativetime" data-value="2020-08-10T16:48:10+00:00" > 08/10/20, 16:48 </span>

    As far as I can tell, when a new redirect is added, the redirect cache isn’t cleared either. This causes a 404 until the frontend cache is cleared.

  3. Anonymous commented <span data-processor="relativetime" data-value="2020-08-17T13:53:00+00:00" > 08/17/20, 13:53 </span>

    Richard Vollebregt wrote:
    > As far as I can tell, when a new redirect is added, the redirect cache isn’t cleared either. This causes a 404 until the frontend cache is cleared.

    This is true too

  1. Oliver Bartsch commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-02-05T16:35:08+00:00" > 02/05/26, 16:35 </span>

    Applied in changeset commit:0b738bc93a4918c2e5ad2f8ad5d6b2e99acd32d5.

  2. Gerrit Code Review pushed patch set 1 for 13.4 to change 92752 status Resolved Under Review <span data-processor="relativetime" data-value="2026-02-09T11:58:00+00:00" > 02/09/26, 11:58 </span>

  3. Oliver Bartsch commented and changed status Under Review Resolved <span data-processor="relativetime" data-value="2026-02-09T16:20:11+00:00" > 02/09/26, 16:20 </span>

    Applied in changeset commit:6a16c5ac313d89bc73ea94a5b13f50e0773c11ed.