2

Fatal error: Uncaught Error: Call to a member function getDefaultPlaceholderUrl() on null in /var/www/html/vendor/magento/module-catalog/view/frontend/templates/product/view/gallery.phtml:29 Stack trace: #0 /var/www/html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include() #1 /var/www/html/vendor/magento/framework/View/Element/Template.php(271): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\View\Gallery\Interceptor), '/var/www/html/v...', Array) #2 /var/www/html/vendor/magento/framework/View/Element/Template.php(301): Magento\Framework\View\Element\Template->fetchView('/var/www/html/v...') #3 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(1094): Magento\Framework\View\Element\Template->_toHtml() #4 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(1098): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element{closure}() #5 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(671): Magen in /var/www/html/vendor/magento/module-catalog/view/frontend/templates/product/view/gallery.phtml on line 29

2 Answers 2

1

Old question, however still relevant. Old template file catalog_product_view.xml is missing the helper that's present in gallery.phtml

Change

<block class="Magento\Catalog\Block\Product\View\Gallery" name="product.info.media.image" template="product/view/gallery.phtml">
     <arguments>
         <argument name="gallery_options" xsi:type="object">Magento\Catalog\Block\Product\View\GalleryOptions</argument>
     </arguments>
</block>

to

<block class="Magento\Catalog\Block\Product\View\Gallery" name="product.info.media.image" template="product/view/gallery.phtml">
         <arguments>
             <argument name="gallery_options" xsi:type="object">Magento\Catalog\Block\Product\View\GalleryOptions</argument>
             <argument name="imageHelper" xsi:type="object">Magento\Catalog\Helper\Image</argument>
         </arguments>
</block>
0

I have to fetch the same issue so Please, a check-In Database View is created or not If a View is not there so create view after run below command

rm -r generated/*
rm -rf var/*
cd pub/static
rm -r adminhtml
rm -r frontend

php -dmemory_limit=-1 bin/magento setup:upgrade
php -dmemory_limit=-1 bin/magento setup:static-content:deploy -f
php -dmemory_limit=-1 bin/magento indexer:reindex
php -dmemory_limit=-1 bin/magento cache:clean
php -dmemory_limit=-1 bin/magento cache:flush

may your issue resolve...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.