Migration issue: data-val="uid" required on img tags in Plone 5.2's TinyMCE editor to edit images?

I'm working on a migration project from Pone 4.3 to Plone 5.2 and trying to finishing/fix the "little details". One issue I noticed was that when I try to edit an image in the migrated Plone 5.2 site to edit for example the scale, the 'related items' widget to select the image is empty. This locks up the image modal: you can still change the scale or alignment, but without an actual image referenced in the widget you cannot save/close the image modal modal.

After some testing with the html in the document I found out that after migrating using collective.exportimport the data-val attribute containing the uid of the image is missing. And this is apparently the only correct html source for TinyMCE in Plone 5.2 to fetch/fill the selected item in the image modal related items widget. :open_mouth: Again the src attribute contains a valid resolveuid with the same UID().

Example of a 'correct' image tag: clear data-val and it breaks ediing existing image attributes:

<img src="../../../../resolveuid/2ddd788f6bad4699b13a94777650ab8f/@@images/image/large" alt="" class="image-richtext image-inline" data-linktype="image" data-scale="large" data-val="2ddd788f6bad4699b13a94777650ab8f" />

Is this known/intended behavior for others who have worked on migrations from Plone 4 -> Plone 5?

I have a work around (fingers crossed) because this particular site also has 'link using UID's disabled in Plone 4. So the images src attributes all contain relative paths. This feature switch used to be in the TinyMCE control panel, but has been removed somewhere in the Plone 5.0 journey.

My first task when I found out about the image editing issues was to fix the relative paths by reviving/refactoring pareto.uidfixer (AT/Plone 4 only) to run in Plone 5.2/Python3 on the migrated/imported DX content. This add'on normally only runs on Plone 4 Archetypes content.

The big advantage with porting this to run in the destination site is that I don't have to modify content in the Plone 4 site with pareto.uidfixer before exporting. I can still export existing content from the 'live' site. When substituting the relative path for the resolveuid ones in the destination site I can add the data-val attribute in the same step.

When it's stable enough and tested a bit more I'll add the resolveuid code to collective.migrationhelpers.

1 Like

The view @@fix_html in collective.exportimport fixes this. It deals with all kinds of links in richtext fields content on content and portlets.

1 Like