RTE propertyvalueconverter not working on media nodes
I am working on an Umbraco 7.11.1 site with ModelsBuilder. I created a new Rich Text Editor DataType and added a new property called "caption" to the default image media type. I would expect that I could do one of the following things to get back the caption data:
var featuredImage = Model.FeaturedImage as Image;
var caption = featuredImage.Caption;
OR
var featuredImage = Model.FeaturedImage;
var caption = featuredImage.GetPropertyValue<IHtmlString>("caption")
but neither of the above work. I will always get back null or empty with no errors. However, this DOES work:
var featuredImage = Model.FeaturedImage;
var caption = featuredImage.GetPropertyValue<string>("caption")
I tried hitting breakpoints on the core Umbraco.Core.PropertyEditors.ValueConverters.TinyMceValueConverter, but it looks like that property value converter isn't being hit when the RTE is on a media node. I can hit breakpoints and confirm that this property value converter is being used when the same RTE datatype is on a content node. Just to find out if this was a problem where no property value converters work on media, I put a NestedContent on a media item and was able to get the data back from ModelsBuilder that uses the propertyvalueconverters.
Has anyone else run into this problem? It appears that for some reason, the TinyMceValuConverter doesn't work for media nodes. Any ideas?
RTE propertyvalueconverter not working on media nodes
I am working on an Umbraco 7.11.1 site with ModelsBuilder. I created a new
Rich Text Editor
DataType and added a new property called "caption" to the defaultimage
media type. I would expect that I could do one of the following things to get back the caption data:OR
but neither of the above work. I will always get back null or empty with no errors. However, this DOES work:
I tried hitting breakpoints on the core
Umbraco.Core.PropertyEditors.ValueConverters.TinyMceValueConverter
, but it looks like that property value converter isn't being hit when the RTE is on a media node. I can hit breakpoints and confirm that this property value converter is being used when the same RTE datatype is on a content node. Just to find out if this was a problem where no property value converters work on media, I put a NestedContent on a media item and was able to get the data back from ModelsBuilder that uses the propertyvalueconverters.Has anyone else run into this problem? It appears that for some reason, the TinyMceValuConverter doesn't work for media nodes. Any ideas?
Hi Mark.
Can you try to see if a content picker uses the it's property value converter on media items ?
If not this is probably by design. If it does it's maybe related to the one for the RTE.
But in both cases i would raise an issue on the issue tracker
is working on a reply...