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> 
10
  • 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. Commented Jul 5, 2018 at 4:49
  • @Jack i'm using magento 2.2.5 version , how to find which file is not valid? Commented Jul 5, 2018 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 ? Commented Jul 5, 2018 at 6:32
  • @kunj i've located the source of the problem, check my updated question Commented Jul 5, 2018 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" >. Commented Jul 5, 2018 at 8:05

2 Answers 2

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.

1
  • see my updated question Commented Jul 5, 2018 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> 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.