Copied to clipboard

Flag this post as spam?

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


  • Kasper Hansen 3 posts 23 karma points
    Dec 14, 2011 @ 16:35
    Kasper Hansen
    0

    Critical error when chaning AllowedChildNodeTypes

    Hi everyone

    I need some help / workaround for this error.

    My setup :

    [DocumentType(Name = "Forside", Description = "Forside for hele sitet", AllowedChildNodeTypes = new Type[] { typeof(TextPageDocType), typeof(ContactDocType) })]
        public class FrontpageDocType : MasterDocType

    The error occurs when I try to add a new Type to AllowedChildNodeType: Like

    [DocumentType(Name = "Forside", Description = "Forside for hele sitet", AllowedChildNodeTypes = new Type[] { typeof(TextPageDocType), typeof(ContactDocType), typeof(FolderDocType) })]

    All my docTypes inherits from MasterDocType which from SiteBuilder.DocumentTypes

    Umbraco 4.7, SQLCe

    I get this error:

    [NullReferenceException: Object reference not set to an instance of an object.]
       Vega.USiteBuilder.DocumentTypeManager.SynchronizeAllowedChildContentType(Type typeDocType) +248
       Vega.USiteBuilder.DocumentTypeManager.SynchronizeAllowedChildContentTypes(Type baseTypeDocType) +125
       Vega.USiteBuilder.DocumentTypeManager.SynchronizeAllowedChildContentTypes(Type baseTypeDocType) +137
       Vega.USiteBuilder.DocumentTypeManager.Synchronize() +131
       Vega.USiteBuilder.UmbracoManager.SynchronizeDocumentTypes() +63
       Vega.USiteBuilder.UmbracoManager.Synchronize() +31
       Vega.USiteBuilder.UmbracoManager.SynchronizeIfNotSynchronized() +84
       Vega.USiteBuilder.USiteBuilderHttpModule.BeginRequest(Object sender, EventArgs e) +31
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

     

  • Vladan Ostojic 94 posts 210 karma points
    Dec 14, 2011 @ 16:48
    Vladan Ostojic
    0

    Hi Kasper, which version of uSiteBuider are you using? Are all your document types created in Umbraco? As you cannot access your umbraco backend, you may want to remove dll with your document types and then check if documents types are created. There is probably something wrong with your document type that you are trying to add to AllowedChildNodeTypes...

  • Kasper Hansen 3 posts 23 karma points
    Dec 14, 2011 @ 17:53
    Kasper Hansen
    0

    Hi Vladan

    Thanks fore the quick reply. I am using  SiteBiulder v. 1.2.

    After removing all SiteBuilder references, i finally got into the Umbraco backend, an saw that all the DocTypes has been created.

    My FolderDocType looks very simple, and i cannot image that there is somethim wrong with it - but i might be missing the big picture here :)

    [DocumentType(Name = "Mappe")]
        public class FolderDocType
        {
        }

    Are some of the other attributes necessary for this to work?

    /Kasper

  • Vladan Ostojic 94 posts 210 karma points
    Dec 14, 2011 @ 20:40
    Vladan Ostojic
    0

    FolderDocType should subclass DocumentTypeBase. All your document types at some point in the hierarchy should subclass from DocumentTypeBase. 

    [DocumentType(Name = "Mappe")]
        public class FolderDocType : DocumentTypeBase
        {
        }

     

    Can you verify if that's the case?

  • Kasper Hansen 3 posts 23 karma points
    Dec 15, 2011 @ 13:47
    Kasper Hansen
    0

    Fixed.. It was obvious when I looked at the posted code snippet.. I forgot I inherit from my MasterDocType. But thanks anyway for the pointers.

    [DocumentType(Name = "Mappe")]
        public class FolderDocType : MasterDocType
        {

                ...
        }

    Best regard

    Kasper

  • Vladan Ostojic 94 posts 210 karma points
    Dec 15, 2011 @ 14:11
    Vladan Ostojic
    0

    Ok, np :)

Please Sign in or register to post replies

Write your reply to:

Draft