0

I recently upgraded some Symfony packages through composer and did basic upgrade commands (setup:upgrade, setup:di:compile, setup:static-content:deploy, cache:clean). Suddenly, my product pages come up blank. Every other page works fine. The system.log shows

 main.CRITICAL: TypeError: Argument 2 passed to Magento\Catalog\Block\Product\ImageFactory::getLabel() must be of the type string, null given, called in /var/www/html/vendor/magento/module-catalog/Block/Product/ImageFactory.php on line 171 and defined in /var/www/html/vendor/magento/module-catalog/Block/Product/ImageFactory.php:117

When I view the source code of a product page, it shows something like this

  <meta property="og:type" content="product" /><meta property="og:title" content="2011&#x20;Nitro&#x20;Z6&#x20;&#x20;-&#x20;Hull&#x20;Only" /><meta property="og:image" content="An error has happened during application run. See exception log for details.

I am using a custom theme, and it does have a view.xml file. I've tried disabling modules that effect the frontend, with no change.

Has anyone had this issue, or do you have any idea on what I can do to fix this?

Magento 2.4.1

3
  • Please share your code Commented Dec 20, 2020 at 4:43
  • It's not caused by any of my code, I disabled it to test
    – Hunter
    Commented Dec 21, 2020 at 15:25
  • you can check my answer below
    – mrtuvn
    Commented Dec 31, 2020 at 19:00

1 Answer 1

0

Check file etc/view.xml in your custom theme.The root cause of problem not related with any modules installed. If you don't have you need create new file with same name. Content you can copy from blank or luma depend on which theme that you want to inheritance

Example file in blank theme
https://github.com/magento/magento2/blob/2.4-develop/app/design/frontend/Magento/blank/etc/view.xml#L67
This file is mandatory for each theme where you define essential config work for your theme

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.