AI OnAI Off
Hi Zuf,
Actually, when you change property then content model is synchronized to database to update the change as well. And converting data from string to xhtml string is need to run.
You can rename propery name in case of changing property type to incompatitive type. It is simple way to solve this issue.
You can try using MigrationStep with RenameProperty function to migrate the content from string to XHtmlString.
thanks for your answers.
@Sujit, as far as i understand the MigrationStep only works for renaming and not for changing type?
Br.
Zuf
Create a new xhtmlstring property, then write code to update the XhtmlString-property from the string property, and finally remove the string property.
I try to change a page property type from string to XhtmlString.
I know this gives InitializationException for the CMS (in some cases e.g. Pages and not Blocks).
-----------------------------------------------------------------------------------------------------------
InvalidCastException: Unable to cast object of type 'System.String' to type 'EPiServer.Core.XhtmlString'
----------------------------------------------------------------------------------------------------------
Is there anyway to force cms to start up and ignore InvalidCastException?
We are on Optimizely 12
Br. Zuf