Issue Bug Closed

#103778The method TYPO3\CMS\Core\Utility\CommandUtility::exec() has the wrong return type

Sebastian Mazza 05/02/24, 10:01 updated 07/09/24, 15:35

Description

On some hosting environment the following error happens while executing the Image Processing test of the install tool.

> Core: Exception handler (WEB): Uncaught TYPO3 Exception: TYPO3\CMS\Core\Utility\CommandUtility::exec(): Return value must be of type string, false returned | TypeError thrown in file /home/.sites/298/site7281255/web/t3v12/vendor/typo3/cms-core/Classes/Utility/CommandUtility.php in line 87. Requested URL: https://www.xxxxx.comt/typo3/install.php?install%5Bcontroller%5D=environment&install%5Bcontext%5D=backend&install%5Baction%5D=imageProcessingReadPdf
>

Unfortunately it is not possible anymore to execute the image tests separately like in previous versions of TYPO3. Furthermore, the install tool popup shows only “Ajax Error….” if an error occurs on any image processing Ajax request. Therefore, it is impossible to know which test leads to the problem.

My solution:
Change the method head of TYPO3\CMS\Core\Utility\CommandUtility::exec() from

public static function exec(string $command, ?array &$output = null, int &$returnValue = 0): string

to

public static function exec(string $command, ?array &$output = null, int &$returnValue = 0): string|bool

Interestingly all image test can be executed without a problem after this change. Furthermore, all images looks correct to me.

Reviews 2