magento2-module-product-label icon indicating copy to clipboard operation
magento2-module-product-label copied to clipboard

PHP Error

Open luantran1311 opened this issue 1 year ago • 1 comments

I'm using Magento 2.4.6, and PHP8.1 and got this error thrown up in the product page, please help.

[2023-12-14T07:25:24.838952+00:00] main.CRITICAL: TypeError: Smile\ProductLabel\Block\Product\ImageFactory::getRatio(): Argument #1 ($width) must be of type int, null given, called in /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/smile/module-product-label/Block/Product/ImageFactory.php on line 84 and defined in /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/smile/module-product-label/Block/Product/ImageFactory.php:121
Stack trace:
#0 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/smile/module-product-label/Block/Product/ImageFactory.php(84): Smile\ProductLabel\Block\Product\ImageFactory->getRatio()
#1 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/generated/code/Smile/ProductLabel/Block/Product/ImageFactory/Interceptor.php(23): Smile\ProductLabel\Block\Product\ImageFactory->create()
#2 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/module-catalog/Block/Product/ImageBuilder.php(135): Smile\ProductLabel\Block\Product\ImageFactory\Interceptor->create()
#3 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/mageworx/module-seomarkup/Helper/DataProvider/Product.php(945): Magento\Catalog\Block\Product\ImageBuilder->create()
#4 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/mageworx/module-seomarkup/Block/Head/Json/Product.php(127): MageWorx\SeoMarkup\Helper\DataProvider\Product->getProductImage()
#5 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/mageworx/module-seomarkup/Block/Head/Json/Product.php(88): MageWorx\SeoMarkup\Block\Head\Json\Product->getJsonProductData()
#6 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/mageworx/module-seomarkup/Block/Head/Json.php(49): MageWorx\SeoMarkup\Block\Head\Json\Product->getMarkupHtml()
#7 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(1095): MageWorx\SeoMarkup\Block\Head\Json->_toHtml()
#8 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(1099): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}()
#9 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(660): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#10 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Element\AbstractBlock->toHtml()
#11 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/Interception/Interceptor.php(138): MageWorx\SeoMarkup\Block\Head\Json\Product\Interceptor->___callParent()
#12 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/Interception/Interceptor.php(153): MageWorx\SeoMarkup\Block\Head\Json\Product\Interceptor->Magento\Framework\Interception\{closure}()
#13 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/generated/code/MageWorx/SeoMarkup/Block/Head/Json/Product/Interceptor.php(23): MageWorx\SeoMarkup\Block\Head\Json\Product\Interceptor->___callPlugins()
#14 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/View/Layout.php(578): MageWorx\SeoMarkup\Block\Head\Json\Product\Interceptor->toHtml()
#15 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/View/Layout.php(555): Magento\Framework\View\Layout->_renderBlock()
#16 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement()
#17 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(511): Magento\Framework\View\Layout->renderElement()
#18 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/var/view_preprocessed/pub/static/vendor/magento/module-theme/view/frontend/templates/html/container.phtml(1): Magento\Framework\View\Element\AbstractBlock->getChildHtml()
#19 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('/home/910072.cl...')
#20 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render()
#21 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent()
#22 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}()
#23 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php(23): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins()
#24 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php\Interceptor->render()
#25 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView()
#26 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(1095): Magento\Framework\View\Element\Template->_toHtml()
#27 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(1099): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}()
#28 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(660): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#29 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Element\AbstractBlock->toHtml()
#30 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Element\Template\Interceptor->___callParent()
#31 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Element\Template\Interceptor->Magento\Framework\Interception\{closure}()
#32 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/generated/code/Magento/Framework/View/Element/Template/Interceptor.php(23): Magento\Framework\View\Element\Template\Interceptor->___callPlugins()
#33 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/View/Result/Page.php(253): Magento\Framework\View\Element\Template\Interceptor->toHtml()
#34 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/View/Result/Layout.php(171): Magento\Framework\View\Result\Page->render()
#35 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult()
#36 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent()
#37 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/amasty/module-page-speed-tools/Plugin/ProcessPageResult.php(46): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}()
#38 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/Interception/Interceptor.php(135): Amasty\PageSpeedTools\Plugin\ProcessPageResult->aroundRenderResult()
#39 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}()
#40 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(32): Magento\Framework\View\Result\Page\Interceptor->___callPlugins()
#41 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/App/Http.php(120): Magento\Framework\View\Result\Page\Interceptor->renderResult()
#42 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http->launch()
#43 /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/pub/index.php(29): Magento\Framework\App\Bootstrap->run()
#44 {main} {"exception":"[object] (TypeError(code: 0): Smile\\ProductLabel\\Block\\Product\\ImageFactory::getRatio(): Argument #1 ($width) must be of type int, null given, called in /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/smile/module-product-label/Block/Product/ImageFactory.php on line 84 at /home/910072.cloudwaysapps.com/zvermyqtgv/public_html/vendor/smile/module-product-label/Block/Product/ImageFactory.php:121)"} []

luantran1311 avatar Dec 14 '23 07:12 luantran1311

[2023-12-14T07:25:24.838952+00:00] main.CRITICAL: TypeError: Smile\ProductLabel\Block\Product\ImageFactory::getRatio(): Argument #1 ($width) must be of type int, null given - you need to check the passed argument. Most likely, the images in the folder referenced by the ImageFactory class method have been deleted

SafronovVl avatar Dec 16 '23 17:12 SafronovVl