Get a more debugable error message when DOM validation fails in Magento.
Original Error Message
1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'arguments': This element is not expected.
Line: 1471
Error Message With Patch
1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'arguments': This element is not expected.
Line: 1471
The xml was:
1466: <argument name="show_category" xsi:type="boolean">true</argument>
1467: </arguments>
1468: </block>
1469: <referenceBlock name="product_view_detail" remove="true"/>
1470: <block name="abc.gtm.product_view_detail" class="ABC\GoogleTagManager\Block\Detail" template="ABC_GoogleTagManager::detailproduct.phtml"/>
1471: <arguments>
1472: <argument name="show_category" xsi:type="boolean">true</argument>
1473: </arguments>
1474: </referenceContainer>
1475:</body>
This patch is NOT intended for production use, it is intended to help debug an issue, after the issue has been resolved it should be removed.
wget https://gist.githubusercontent.com/adamzero1/2c25dbcf1caec0ad9b55e7f6fd7972d8/raw/b19f6779625aa29122c0bc500ae213ab0b6bb212/nice_dom_error_message.patch
patch -p0 < nice_dom_error_message.patch
patch -p0 -R < nice_dom_error_message.patch
rm nice_dom_error_message.patch