Skip to content

Commit

Permalink
Check request object in conditions (#2252)
Browse files Browse the repository at this point in the history
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: TYPO3-Documentation/TYPO3CMS-Reference-Typoscript#807
  • Loading branch information
cundd authored Nov 1, 2023
1 parent 9278834 commit 9f99a08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Documentation/Tutorials/BestPractice/Seo/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 9f99a08

Please sign in to comment.