yireo / Yireo_NextGenImages

45 stars 29 forks source link

Fixed error 'Argument #1 () must not be empty' on PHP 8 #36

Closed khoimm92 closed 2 years ago

khoimm92 commented 2 years ago

This PR fixed the error that appears on PHP 8.x.

ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must not be empty in .../vendor/yireo/magento2-next-gen-images/Util/HtmlReplacer.php:138

My fix will ignore the process case of the empty HTML.

jissereitsma commented 2 years ago

Thanks. This sounds like a useful fix. I'll merge right away. But under which circumstance would the HTML be empty?

tim-breitenstein-it commented 2 years ago

Thanks. This sounds like a useful fix. I'll merge right away. But under which circumstance would the HTML be empty?

For me it happens if the product has no reviews: /review/product/listAjax/id/1/ retuns a empty HTML response.

When will the version with this fix be available?

jissereitsma commented 2 years ago

Right now! :) Version 0.3.11 is now available.