Migrate Contrib.HtmlField data to Orchard 1.4

Topics: Installing Orchard
Mar 9, 2012 at 3:07 AM

Hi there,

I'm trying out an upgrade from 1.3.0 to 1.4 and I'm running the Migrate to 1.4 module, which is updating the routes & standard fields correctly, but wont migrate any values from Contrib.HtmlFields. Is there a way to migrate this data to the new improved fields?

Thanks in advance

Coordinator
Mar 9, 2012 at 4:02 AM

No, sorry, unless you write your own, but you can continue to use that field.

Mar 9, 2012 at 4:39 AM

I worked out if you delete the Contrib.HtmlField from the content type, and then add a new field with the exact same name & flavor=html, it automatically brings the data into the new field, yay!

Coordinator
Mar 9, 2012 at 4:49 AM

Nice find!

Mar 20, 2012 at 5:45 PM
Edited Mar 20, 2012 at 5:48 PM

Sorry, I'm confused. The new field types do not have an equivalent of the Html field provided by Contrib, do they? Correct me if I'm wrong, but in the above post "flavor=html" refers to the body part, does it not? I was using Contrib.HtmlFields to specify other html sections in addition to the body part.

Is there an Orchard 1.4 way to do this, or should I just stick all my markup in the body part (besides writing my own or refactoring the Contrib module I mean)?

I should mention that I was about halfway finished implementing an Orchard 1.3 site, and decided to rebuild on 1.4 instead of migrating. Does your first post mean that if I install that module and run the upgrade module that Contrib.HtmlFields will work?

Developer
Mar 20, 2012 at 9:55 PM

The thing to understand here is that the TextField from the core module has been enhanced with a flavor setting. So, you won;t find any HtmlField in the Orchard.Fields module. Instead, it's part of one of the core modules of Orchard. Simply attach a TextField to any of your parts, and set its flavor to html.

Mar 28, 2012 at 1:08 AM

I see! Thanks sfmskywalker, that clears things up.