Incorrect small image url returned from product helper
I have installed a search autocomplete extension. I noticed that when products do not have an image associated, rather than showing the "No Image" result, it showed the broken link image square. I tracked the problem to the class "\vendor\magento\module-catalog\Helper\Product.php" in the function getSmallImageUrl().
If an image is added and then removed in Magento, the database value for the image attributes will be "no_selection". The getSmallImageUrl() function only checks !$product->getSmallImage(). I believe it should be changed to the following:
$smallImage = $product->getSmallImage();
if (!$smallImage || $smallImage == "no_selection") {
Reproducing this isn't straightforward without the third part extensions. But if you add a product image, then remove it. Execute the function getSmallImageUrl(). You will get "no_selection" returned instead of the proper image retrieved by the _assetRepo object.
@AirmanAJK thank you for your feedback. Please, format this issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result. Please, also identify which version of Magento you are running.
According to contributor guide, tickets without response for two weeks should be closed. If this issue still reproducible please feel free to create the new one: format new issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result and specify Magento version.