christophlehmann/imageoptimizer

PHP 8 compatibility

dennismetz opened this issue · 4 comments

Hi, I am testing PHP 8.1 and I noticed that there is a small error in the status report.

PHP Warning: Undefined array key "svgOnProcessing" in .../typo3conf/ext/imageoptimizer/Classes/StatusReport.php line 26

This should already be fixed by #54
Can you try if the current master works for you?

Hi, sorry for the late reply, unfortunately I did not get to test before.
I unfortunately still have the same problem with the current master.

But as soon as I add "?? null" as a check to the array, everything fits again and I get it displayed without errors.

StatusReport.php, line 25+26
$binaryUsed = ((bool)($configuration[$extension . 'OnUpload'] ?? null) === true || (bool)($configuration[$extension . 'OnProcessing'] ?? null) === true);

You are right! I only patched the OptimizeImageServce but this is in the StatusReport :)
Can you come up with a patch? Otherwise i can try to fit this in.

Should be fixed in #57