Copied to clipboard

Flag this post as spam?

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

  • Oriol 5 posts 77 karma points
    Mar 20, 2018 @ 11:32

    Empty Document Type gives error when creating new content


    I want to create a document type to be used as container of actual content but without any template or any other way to access it.

    Problem being that:

    1. I create a new document type allowing to be added at root (name it "Cabinet").
    2. I go to the Content editor and create a new Content from that type.

    There is the exception:

    Exception Details
     Mapping types:
     Content -> IEnumerable`1
     Umbraco.Core.Models.Content -> System.Collections.Generic.IEnumerable`1[[Umbraco.Web.Models.ContentEditing.Tab`1[[Umbraco.Web.Models.ContentEditing.ContentPropertyDisplay, umbraco, Version=1.0.6631.28270, Culture=neutral, PublicKeyToken=null]], umbraco, Version=1.0.6631.28270, Culture=neutral, PublicKeyToken=null]]
     Destination path:
     Source value:
     Inner Exception
     System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
      Parameter name: index

    It's clearly something about Automapper not being able to create the Model for this document type since its empty, I can easily create a Comments area or any other kind of empty entry just to have a tab and some field there, but I was wondering if there is a way to skip this document type of being mapped, some automapper configuration allowing empty docs or a solution for this workaround.

    Best Regards, Oriol

Please Sign in or register to post replies

Write your reply to: