#111058 fluid:analyze --json always exits with code 0
Description
fluid:analyze --json returns exit code 0 also when a template contains errors. Without --json, the command returns exit code 1 in that case. A CI step that uses --json cannot fail on template errors.
Steps to reproduce
printf '<f:foo />\n' | vendor/bin/typo3 fluid:analyze --stdin --json; echo $?
The JSON output lists the error in errors, and the exit code is 0.
Expected behavior
The command returns exit code 1 if errors is not empty, as it does without --json.
Cause
In typo3/sysext/fluid/Classes/Command/AnalyzeCommand.php, execute() returns Command::SUCCESS in the --json branch without checking the result. The text output returns Command::FAILURE if there are errors. The --json option came with #109505.
Reproduced on main and 14.3 with a functional test. A patch with the test follows.
Related: #109505 (introduced the option) and #110021 (fluid:analyze in CI)
Reviews 2
History 13
-
Gerrit Code Review pushed patch set 1 for main to change 96686 status
NewUnder Review <span data-processor="relativetime" data-value="2026-10-14T15:06:07+00:00" > 10/14/26, 15:06 </span> -
Gerrit Code Review pushed patch set 1 for 14.3 to change 96707 <span data-processor="relativetime" data-value="2026-10-15T08:07:53+00:00" > 10/15/26, 08:07 </span>
-
Lina Wolf commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-15T09:35:16+00:00" > 10/15/26, 09:35 </span>
Applied in changeset commit:6f581d77337cfb4559dc43496ec0bf902efead34.