Raw HTML in body text after importing content using transmorgrifier

556 views Asked by At

I'm using a transmorgrifier recipe to import some data from drupal into a Plone 4.1 based buildout. The buildout is based on https://github.com/claytron/drupal-plone-transmogrifier, (mostly I updated it to use plone 4.1 instead of 4.0). The import works, I successfully imported data from a drupal site into my plone site. The only issue is that the html tags from the imported html show as the literal tags.

If, after the successful import, I manually go to each item and select 'edit' then click 'save' then the html is interpreted properly, but that would be a lot of editing and saving in order to fix my problem.

see screenshot of freshly imported content with html tags showing. html tags showing

The blueprint doing the actual import of the field is (I believe) the one shown below:

 [text_mimetype]
 blueprint = collective.transmogrifier.sections.inserter
 key = string:_text_mimetype
 value = string:text/html

I experimented with using text/structured instead of text/html in the blueprint but that gave the same result:

What I need is either an additional blueprint that causes the html to be interpreted or a hints on how to ensure that my html gets interpreted at import.

The full list of blueprints used in my pipeline are shown here: https://github.com/claytron/drupal-plone-transmogrifier/blob/master/src/my.migration/my/migration/config/base.cfg

3

There are 3 answers

1
Ross Patterson On BEST ANSWER

If it works under Plone 4.0 but not under Plone 4.1, then I'm guessing it has to do with the "factor custom output transformations out of the editors" PLIP that was merged as a part of the Plone 4.1. I would look into the changes from that PLIP and see how the pipeline needs to be adjusted.

1
Guy Heckman On

Ran into the same problem when migrating content using wsapi4plone.core.

Solution: Pin zope.contenttype to version 3.5.5 (the default in the upcoming 4.1.1)

Cause: PLIP #9938 - http://dev.plone.org/plone/ticket/9938 as per esteele.

0
Giacomo Spettoli On

Actually that section only insert a value "text/html" in the key "_text_mimetype"

The real encapsulation is done here:

[mimetype_encapsulator]
data-key = text
mimetype = python:item.get('_%s_mimetype' % key)
# replace the data in-place
field = key
condition = mimetype

more info: http://pypi.python.org/pypi/plone.app.transmogrifier#mime-encapsulator-section

Anyway i've experimented that it's not strictly mandatory to encapsulate the html text, it works also with a simple string.

Bye, Giacomo