Review main Merged

77535[BUGFIX] Verify early for valid auto redirect creation or slug update

Stefan Bürk CR +2 V +2 Normal +145 −2 updated 01/23/23, 18:10

Commit message

Automatically creating redirects on page slug changes and/or
updating children page slugs is bound to a SiteConfiguration.
This means that only pages which has a proper SiteConfiguration
up in the rootline and the corresponding configuration options
set should lead to processing them.

In the past this has been checked and handled late in the service
class `TYPO3\CMS\Redirects\Service\SlugService`. These checks are
still there for proper workflow determination.

With #99188 the `ext:redirects` auto create workflow has been
streamlined as a preparatin for upcoming features and events,
which introduced the `SlugRedirectChangeItem` as a modern data
transport container. This item is created by a corresponding
factory, which als determined and set the corresponding Site
and SiteLanguage object to the change item.

If no site configuration can be found, a `SiteNotFoundException`
is thrown and not properly handled. Some instances may use
`SysFolder` beneath root point (pid === 0) with subpages without
a proper site configuration created on the `SysFolder`. Through
the streamlining in #99188 this is not properly covered and the
`SiteNotFoundException` not properly handled.

This change catches the `SiteNotFoundException` in the factory
service and additionally verify the configuration options early
if a change should be handled or not. If no handling needed or
no SiteConfiguration found, the factory now returns null instead
of a `SlugRedirectChangeItem`.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 2

Files 5