outeredge / magento-structured-data-module

Magento Structured Data Module by outer/edge
MIT License
52 stars 14 forks source link

500 Server Error: DOMDocument::loadHTML(): Document is empty #45

Closed p24-max closed 1 year ago

p24-max commented 1 year ago

When accessing a PLP (product listing page), magento responds with 500 Server Error. Module is configured to only act on PDP (product detail page). PDP pages are rendered as expected and the ld+json is included in markup.

Configuration: image

Magento log:

[2023-04-03T07:51:47.316478+00:00] main.CRITICAL: Exception: Warning: DOMDocument::loadHTML(): Document is empty in Entity, line: 1 in /var/www/html/vendor/outeredge/magento-structured-data-module/Plugin/StripReviewSummary.php on line 16 in /var/www/html/vendor/magento/framework/App/ErrorHandler.php:61
Stack trace:
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'DOMDocument::lo...', '/var/www/html/v...', 16)
#1 /var/www/html/vendor/outeredge/magento-structured-data-module/Plugin/StripReviewSummary.php(16): DOMDocument->loadHTML(' ')
#2 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(146): OuterEdge\StructuredData\Plugin\StripReviewSummary->afterGetReviewsSummaryHtml(Object(Magento\Review\Block\Product\ReviewRenderer\Interceptor), ' ', Object(Magento\Catalog\Model\Product\Interceptor), 'short', false)
#3 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Review\Block\Product\ReviewRenderer\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Catalog\Model\Product\Interceptor), 'short', false)
#4 /var/www/html/generated/code/Magento/Review/Block/Product/ReviewRenderer/Interceptor.php(23): Magento\Review\Block\Product\ReviewRenderer\Interceptor->___callPlugins('getReviewsSumma...', Array, Array)
#5 /var/www/html/vendor/magento/module-catalog/Block/Product/AbstractProduct.php(221): Magento\Review\Block\Product\ReviewRenderer\Interceptor->getReviewsSummaryHtml(Object(Magento\Catalog\Model\Product\Interceptor), 'short', false)
#6 /var/www/html/var/view_preprocessed/pub/static/app/design/frontend/xxredactedxx/Theme/Magento_Catalog/templates/product/list.phtml(1): Magento\Catalog\Block\Product\AbstractProduct->getReviewsSummaryHtml(Object(Magento\Catalog\Model\Product\Interceptor), 'short')
#7 /var/www/html/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('/var/www/html/v...')
#8 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\ListProduct\Interceptor), '/var/www/html/v...', Array)
#9 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent('render', Array)
#10 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Catalog\Block\Product\ListProduct\Interceptor), '/var/www/html/v...', Array)
#11 /var/www/html/generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php(23): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins('render', Array, Array)
#12 /var/www/html/vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php\Interceptor->render(Object(Magento\Catalog\Block\Product\ListProduct\Interceptor), '/var/www/html/v...', Array)
#13 /var/www/html/vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView('/var/www/html/v...')
#14 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(1095): Magento\Framework\View\Element\Template->_toHtml()
#15 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(1099): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}()
#16 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(660): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#17 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Element\AbstractBlock->toHtml()
#18 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Catalog\Block\Product\ListProduct\Interceptor->___callParent('toHtml', Array)
#19 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Catalog\Block\Product\ListProduct\Interceptor->Magento\Framework\Interception\{closure}()
#20 /var/www/html/generated/code/Magento/Catalog/Block/Product/ListProduct/Interceptor.php(59): Magento\Catalog\Block\Product\ListProduct\Interceptor->___callPlugins('toHtml', Array, Array)
#21 /var/www/html/app/code/WeltPixel/GoogleTagManager/Block/Category.php(21): Magento\Catalog\Block\Product\ListProduct\Interceptor->toHtml()
#22 [internal function]: WeltPixel\GoogleTagManager\Block\Category->getProductCollection()
#23 /var/www/html/vendor/magento/framework/View/TemplateEngine/Php.php(94): call_user_func_array(Array, Array)
#24 /var/www/html/var/view_preprocessed/pub/static/app/code/WeltPixel/GoogleTagManager/view/frontend/templates/category.phtml(1): Magento\Framework\View\TemplateEngine\Php->__call('getProductColle...', Array)
#25 /var/www/html/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('/var/www/html/v...')
#26 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render(Object(WeltPixel\GoogleTagManager\Block\Category\Interceptor), '/var/www/html/v...', Array)
#27 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent('render', Array)
#28 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}(Object(WeltPixel\GoogleTagManager\Block\Category\Interceptor), '/var/www/html/v...', Array)
#29 /var/www/html/generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php(23): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins('render', Array, Array)
#30 /var/www/html/vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php\Interceptor->render(Object(WeltPixel\GoogleTagManager\Block\Category\Interceptor), '/var/www/html/v...', Array)
#31 /var/www/html/vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView('/var/www/html/v...')
#32 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(1095): Magento\Framework\View\Element\Template->_toHtml()
#33 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(1099): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}()
#34 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(660): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#35 /var/www/html/app/code/WeltPixel/GoogleTagManager/Helper/Data.php(418): Magento\Framework\View\Element\AbstractBlock->toHtml()
#36 /var/www/html/app/code/WeltPixel/GoogleTagManager/Helper/Data.php(350): WeltPixel\GoogleTagManager\Helper\Data->addCategoryPageInformation()
#37 /var/www/html/app/code/WeltPixel/GoogleTagManager/Observer/CoreLayoutRenderElementObserver.php(40): WeltPixel\GoogleTagManager\Helper\Data->getDataLayerScript()
#38 /var/www/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(88): WeltPixel\GoogleTagManager\Observer\CoreLayoutRenderElementObserver->execute(Object(Magento\Framework\Event\Observer))
#39 /var/www/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(74): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(WeltPixel\GoogleTagManager\Observer\CoreLayoutRenderElementObserver), Object(Magento\Framework\Event\Observer))
#40 /var/www/html/vendor/magento/framework/Event/Manager.php(66): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer))
#41 /var/www/html/generated/code/Magento/Framework/Event/Manager/Proxy.php(95): Magento\Framework\Event\Manager->dispatch('core_layout_ren...', Array)
#42 /var/www/html/vendor/magento/framework/View/Layout.php(518): Magento\Framework\Event\Manager\Proxy->dispatch('core_layout_ren...', Array)
#43 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(511): Magento\Framework\View\Layout->renderElement('weltpixel_gtm_h...', true)
#44 /var/www/html/var/view_preprocessed/pub/static/vendor/magento/module-theme/view/frontend/templates/html/container.phtml(1): Magento\Framework\View\Element\AbstractBlock->getChildHtml()
#45 /var/www/html/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('/var/www/html/v...')
#46 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Framework\View\Element\Template\Interceptor), '/var/www/html/v...', Array)
#47 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent('render', Array)
#48 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\View\Element\Template\Interceptor), '/var/www/html/v...', Array)
#49 /var/www/html/generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php(23): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins('render', Array, Array)
#50 /var/www/html/vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php\Interceptor->render(Object(Magento\Framework\View\Element\Template\Interceptor), '/var/www/html/v...', Array)
#51 /var/www/html/vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView('/var/www/html/v...')
#52 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(1095): Magento\Framework\View\Element\Template->_toHtml()
#53 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(1099): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}()
#54 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(660): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#55 /var/www/html/vendor/magento/framework/View/Result/Page.php(253): Magento\Framework\View\Element\AbstractBlock->toHtml()
#56 /var/www/html/vendor/magento/framework/View/Result/Layout.php(171): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#57 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#58 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array)
#59 /var/www/html/vendor/amasty/gdpr-cookie/Plugin/ProcessPageResult.php(64): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#60 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(135): Amasty\GdprCookie\Plugin\ProcessPageResult->aroundRenderResult(Object(Magento\Framework\View\Result\Page\Interceptor), Object(Closure), Object(Magento\Framework\App\Response\Http\Interceptor))
#61 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#62 /var/www/html/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(23): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, NULL)
#63 /var/www/html/vendor/magento/framework/App/Http.php(120): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#64 /var/www/html/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http->launch()
#65 /var/www/html/pub/index.php(105): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#66 {main} {"report_id":"02bd9a61a9a27c4e169c2213356e47f527a70c4e08ef1576702d2adfd3118db6"} []

