Bug #93746
closed
Conditions in Page TSconfig using site settings trigger errors when page with UID 0 is selected in BE
Added by Česlav Przywara about 3 years ago.
Updated 3 months ago.
Description
The subject says it all.
An example of error:
[ERROR] component="TYPO3.CMS.Backend.Configuration.TypoScript.ConditionMatching.ConditionMatcher": Expression could not be parsed. - {"expression":"{$pids.styleguide} in tree.rootLineIds"}
Since there is no site attached to page with UID 0, there are no site settings to be populated either.
Perhaps conditions that have variables in them should be simply ignored on page with UID 0?
- Related to Feature #91080: Populate site settings to TypoScript constants added
Just had the very same issue. I resolved it via declaring that constant globally (so it's also present on the root level)
From the docs we know the sequence of how the stack of constants is being put together:
The TypoScript constants are evaluated in this order:
- Global 'defaultTypoScript_constants'
- Site specific settings from the site configuration
- Constants from sys_template database records
So all I had to do is this in a ext_localconf.php:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript(
'my_extension',
'constants',
'@import \'my_extension/Configuration/GlobalSettings.typoscript\''
);
Cheerio ;-)
I solved this issue as well, albeit differently:
Instead of including TSConfig globally via ext_localconf.php
:
ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="DIR:EXT:my_extension/Configuration/TsConfig/Page">');
I just register main (bootstrap) file in Configuration/TCA/Overrides/pages.php
:
ExtensionManagementUtility::registerPageTSConfigFile(
'my_extension',
'Configuration/TsConfig/Page/example_site.tsconfig',
'Example site'
);
I then include the registered file on root page of the site it relates too. This way the TSConfig is not evaluated on global root page and there are no parsing errors.
- Status changed from New to Needs Feedback
Hey, in general extensions like gridelements should of course fire tsconfig fetching with the correct page id. I hope this was fixed meanwhile.
Apart from that, I had a look at the current site settings substitution in both FE and BE (see #92528) and fixed a bug in extbase BE modules with #102452.
Is there anything left to do for v12 and upwards?
- Related to Bug #102452: TypoScript constants from site settings are not substituted in Backend Extbase Modules added
Christian Kuhn wrote in #note-5:
Is there anything left to do for v12 and upwards?
Hallo Christian,
we have a work-around for TYPO3 10 and no problems with TYPO3 11 or newer, so I would say the issue can be closed.
- Status changed from Needs Feedback to Closed
Also available in: Atom
PDF