2

I'm using magento version 2.2.5, after i enabled the developer mode, i always get an error while trying to edit one of my product or add new in back end:

1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'arguments': Character content other than whitespace is not allowed because the content type is 'element-only'. Line: 212

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'arguments': Character content other than whitespace is not allowed because the content type is 'element-only'. Line: 212

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'arguments': Character content other than whitespace is not allowed because the content type is 'element-only'. Line: 212

Element 'action': Character content other than whitespace is not allowed because the content type is 'element-only'. Line: 226

i've successfully located the cause of the problem, which is in the extension i used, but i seems cannot find the problem:

<?xml version="1.0"?>

 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <link src="Company_Module::js/ver2.0.x/script.js"/>
    </head>
    <body>
        <referenceBlock name="product_tabs">
            <block class="Magento\Backend\Block\Widget\Tab" name="credit.price.settings">
                <arguments>
                    <argument name="label" xsi:type="string" translate="true">Credit Prices Settings</argument>
                    <argument name="url" xsi:type="helper" helper="Company\Module\Helper\Url::getUrl">
                        <param name="_current">0</param>
                    </argument>
                    <argument name="class" xsi:type="string">ajax</argument>
                    <argument name="group_code" xsi:type="string">basic</argument>
                </arguments>
            </block>
            <action method="addTab">
                <argument name="name" xsi:type="string">credit-price-settings</argument>
                <argument name="block" xsi:type="string">credit.price.settings</argument>
            </action>
        </referenceBlock>
    </body>
</page>
  • Hi are you using any third party module and which magento version you are using ? This is not a bug, those attributes are not allowed when using referenceBlock and you should locate them in your code a remove them. – Jack Jul 5 '18 at 4:49
  • @Jack i'm using magento 2.2.5 version , how to find which file is not valid? – Tiny Dancer Jul 5 '18 at 5:13
  • Is there any XML file with only body tag or without it or blank, I mean nothing after body or page tag ? – kunj Jul 5 '18 at 6:32
  • @kunj i've located the source of the problem, check my updated question – Tiny Dancer Jul 5 '18 at 7:56
  • I found space in this line <argument name="url" xsi:type="helper" helper="Company\Module\Helper\Url::getUrl" > <param name="_current">0</param> </argument> may be space should not there in helper="Company\Module\Helper\Url::getUrl" >. – kunj Jul 5 '18 at 8:05
0

Check all your layout (.xml) files in your custom theme and modules.

Probably You have added any unsupported character in any of the tags.

Check the <body> tag of the layout file. It seems there is something wrong with the body tag.

  • see my updated question – Tiny Dancer Jul 5 '18 at 7:58
0

Just clean whitespaces.

<?xml version="1.0"?>
 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <link src="Company_Module::js/ver2.0.x/script.js"/>
    </head>
    <body>
        <referenceBlock name="product_tabs">
            <block class="Magento\Backend\Block\Widget\Tab" name="credit.price.settings">
                <arguments>
                    <argument name="label" xsi:type="string" translate="true">Credit Prices Settings</argument>
                    <argument name="url" xsi:type="helper" helper="Company\Module\Helper\Url::getUrl">
                        <param name="_current">0</param>
                    </argument>
                    <argument name="class" xsi:type="string">ajax</argument>
                    <argument name="group_code" xsi:type="string">basic</argument>
                </arguments>
            </block>
            <action method="addTab">
                <argument name="name" xsi:type="string">credit-price-settings</argument>
                <argument name="block" xsi:type="string">credit.price.settings</argument>
            </action>
        </referenceBlock>
    </body>
</page>

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.