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 :)