From 9f99a082ed81b2c8a0066cc82cbcef760545639f Mon Sep 17 00:00:00 2001 From: Daniel Corn Date: Wed, 1 Nov 2023 18:43:04 +0100 Subject: [PATCH] Check request object in conditions (#2252) Prevent the PHP error 'Unable to call method "getQueryParams" of non-object "request".' in contexts without a request object (i.e. CLI). See matching pull request on TYPO3 core: https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-Typoscript/pull/807 --- Documentation/Tutorials/BestPractice/Seo/Index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/Tutorials/BestPractice/Seo/Index.rst b/Documentation/Tutorials/BestPractice/Seo/Index.rst index ed10e63790..5d4524be58 100644 --- a/Documentation/Tutorials/BestPractice/Seo/Index.rst +++ b/Documentation/Tutorials/BestPractice/Seo/Index.rst @@ -295,7 +295,7 @@ Solution: You can use the following TypoScript condition to allow search engines .. code-block:: typoscript - [traverse(request.getQueryParams(), 'tx_news_pi1/news') > 0] + [request && traverse(request.getQueryParams(), 'tx_news_pi1/news') > 0] page.meta.robots = index,follow page.meta.robots.replace = 1 [global]