Element 'handle': Character content other than white space is not allowed because the content type is 'element-only

magento.stackexchange https://magento.stackexchange.com/questions/306468

  •  12-04-2021
  •  | 
  •  

Question

Migration from Magento1 to Magento2 was done using the data migration tool successfully.

However, certain product pages end up throwing the exception as seen on the attached screenshot.

To isolate the issue, I did even disable the custom module created for data migration. enter image description here

Was it helpful?

Solution

The answer posted by @CodeForGood is correct but incomplete.

I got this error in the category pages too.

No matter where you get it, the root of the issue is the same.

This happen because Data Migration Tool migrates the NULL values as string, instead of NULL itselfs.

For example, in the screenshot below there are 2 rows. Note the column custom_layout_update_file.

The first row was created by Data Migration Tool (INCORRECT). The second row is a new category created by me manually from the Magento 2 dashboard (CORRECT).

To fix this massively, run the following SQL query:

UPDATE INSERT_TABLE_NAME_HERE SET value = NULL WHERE attribute_id = INSERT_ATTRIBUTE_ID_HERE

In my case, the problem was being generated by the category attribute custom_layout_update_file. Its attribute_id is 530 and the column is located at catalog_category_entity_text. So, my final query was:

UPDATE catalog_category_entity_text SET value = NULL WHERE attribute_id = '530'

Then, reindex and clear cache:

bin/magento i:rei && bin/magento c:c && bin/magento c:f

Your product/category pages should be working properly now :)

enter image description here

OTHER TIPS

May be help you this...

This issue is XML file issue.

Your any custom module you missed White space.

This problem you got because the XML code, you copy directly on internet/webpage, there is some hidden character before start each line. This isn't space/ newline character. So, when push to Magento, Magento doesn't know this character, and it shows errors as your message. Solutions: clear all space between tag and order again.

And refer this link :-

Magento 2 : How to solve the message "Character content other than whitespace"?

The issue with the product page displaying the error above got clear when the cause was found to be something around attribute set migrated from Magento 1.9.2.2. I had to move custom_layout_update_file from from unassigned attributes on the right to the right group on the left. I attached the screenshots for your reference.

Once this is done, one can now view an option 'Custom Layout Update' under Migration_Design tab that you see on editing a product from the admin.

The value to choose from the Custom Layout Update drop down for the product that displays XML errors is 'No Update' and save it. enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top