Project

General

Profile

Actions

Bug #98053

closed

TypoScript: getData spams logfile if value in site config is missing

Added by Andreas Kiessling almost 2 years ago. Updated 19 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2022-07-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

https://github.com/TYPO3/typo3/blob/f824c51cc1/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php#L4284


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #99465: Accessing site configuration via TypoScript getData triggers a warning when configuration option does not existClosed2023-01-05

Actions
Actions #1

Updated by Andreas Kienast over 1 year ago

  • Sprint Focus set to On Location Sprint
Actions #2

Updated by Rémy DANIEL over 1 year 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.

Actions #3

Updated by Oliver Hader over 1 year ago

  • Sprint Focus deleted (On Location Sprint)
Actions #4

Updated by Andreas Kiessling over 1 year ago

  • Related to Bug #99465: Accessing site configuration via TypoScript getData triggers a warning when configuration option does not exist added
Actions #5

Updated by Andreas Kiessling over 1 year ago

Can be closed since this was downgraded to a notice in #99465

Actions #6

Updated by Riccardo De Contardi 19 days 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.

Actions

Also available in: Atom PDF