Copied to clipboard

Flag this post as spam?

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


  • Kenn Jacobsen 133 posts 791 karma points MVP 4x c-trib
    Aug 26, 2014 @ 12:15
    Kenn Jacobsen
    0

    MNTP reports wrong ClrType via PublishedPropertyType

    Package version 2.0.5, Umbraco version 7.1.4

    I've created a document type "Test" with only one property "multinodetreepicker", which is (obviously) a multi node tree picker, configured to select content with no further filters or limitations.

    The following code returns the PublishedPropertyType of the property:

    var itemType = PublishedContentType.Get(PublishedItemType.Content, "Test");
    var propertyType = itemType.GetPropertyType("multinodetreepicker");
    

    Only... the ClrType property of the PublishedPropertyType is reported as being IPublishedContent - I would have thought it'd be IEnumerable<IPublishedContent>?

    enter image description here

    This messes with the ModelsBuilder package, because it translates the document type property to an IPublishedContent property instead of IEnumerable<IPublishedContent>. Can anything be done to fix this?

    -Kenn

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Aug 26, 2014 @ 12:22
    Jeavon Leopold
    100

    Hi Kenn,

    You need the value converters v2.1.0 to use with IPublishedContentModelFactory and Model Builder or Ditto. This does require Umbraco v7.1.5 (or v7.1.6).

    Jeavon

  • Kenn Jacobsen 133 posts 791 karma points MVP 4x c-trib
    Aug 26, 2014 @ 12:50
    Kenn Jacobsen
    0

    Excellent! It works in 2.1.0 :) thank you.

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Aug 26, 2014 @ 12:56
    Jeavon Leopold
    0

    You're welcome, also when your using strongly typed models you should set the web.config mode appsetting for a mini performance boost (of course you can't then use CurrentPage). Details at the bottom of this page

Please Sign in or register to post replies

Write your reply to:

Draft