AttributeError: 'unicode' object has no attribute 'output_relative_to' after import data via zopyx.plone.migration

I used a modified version of zopyx.plone.migration importer script to import data into a Plone 5 site. All of the items are shown in the navigation area as well as where they suppose to be. However, whenever, I view an item, e.g. a Document content type, I'm shown this error:

Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module Products.Five.browser.metaconfigure, line 485, in __call__
Module Products.Five.browser.pagetemplatefile, line 125, in __call__
Module Products.Five.browser.pagetemplatefile, line 59, in __call__
Module zope.pagetemplate.pagetemplate, line 132, in pt_render
Module five.pt.engine, line 98, in __call__
Module z3c.pt.pagetemplate, line 163, in render
Module chameleon.zpt.template, line 261, in render
Module chameleon.template, line 191, in render
Module chameleon.template, line 171, in render
Module 735283b3762dbda93b28a71231f6ede7.py, line 246, in render
Module 184c9c26225149712a5ad4b412eacb86.py, line 1223, in render_master
Module 184c9c26225149712a5ad4b412eacb86.py, line 420, in render_content
Module 735283b3762dbda93b28a71231f6ede7.py, line 234, in __fill_content_core
Module 735283b3762dbda93b28a71231f6ede7.py, line 137, in render_content_core

AttributeError: 'unicode' object has no attribute 'output_relative_to'

   - Expression: "python:context.text.output_relative_to(view.context)"
   - Filename:   ... egg/plone/app/contenttypes/browser/templates/newsitem.pt
   - Location:   (line 15: col 29)
   - Source:     ... ucture python:context.text.output_relative_to(view.context)"

Possibly is your "text" Attribute not an instance of RichTextValue . Look in the Docs to set the RichtTextValue correctly.
For Example:

from plone.app.textfield.value import RichTextValue
...

context.text = RichTextValue(u"Some input text", 'text/plain', 'text/html')
2 Likes