christophlehmann / imageoptimizer

TYPO3 Extension for lossless image optimization with binaries of your choice.
43 stars 22 forks source link

PHP 8 compatibility #56

Closed dennismetz closed 2 years ago

dennismetz commented 2 years ago

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

akiessling commented 2 years ago

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

dennismetz commented 2 years ago

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);

akiessling commented 2 years ago

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.

dennismetz commented 2 years ago

Should be fixed in https://github.com/christophlehmann/imageoptimizer/pull/57