0

I upgraded Magento2.3.4 to 2.4.3-p3. But I got issues in checkout page and cart page.

1 exception(s):
Exception #0 (Exception): Notice: Array to string conversion in /home/caterin1/test.cateringspares.com.au/vendor/magento/framework/Escaper.php on line 261

Exception #0 (Exception): Notice: Array to string conversion in /home/caterin1/test.cateringspares.com.au/vendor/magento/framework/Escaper.php on line 261
<pre>#1 Magento\Framework\Escaper->escapeHtmlAttr() called at [vendor/magento/framework/View/Element/AbstractBlock.php:931]
#2 Magento\Framework\View\Element\AbstractBlock->escapeHtmlAttr() called at [app/design/frontend/Caterings/spares/Magento_Catalog/templates/product/image_with_borders.phtml:20]
#3 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#4 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/View/Element/Template.php:273]
#5 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:303]
#6 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1114]
#7 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1118]
#8 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:678]
#9 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [app/design/frontend/Caterings/spares/Magento_Checkout/templates/cart/item/default.phtml:30]
#10 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#11 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/View/Element/Template.php:273]
#12 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:303]
#13 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1114]
#14 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1118]
#15 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:678]
#16 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/module-checkout/Block/Cart/AbstractCart.php:134]
#17 Magento\Checkout\Block\Cart\AbstractCart->getItemHtml() called at [app/design/frontend/Caterings/spares/Magento_Checkout/templates/cart/form.phtml:43]
#18 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#19 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/View/Element/Template.php:273]
#20 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:303]
#21 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1114]
#22 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1118]
#23 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:678]
#24 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Layout.php:578]
#25 Magento\Framework\View\Layout->_renderBlock() called at [vendor/magento/framework/View/Layout.php:555]
#26 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#27 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#28 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#29 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#30 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#31 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#32 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#33 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#34 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#35 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#36 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#37 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#38 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#39 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Element/AbstractBlock.php:525]
#40 Magento\Framework\View\Element\AbstractBlock->getChildHtml() called at [vendor/magento/module-checkout/view/frontend/templates/cart.phtml:16]
#41 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#42 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/View/Element/Template.php:273]
#43 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:303]
#44 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1114]
#45 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1118]
#46 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:678]
#47 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Layout.php:578]
#48 Magento\Framework\View\Layout->_renderBlock() called at [vendor/magento/framework/View/Layout.php:555]
#49 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#50 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#51 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#52 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#53 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#54 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#55 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#56 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#57 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#58 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#59 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#60 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#61 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#62 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#63 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#64 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#65 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#66 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#67 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#68 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#69 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#70 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#71 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#72 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#73 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#74 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#75 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#76 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#77 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]
#78 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]
#79 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]
#80 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#81 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]
#82 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:975]
#83 Magento\Framework\View\Layout->getOutput() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#84 Magento\Framework\View\Layout\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#85 Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#86 Magento\Framework\View\Layout\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:347]
#87 Magento\Framework\View\Layout\Interceptor->getOutput() called at [vendor/magento/framework/View/Result/Page.php:260]
#88 Magento\Framework\View\Result\Page->render() called at [vendor/magento/framework/View/Result/Layout.php:171]
#89 Magento\Framework\View\Result\Layout->renderResult() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#90 Magento\Framework\View\Result\Page\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#91 Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#92 Magento\Framework\View\Result\Page\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/Result/Page/Interceptor.php:95]
#93 Magento\Framework\View\Result\Page\Interceptor->renderResult() called at [vendor/magento/framework/App/Http.php:120]
#94 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#95 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]
#96 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:29]
</pre>

How to fix issues?

0

1 Answer 1

1

Edit app/design/frontend/Caterings/spares/Magento_Catalog/templates/product/image_with_borders.phtml
To replace:

<?= $block->escapeHtmlAttr($block->getCustomAttributes()) ?>

With

<?php foreach ($block->getCustomAttributes() as $name => $value): ?>
    <?= $escaper->escapeHtmlAttr($name) ?>="<?= $escaper->escapeHtml($value) ?>"
<?php endforeach; ?>
2
  • Thank you. you are a good dev. I completed it.
    – Bohdan V.
    Dec 14, 2022 at 8:49
  • @BohdanV. Glad to hear that!
    – Tu Van
    Dec 14, 2022 at 8:54

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.