Issue Bug Resolved

#111058 fluid:analyze --json always exits with code 0

Lina Wolf 10/14/26, 15:05 updated 10/15/26, 09:35

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

  1. Lina Wolf commented and changed status Under Review Resolved done 0 % 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.