Using site configuration in TCA not working for new page

Hello everyone,

I’m surprised that I can’t find any information on the following topic anywhere, because I don’t think it’s such a special case.

It’s about the topic “Using site configuration in TCA foreign_table_where” (Using site configuration in TCA foreign_table_where — TYPO3 Explained main documentation)

“###SITE:mySetting.categoryPid###” does not work when you are in the form to create a new page.
The TCA for pages has therefore been extended and exactly this configuration has been implemented.

As no site object exists at this point, it is from the “NullSite” object. This is why the parsing in AbstractitemProvider->parseSiteConfiguration() exits at this point and produces an error, because it doesn’t parse the statement. Since no site exists, the site configuration cannot be read.

I could not find anything suitable on this topic either via search engines, forge.typo3.org, Slack or or or.

Summary:
“Using site configuration in TCA foreign_table_where” does not work for creating a pages record.

Are there any tips on how I can proceed here?

Currently using TYPO3 V11, V12 is in progress, but results in same behavior.

Shown error:

Hi Philipp!

I suspect this problem occurs because a page that has not yet been created yet, technically doesn’t belong to a site. However, I also suspect it’s possible to figure out which site it should belong to. Conclusion: This sounds like a bug and it sounds like it can be fixed.

I suggest you submit a bug report. (Please post a link to the bug report here afterwards so future readers can check the status.)

— Mathias

1 Like

Thanks for you reply Mathias.

I´ve created an Bug-Issue: https://forge.typo3.org/issues/103573

1 Like

Hi!

I created a patch that should fix your issue. Feel free to try it out. https://review.typo3.org/c/Packages/TYPO3.CMS/+/83720

— Mathias

1 Like