Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mark Bowser 273 posts 860 karma points c-trib
    Aug 23, 2018 @ 00:20
    Mark Bowser
    0

    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?

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Aug 23, 2018 @ 04:56
    Dave Woestenborghs
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft