Review main Ready for review Quiet

96030[BUGFIX] Resolve site markers in forms without a resolved site

Christian Spoo CR 0 V 0 Normal +99 −9 updated 10/01/26, 08:49

Commit message

AbstractItemProvider::parseSiteConfiguration() returned no
replacements when the site was null or a NullSite. The ###SITE:...###
markers then stayed in foreign_table_where, the query failed and the
error was stored as a session flash message. This affected records on
pid 0, pages outside a configured site, treeConfig.startingPoints and
the minimal FormEngine compile used for the page tree toolbar, the
page wizard and the "create multiple pages" view.

Without a Site instance, markers now resolve against an empty
configuration. Markers which cannot be resolved, also missing keys of
a resolved site, now become SQL NULL instead of an empty string. An
empty string is invalid for integer columns on PostgreSQL, while
e.g. IN (NULL) is valid for any column type and matches nothing.

Additionally, the three controllers which only need the doktype items
now add TcaColumnsRemoveUnused and process only the doktype column,
which avoids needless relation queries.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 4
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/30/96030/4 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/30/96030/4 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Merge conflicts 5

Issues 1

Files 7

Review log 812

  1. Christian Spoo uploaded patch set 1 09/24/26, 09:20

  2. core-ci voted on patch set 1 V +1 09/24/26, 09:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109145

  3. Wolfgang Klinger commented on patch set 1 CR -1 09/25/26, 05:37

    Thanks for the patch. Limiting the compile to "doktype" is a good optimisation, but it does not fix #110182. The cause is AbstractItemProvider::parseSiteConfiguration(). It returns an empty array when $result['site'] is null or a NullSite. The caller then skips the replacement and the ###SITE:...### placeholder stays in the SQL. Every form without a resolved site still runs into this: records on pid 0, pages outside a configured site, and treeConfig.startingPoints, which uses the same helper. The issue reporter also asks that an unresolved site must not raise an error. My suggestion: fix it in parseSiteConfiguration() by falling back to an empty configuration when there is no Site instance. Unresolved placeholders then resolve to an empty string and get quoted, so IN ('') is valid SQL that matches nothing. That is about three lines plus a test in TcaSelectItemsTest.
  4. Christian Spoo uploaded patch set 2 CR -1 V +1 09/25/26, 09:40

  5. core-ci voted on patch set 2 V -1 09/25/26, 09:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109234

  6. Christian Spoo uploaded patch set 3 V -1 09/25/26, 10:19

  7. Christian Spoo commented on patch set 3 09/25/26, 10:23

    Reply

    Thanks for your review and your thoughts regarding the underlying issue. I added that to my patchset. However, it turned out that PostgreSQL does not like comparing integer columns with IN ('') which is why I changed the value to SQL null which validates against every column type.
  8. core-ci voted on patch set 3 V +1 09/25/26, 10:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109235

  9. Wolfgang Klinger commented on patch set 3 CR +1 09/25/26, 11:14

    The data provider parameter could be ?SiteInterface instead of ?NullSite. Thanks for the update.
  10. Benni Mack uploaded patch set 4 CR +1 V +1 10/01/26, 08:39

  11. Benni Mack marked it ready for review 10/01/26, 08:47

  12. core-ci voted on patch set 4 V +1 10/01/26, 08:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109770