0

When you click on a product page, it only shows a one image. Looking at the stack trace, it looks like there is some PHP error. I think when I patched to 2.3.2, maybe something didn't updated? How do I recover?

eg. click the product, then it is only the product image showing afterwards. enter image description here

<div class="gallery-placeholder _block-content-loading" data-gallery-role="gallery-placeholder">
<img
alt="main product photo"
class="gallery-placeholder__image"
src="https://steamspeed.com/pub/media/catalog/product/cache/85991805028918d3c76d0ac026e0a79d/j/b/jb-rebuild_1000x1000.png"
/>
</div>

<script type="text/x-magento-init">
{
"[data-gallery-role=gallery-placeholder]": {
"mage/gallery/gallery": {
"mixins":["magnifier/magnify"],
"magnifierOpts": {"fullscreenzoom":"5","top":"","left":"","width":"","height":"","eventType":"hover","enabled":false},
"data": [{"thumb":"https:\/\/steamspeed.com\/pub\/media\/catalog\/product\/cache\/155e93c92386e3c82347ea16620ccbd3\/j\/b\/jb-rebuild_1000x1000.png","img":"https:\/\/steamspeed.com\/pub\/media\/catalog\/product\/cache\/85991805028918d3c76d0ac026e0a79d\/j\/b\/jb-rebuild_1000x1000.png","full":"https:\/\/steamspeed.com\/pub\/media\/catalog\/product\/cache\/8626c40ec5098cb7aa441a37fc63fc11\/j\/b\/jb-rebuild_1000x1000.png","caption":"SteamSpeed Journal Bearing Rebuild Kit for MHI Compatible CHRA","position":"1","isMain":true,"type":"image","videoUrl":null}],
"options": <br />
<b>Fatal error</b>: Uncaught Error: Call to a member function getOptionsJson() on null in /var/www/vhosts/steamspeed.com/httpdocs/vendor/magento/module-catalog/view/frontend/templates/product/view/gallery.phtml:48
Stack trace:
#0 /var/www/vhosts/steamspeed.com/httpdocs/vendor/magento/framework/View/TemplateEngine/Php.php(59): include()
#1 /var/www/vhosts/steamspeed.com/httpdocs/vendor/magento/framework/View/Element/Template.php(271): Magento\Framework\View\TemplateEngine\Php-&gt;render(Object(Magento\Catalog\Block\Product\View\Gallery\Interceptor), '/var/www/vhosts...', Array)
#2 /var/www/vhosts/steamspeed.com/httpdocs/generated/code/Magento/Catalog/Block/Product/View/Gallery/Interceptor.php(505): Magento\Framework\View\Element\Template-&gt;fetchView('/var/www/vhosts...')
#3 /var/www/vhosts/steamspeed.com/httpdocs/vendor/magento/framework/View/Element/Template.php(301): Magento\Catalog\Block\Product\View\Gallery\Interceptor-&gt;fetchView('/var/www/vhosts...')
#4 /var/www/vhosts/steamspeed.com/httpdocs/vendor/magento/framework/View/Elemen in <b>/var/www/vhosts/steamspeed.com/httpdocs/vendor/magento/module-catalog/view/frontend/templates/product/view/gallery.phtml</b> on line <b>48</b><br />
  • Have you customized the catalog_product_view. xml under the app folder. Magento_Catalog/layout/catalog_product_view.xml – Rathna Jul 17 at 17:58
0

Magento changed up that block declaration in vendor/magento/module-catalog/view/frontend/layout/catalog_product_view.xml as of 2.3.2. The related change is...

pre-2.3.2

<block class="Magento\Catalog\Block\Product\View\Gallery" name="product.info.media.image" template="Magento_Catalog::product/view/gallery.phtml"/>

2.3.2

<block class="Magento\Catalog\Block\Product\View\Gallery" name="product.info.media.image" template="Magento_Catalog::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>

You likely have an extension or your theme customizing this layout and need to make sure that the new arguments are being passed in like noted above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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