Review main Merged Breaking

95022[!!!][TASK] Turn XML sitemap data providers into services

Benni Mack CR +2 V +2 Expert +1366 −263 updated 08/03/26, 14:53

Commit message

`XmlSitemapDataProviderInterface` declared a constructor, which is a
construction detail and not part of a behavioral contract. It forced
every data provider to be instantiated with its runtime information as
constructor arguments, so providers could never be resolved by the
dependency injection container and had to fetch all their dependencies
statically. It also forced the items of a sitemap to be collected in the
constructor, since the interface methods took no arguments.

Construction and invocation are separated now: The interface declares
the single method `getSitemap()`, which receives all runtime information
as `XmlSitemapRequest` - the name of the requested sitemap, its
configuration, the number of the requested page, the request and a
content object renderer - and returns an `XmlSitemap` carrying the items
of that page, the last modification date and the number of pages. The
methods `getKey()`, `getItems()`, `getLastModified()` and
`getNumberOfPages()` become obsolete this way.

Data providers are stateless services as a result. The interface is
tagged with `seo.xmlsitemap.provider`, and `XmlSitemapFactory` resolves
the provider configured in TypoScript from a service locator, so the
TypoScript registration by class name stays untouched. The two Core
providers use constructor injection now, which removes eight
`GeneralUtility::makeInstance()` calls.

`XmlSitemap` resolves the items of the requested page only when they are
requested, so the sitemap index does not generate any URL anymore.

`AbstractXmlSitemapDataProvider` is deprecated, but kept functional in
v15: Data providers extending it are still instantiated with their
runtime arguments by `XmlSitemapFactory`, which allows extensions to
support TYPO3 v14 and v15 with a single implementation. Since such
providers can not be autowired, a compiler pass removes the tag from
them, otherwise an extension declaring the interface in addition to
extending the base class would break the container build.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Oliver Klee +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 27

Show 7 more files

Review log 79

  1. Benni Mack uploaded patch set 1 07/30/26, 13:44

  2. core-ci voted on patch set 1 V -1 07/30/26, 13:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105695

  3. Benni Mack uploaded patch set 2 V -1 07/30/26, 15:26

  4. Benni Mack marked it ready for review 07/30/26, 15:26

  5. core-ci voted on patch set 2 V +1 07/30/26, 15:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105701

  6. Oliver Klee voted on patch set 2 V +1 08/02/26, 08:53

  7. Simon Schaufelberger voted on patch set 2 CR +1 V +1 08/02/26, 21:23

  8. Stefan Bürk voted on patch set 2 CR +2 V +2 08/03/26, 14:52

  9. Stefan Bürk merged patch set 3 08/03/26, 14:53