PHP Runtime Deprecation Notice: trim(): Passing null to parameter #1 ($string) of type string is deprecated

we are using a licensed version of sg_cookie_optin in our Typo3. I just wanted to report a bug, but I didn’t want to sign in to your gitlab.

There is a problem with the newest version when using PHP 8.1, I fixed the problem on my own now.

TYPO3-Version 11.5.24

PHP-Version 8.1.13

Error: PHP Runtime Deprecation Notice: trim(): Passing null to parameter #1 (closed) ($string) of type string is deprecated in XXX/typo3conf/ext/sg_cookie_optin/Contrib/mustache/src/Mustache/Tokenizer.php line 109

File: /typo3conf/ext/sg_cookie_optin/Contrib/mustache/src/Mustache/Tokenizer.php

Line: 109

Problem: No Json configuration is written (and the consent wil not be displayerd)

OLD:

if (delimiters = trim(delimiters)) {

          $this->setDelimiters($delimiters);

}

NEW (FIX):

if ($delimiters && delimiters = trim(delimiters)) {

          $this->setDelimiters($delimiters);

}

Hope that helps!

Edited by Stefan Galinski
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information