Copied to clipboard

Flag this post as spam?

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


  • Søren Tidmand 129 posts 366 karma points
    Oct 03, 2015 @ 11:53
    Søren Tidmand
    0

    Different output from Nested Content property on local and server

    Hi.

    I've setup a Multiple Media Picker in a Nested Content datatype and using it in a Vorto property. Everything is working fine locally, but on the server and on another local machine the output is not the same.

    if (product.HasVortoValue("productImages"))
    {
         var im = product.GetVortoValue<dynamic>("productImages", "en-GB");
         var imSource = im[0]["images"].Value;
    }
    

    Here is the output on my local machine running VS2013:

    im
    {[
      {
        "name": "",
        "ncContentTypeAlias": "CompMultipleImages",
        "images": "1332,1333,1334,1335"
      }
    ]}
        base: {[
      {
        "name": "",
        "ncContentTypeAlias": "CompMultipleImages",
        "images": "1332,1333,1334,1335"
      }
    ]}
        IsReadOnly: false
        Type: Array
    

    And here is the output on a server running IIS - and on another local machine also running VS2013:

    im
    {Our.Umbraco.NestedContent.Models.DetachedPublishedContent}
      base: Content Id: 0, Name: ""
      Children: {Umbraco.Core.Models.IPublishedContent[0]}
      ContentType: {Umbraco.Core.Models.PublishedContent.PublishedContentType}
      CreateDate: {0001-01-01 00:00:00}
      CreatorId: 0
      CreatorName: null
      DocumentTypeAlias: "CompMultipleImages"
      DocumentTypeId: 1796
      Id: 0
      IsDraft: false
      ItemType: Content
      Level: 0
      Name: ""
      Parent: null
      Path: null
      Properties: {Umbraco.Core.Models.IPublishedProperty[1]}
      SortOrder: 0
      TemplateId: 0
      UpdateDate: {0001-01-01 00:00:00}
      UrlName: null
      Version: {00000000-0000-0000-0000-000000000000}
      WriterId: 0
      WriterName: null
    

    All the above are connected to the same SQL database. The Nested Content package has been added via the local Umbraco.

    Any help is appreciated.

    /Søren

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Oct 06, 2015 @ 21:19
    Lee Kelleher
    1

    Hi Søren,

    This might be more of a question for Matt, (since I don't know that much about Vorto).

    From what I can tell about the returning values, the one that returns the DetachedPublishedContent would be the correct one.

    The first value looks like a raw JSON object is returned, which would suggest that Nested Content's PropertyValueConverter isn't being called.

    I'm wondering if there are any errors in the /App_Data/Logs/UmbracoTraceLog.txt?

    Cheers,
    - Lee

  • Søren Tidmand 129 posts 366 karma points
    Oct 07, 2015 @ 08:19
    Søren Tidmand
    0

    Hi Lee,

    Thanks for your reply. Actually Alex Skripnik helped me out and discovered that the issue was solved when Vorto was installed via Nuget. Apparently the dll is different although that sounds weird. And even weirder considering the fact that Vorto was already working perfectly on the local installation when installed directly via the Umbraco backend.

    Now everything is running as expected with Vorto handling Nested Content datatypes with the (Single) Media Picker as well as the Multiple Media Picker.

    /Søren

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Oct 07, 2015 @ 09:05
    Lee Kelleher
    0

    Weird about the NuGet thing, not sure about that part. Anyway, cool, glad that you've got it sorted.

    Cheers,
    - Lee

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Oct 07, 2015 @ 09:38
    Alex Skrypnyk
    100

    Hi Lee,

    It's very strange, but I checked 2 times, when we are using dll from nuget it works. and we have a problem when we are using dll from Umbraco package. The size of dlls is the same, I don't how it can be.

    Thanks,

    Alex

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Oct 23, 2015 @ 16:33
    Jesper Ordrup
    3

    Hola all,

    Problem was that we used dynamic. Nested content is IPublishedContent. The below code works:

     var im = category.GetVortoValue<IPublishedContent>("categoryImage", "en-GB"); 
     var imSource = im.GetPropertyValue<int>("image");
    

    Thanks Lee for pointing out what was the correct one :)

    Jesper

Please Sign in or register to post replies

Write your reply to:

Draft