Retrieving a Block with a <Products> PB component results in a 500 error
alecarg opened this issue · 5 comments
Magento version 2.3.x
Seems to correctly parse other PB components, but not the one. The out-of-the-box API equivalent returns a 200, but isn't filtered:
ie.
{{widget type="Magento\CatalogWidget\Block\Product\ProductsList" template="Magento_CatalogWidget::product/widget/content/grid.phtml" anchor_text="" id_path="" show_pager="0" products_count="1" type_name="Catalog Products List" conditions_encoded="^[`1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`aggregator`:`all`,`value`:`1`,`new_child`:``^],`1--1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:`category_ids`,`operator`:`==`,`value`:`34`^]^]"}}
Any ideas why this would happen?
Hi @alecarg , thanks for opening the issue, could you please provide us with the exact version of Magento 2.3? is it 2.3.4? after that, we'll proceed with our internal tests.
Thanks in advance!
@jochhop Magento ver. 2.3.1
I didn't test this with a blank install; our products, attribute sets, etc. are customised, but everything is working fine when the PB component renders in a block/page via. standard page load.
@alecarg Hi, could you please confirm, if your 500 error code logs a similar error to the below one:
Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Catalog\Block\Product\ImageFactory::getLabel() must be of the type string, null given, called in vendor/magento/module-catalog/Block/Product/ImageFactory.php on line 169
The only error I saw was this one, which happened because I had a custom theme and I missed etc/view.xml
file similar to this one: https://magento.stackexchange.com/a/287491
After adding it, the API endpoint worked correctly (it returned the HTML correctly parsed)
If it's not related in your case, could you please post here the error log reported in your Magento instance so we can continue with further checking?
Thanks in advance