3

Whats wrong in the xml declaration below:

m_index_index.xml

<?xml version="1.0"?>
<page layout ="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
   <referenceContainer name="content">
        <block class="Magento\Catalog\Block\Product\ListProduct" name="product_list" template="Magento_Catalog::product/list.phtml">
            <block class="Magento\Framework\View\Element\RendererList" name="category.product.type.details.renderers" as="details.renderers">
                <block class="Magento\Framework\View\Element\Template" as="default"/>
            </block>
            <block class="Magento\Catalog\Block\Product\ProductList\Toolbar" before="-" name="product_list_toolbar" template="Vendor_Catalog::product/list/toolbar.phtml">
                <block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/>
             </block>
             <action method="setToolbarBlockName">
                 <argument name="name" xsi:type="string">product_list_toolbar</argument>
             </action>
        </block>
    </referenceContainer>
</body>
</page>

I get:

Cache file with merged layout: LAYOUT_frontend_STORE1_2d41d8cd98f00b204e9800998ecf8427e and handles : Please correct the XML data and try again. [] []

Cache file with merged layout: LAYOUT_frontend_STORE1_20834ceea6c85aca7db01929fe5d8ddb0 and handles default, m_index_index: Please correct the XML data and try again. [] []

Cache file with merged layout: LAYOUT_frontend_STORE1_2a7ccd8094436548b564a588f6303121c and handles 2columns-left: Please correct the XML data and try again. [] []

I tried to give the layout as 3column.

Changed the file to default.xml

For "STORE1_2d41d8cd98f00b204e9800998ecf8427e and handles :" sometimes, doesnt specify which XML, need suggestions to debug this issue

But none helped.

  • 2
    I'm not aware of any way to make those error messages more explicit. Maybe you could post the full content of your layout file so we can help you debug the issue – Raphael at Digital Pianism Oct 12 '16 at 11:06
  • Have updated the layout file – Sushivam Oct 12 '16 at 11:11
  • Could you try to remove the space from layout ="2columns-left" ? So it becomes layout="2columns-left" – Raphael at Digital Pianism Oct 12 '16 at 11:12
  • Check If you have any space in top of the XML File before "<?xml version="1.0"?>" – Rajkumar .E Oct 12 '16 at 11:16
  • Spaces on the top, and layout="2columns-left" corrected, cleared cache, ran static-content:deploy, i get the same errors again !! – Sushivam Oct 12 '16 at 11:20
1

I've encountered this issue before, and Magento doesn't provide much information on what's actually going wrong. As I recall, the name of my layout file didn't match the controller I was looking to use it on, so be sure to check that. If you have a layout file of m_index_index.xml, Magento will attempt to resolve that to a route of {{base_url}}/m/, and a controller of YourModule\Controller\Index\Index.

0

The cache file is usually under /var/mage--x/mage--- (when using file based caching, otherwise in your cache storage) Be aware, that the cache file is written in CAPITAL letters, not in mixed case as in the log file, so a simple find would not find it.

0

Set a breakpoint in the exceptions in

\Magento\Framework\View\Model\Layout\Update\Validator::isValid

    } catch (\Magento\Framework\Config\Dom\ValidationException $e) {
        $this->_error(self::XML_INVALID, $e->getMessage());
        return false;
    } catch (\Exception $e) {
        $this->_error(self::XML_INVALID);
        return false;
    }
    return true;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.