Bug #98053
closedTypoScript: getData spams logfile if value in site config is missing
0%
Description
I extend the site configuration with custom fields like Google TagManager ID etc, stuff that you previously used to put in some site specific constants.
When i access this value via TS however, i get a warning in the log if the value is not set. This might very well happen in multidomain setups when not each site has the same config.
Example:
page { meta { facebook-domain-verification.data = site:facebookDomainVerification
I also can not add an if.isTrue.data since this throws the same warning.
Accessing site: values is the only place in getData that creates a warning, while all other places either fail silently or just output an empty string. So IMHO the behavior should be the same and just return nothing if the value is not set
Updated by Andreas Kienast over 2 years ago
- Sprint Focus set to On Location Sprint
Updated by Rémy DANIEL over 2 years ago
The log was introduced with https://review.typo3.org/c/Packages/TYPO3.CMS/+/58947/ for a reason: to catch an exception and allow the developer to fix it.
Instead of silently returning an empty string, maybe the log level can just be lowered (notice instead of warning), or a E_USER_NOTICE can be issued.
Updated by Oliver Hader about 2 years ago
- Sprint Focus deleted (
On Location Sprint)
Updated by Andreas Kießling almost 2 years ago
- Related to Bug #99465: Accessing site configuration via TypoScript getData triggers a warning when configuration option does not exist added
Updated by Andreas Kießling almost 2 years ago
Can be closed since this was downgraded to a notice in #99465
Updated by Riccardo De Contardi 7 months ago · Edited
- Status changed from New to Closed
Andreas Kiessling sorry for this late reply and thank you for your update!
I am closing this issue in agreement with the reporter.
If you think that this is the wrong decision please reopen it or open a new issue with a reference to this one.
Thank you.