Project

General

Profile

Actions

Bug #105174

closed

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

Added by Karsten Nowak (undkonsorten) about 2 months ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2024-10-01
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
13
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Feature #97816: New TypoScript parserClosed2022-06-27

Actions
Related to TYPO3 Core - Task #101453: Add native type declarations to GU array methodsClosedOliver Klee2023-07-26

Actions
Actions

Also available in: Atom PDF