Magento report:

Warning: DOMDocument::loadHTML(): Document is empty in Entity, line: 1 in /var/www/html/vendor/outeredge/magento-structured-data-module/Plugin/StripReviewSummary.php on line 16
1
#1 DOMDocument->loadHTML() called at [vendor/outeredge/magento-structured-data-module/Plugin/StripReviewSummary.php:16]
#2 OuterEdge\StructuredData\Plugin\StripReviewSummary->afterGetReviewsSummaryHtml() called at [vendor/magento/framework/Interception/Interceptor.php:146]
#3 Magento\Review\Block\Product\ReviewRenderer\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#4 Magento\Review\Block\Product\ReviewRenderer\Interceptor->___callPlugins() called at [generated/code/Magento/Review/Block/Product/ReviewRenderer/Interceptor.php:23]
#5 Magento\Review\Block\Product\ReviewRenderer\Interceptor->getReviewsSummaryHtml() called at [vendor/magento/module-catalog/Block/Product/AbstractProduct.php:221]
#6 Magento\Catalog\Block\Product\AbstractProduct->getReviewsSummaryHtml() called at [var/view_preprocessed/pub/static/app/design/frontend/xxredactedxx/Theme/Magento_Catalog/templates/product/list.phtml:1]
#7 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#8 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#9 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#10 Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#11 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php:23]
#12 Magento\Framework\View\TemplateEngine\Php\Interceptor->render() called at [vendor/magento/framework/View/Element/Template.php:263]
#13 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:293]
#14 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1095]
#15 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1099]
#16 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:660]
#17 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#18 Magento\Catalog\Block\Product\ListProduct\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#19 Magento\Catalog\Block\Product\ListProduct\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#20 Magento\Catalog\Block\Product\ListProduct\Interceptor->___callPlugins() called at [generated/code/Magento/Catalog/Block/Product/ListProduct/Interceptor.php:59]
#21 Magento\Catalog\Block\Product\ListProduct\Interceptor->toHtml() called at [app/code/WeltPixel/GoogleTagManager/Block/Category.php:21]
#22 WeltPixel\GoogleTagManager\Block\Category->getProductCollection()
#23 call_user_func_array() called at [vendor/magento/framework/View/TemplateEngine/Php.php:94]
#24 Magento\Framework\View\TemplateEngine\Php->__call() called at [var/view_preprocessed/pub/static/app/code/WeltPixel/GoogleTagManager/view/frontend/templates/category.phtml:1]
#25 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#26 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#27 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#28 Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#29 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php:23]
#30 Magento\Framework\View\TemplateEngine\Php\Interceptor->render() called at [vendor/magento/framework/View/Element/Template.php:263]
#31 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:293]
#32 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1095]
#33 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1099]
#34 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:660]
#35 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [app/code/WeltPixel/GoogleTagManager/Helper/Data.php:418]
#36 WeltPixel\GoogleTagManager\Helper\Data->addCategoryPageInformation() called at [app/code/WeltPixel/GoogleTagManager/Helper/Data.php:350]
#37 WeltPixel\GoogleTagManager\Helper\Data->getDataLayerScript() called at [app/code/WeltPixel/GoogleTagManager/Observer/CoreLayoutRenderElementObserver.php:40]
#38 WeltPixel\GoogleTagManager\Observer\CoreLayoutRenderElementObserver->execute() called at [vendor/magento/framework/Event/Invoker/InvokerDefault.php:88]
#39 Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod() called at [vendor/magento/framework/Event/Invoker/InvokerDefault.php:74]
#40 Magento\Framework\Event\Invoker\InvokerDefault->dispatch() called at [vendor/magento/framework/Event/Manager.php:66]
#41 Magento\Framework\Event\Manager->dispatch() called at [generated/code/Magento/Framework/Event/Manager/Proxy.php:95]
#42 Magento\Framework\Event\Manager\Proxy->dispatch() called at [vendor/magento/framework/View/Layout.php:518]
#43 Magento\Framework\View\Layout->renderElement() called at [vendor/magento/framework/View/Element/AbstractBlock.php:511]
#44 Magento\Framework\View\Element\AbstractBlock->getChildHtml() called at [var/view_preprocessed/pub/static/vendor/magento/module-theme/view/frontend/templates/html/container.phtml:1]
#45 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#46 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#47 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#48 Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#49 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php:23]
#50 Magento\Framework\View\TemplateEngine\Php\Interceptor->render() called at [vendor/magento/framework/View/Element/Template.php:263]
#51 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:293]
#52 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1095]
#53 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1099]
#54 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:660]
#55 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Result/Page.php:253]
#56 Magento\Framework\View\Result\Page->render() called at [vendor/magento/framework/View/Result/Layout.php:171]
#57 Magento\Framework\View\Result\Layout->renderResult() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#58 Magento\Framework\View\Result\Page\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#59 Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/amasty/gdpr-cookie/Plugin/ProcessPageResult.php:64]
#60 Amasty\GdprCookie\Plugin\ProcessPageResult->aroundRenderResult() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#61 Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#62 Magento\Framework\View\Result\Page\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/Result/Page/Interceptor.php:23]
#63 Magento\Framework\View\Result\Page\Interceptor->renderResult() called at [vendor/magento/framework/App/Http.php:120]
#64 Magento\Framework\App\Http->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]
#65 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:105]
p24-max commented 1 year ago

@vseager can you please check this? :)