Issue Bug Closed

#105174Type error for GeneralUtility::trimExplode() called in AbstractAstBuilder on frontend request if value modification "removeFromList" is used

Karsten Nowak (undkonsorten) 10/01/24, 15:04 updated 12/02/25, 14:32

Description

Sometimes, $originalValue is null in evaluateValueModifier function in TYPO3\CMS\Core\TypoScript\AST\AbstractAstBuilder.php

(1/1) TypeError
TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(): Argument #2 ($string) must be of type string, null given, called in /app/vendor/typo3/cms-core/Classes/TypoScript/AST/AbstractAstBuilder.php on line 229

I’m using

TCEFORM.tt_content {
  CType {
    removeItems := removeFromList(menu_section)
  }
}

in my TS-Config. I’m using 2 different files for TS-Config. First file (file-A) is included in root page (Page-A) of the website. Second (file-B) is included on a subpage (Subpage-B).

In file-A removeItems property is already set and have some CType values they should be removed. In file-B one CType should be allowed on the subpages.
If I use this structure of included TS-Config (seems absolutely correct for me), the removeItems property is not set by the file-A if a frontend request of
Subpage-B is taken.

$orignalValue in evaluateValueModifier in AbstractAstBuilder.php is null.

If I go to the backend to show the active TS-Config for Subpage-B there is no problem, no error. Everything works. Only the frontend request throws an error.

Reviews 1