Commit d01ad0a4 authored by Jochen Roth's avatar Jochen Roth Committed by Nikita Hovratov
Browse files

[BUGFIX] Do not add error in TypoScriptParser if modifier returns null

Currently, the TypoScriptParser adds an error when
the result of a modifier is null. This is, because
the line is not set to a new value in such a case
and the following switch statement is not expecting
a line with a value modifier.

This has been fixed by skipping further checks on
the value, if the modifier returns null.

Resolves: #94109
Releases: master, 11.5
Change-Id: I28ae1570a5b0b4fc5ad667bacd86a17234aa1c60
parent 47ec2ee4
Pipeline #20445 passed with stages
in 14 minutes and 17 seconds
......@@ -309,6 +309,8 @@ class TypoScriptParser
$newValue = $this->executeValueModifier($tsFunc, $tsFuncArg, $val[0]);
if (isset($newValue)) {
$line = '= ' . $newValue;
} else {
continue;
}
}
switch ($line[0]) {
......
......@@ -1263,4 +1263,18 @@ test.TYPO3Forever.TypoScript = 1
],
];
}
/**
* @test
*/
public function typoScriptWithModifierReturningNullDoesNotCreateErrors(): void
{
$typoScript = '
foo = bar
foo := getEnv(NON_EXISTING_ENV)
';
$this->typoScriptParser->parse($typoScript);
self::assertEmpty($this->typoScriptParser->errors);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment