[TASK] Log message when typolink fails 95/56995/2
authorMathias Brodala <mbrodala@pagemachine.de>
Thu, 17 May 2018 13:39:44 +0000 (15:39 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Fri, 18 May 2018 13:15:48 +0000 (15:15 +0200)
We log this as debug to not fill system logs by default.

Resolves: #85034
Releases: master, 8.7
Change-Id: Ica686e42fa7a2ef09f2f5c4bf9b91781f5c14dc9
Reviewed-on: https://review.typo3.org/56995
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index 0ec55de..f1d5292 100644 (file)
@@ -5272,6 +5272,8 @@ class ContentObjectRenderer implements LoggerAwareInterface
             try {
                 list($this->lastTypoLinkUrl, $linkText, $target) = $linkBuilder->build($linkDetails, $linkText, $target, $conf);
             } catch (UnableToLinkException $e) {
+                $this->logger->debug(sprintf('Unable to link "%s": %s', $e->getLinkText(), $e->getMessage()), ['exception' => $e]);
+
                 // Only return the link text directly
                 return $e->getLinkText();
             }