From 5d50fc08fe953106f9880aa892afe9e9063aee6d Mon Sep 17 00:00:00 2001
From: Helmut Hummel <typo3@helhum.io>
Date: Thu, 5 Jan 2023 13:35:51 +0100
Subject: [PATCH] [BUGFIX] Accessing unavailable site config triggers notice
 instead of warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Accessing a not available configuration via TypoScript can be
intentional (e.g. by using it in an if check).
Therefore the log entry severity should rather be downgraded to a notice.

Releases: 10.4, 11.5, main
Resolves: #99465
Change-Id: I26ed4e96290ce6839c32cc60a7cbcf7fa24d0f2b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77220
Tested-by: Helmut Hummel <typo3@helhum.io>
Reviewed-by: Helmut Hummel <typo3@helhum.io>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 .../frontend/Classes/ContentObject/ContentObjectRenderer.php    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
index d0c033c3ee5f..930ad5de4fb7 100644
--- a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
+++ b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
@@ -4480,7 +4480,7 @@ class ContentObjectRenderer implements LoggerAwareInterface
                             try {
                                 $retVal = ArrayUtility::getValueByPath($site->getConfiguration(), $key, '.');
                             } catch (MissingArrayPathException $exception) {
-                                $this->logger->warning('getData() with "{key}" failed', ['key' => $key, 'exception' => $exception]);
+                                $this->logger->notice('Configuration "{key}" is not defined for site "{site}"', ['key' => $key, 'site' => $site->getIdentifier(), 'exception' => $exception]);
                             }
                         }
                         break;
-- 
GitLab