Copied to clipboard

Flag this post as spam?

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


  • George 28 posts 71 karma points
    May 03, 2011 @ 05:35
    George
    0

    Errors in Content tab after changing document type default templates

    Hi all.

    I have an Umbraco install with a whole lot of document types. A little while ago I realised that I would need to display half of my documents differently to the other half, so I added a new template and went through half of my document types changing their allowed templates and their default templates.

    i.e. I took a lot of document types and changed their allowed template and default template from "template A" to "template B".

    Now when I go to the content tab, I get an error on viewing any document with a document type that's set to use the new template as its default.

    The stack trace is:

    [NullReferenceException: Object reference not set to an instance of an object.]
       umbraco.controls.ContentControl.addControlNew(Property p, TabPage tp, String Caption) +93
       umbraco.controls.ContentControl.CreateChildControls() +769
       System.Web.UI.Control.EnsureChildControls() +181
       umbraco.controls.ContentControl.OnInit(EventArgs e) +122
       System.Web.UI.Control.InitRecursive(Control namingContainer) +132
       System.Web.UI.Control.AddedControl(Control control, Int32 index) +276
       umbraco.cms.presentation.editContent.OnInit(EventArgs e) +1004
       System.Web.UI.Control.InitRecursive(Control namingContainer) +132
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1953

    I tried running some SQL to fix things up, but it didn't work (I still got the error).

    UPDATE dbo.cmsDocument
    SET templateId = 1180
    WHERE nodeId IN (
                        SELECT document.nodeId
                            FROM dbo.cmsDocument AS document
                            JOIN dbo.cmsContent AS content
                            ON document.nodeId = content.nodeId
                        WHERE
                            content.contentType IN (1315, 1313)
                    )
        AND newest = 1;

    My Umbraco version string is "umbraco v 4.6.1 (Assembly version: 1.0.4029.25836)".

    Is there an easy way to fix this, or do I just have to go through and change all of the documents back to their old template by hand?

  • George 28 posts 71 karma points
    May 03, 2011 @ 05:40
    George
    0

    OK, I tried changing the allowed template and default template for one of my document types back to what it was previously (i.e. back from template B to template A) and I'm still getting the error.

    This is not good. I'm really hoping I wont have to go and re-add all of these documents by hand. :(

  • George 28 posts 71 karma points
    May 03, 2011 @ 05:48
    George
    0

    Arg, just noticed that I'm getting this error on completely unrelated documents, even new ones that I create from scratch.

  • George 28 posts 71 karma points
    May 03, 2011 @ 06:34
    George
    0

    OK, this turned out to be seemingly unrelated to the changes I made with templates. I asked a work colleague for help and we ended up renaming the "content" tab on a base document type to "global". This fixed the crashes that were occuring on every document type that inherited from this base document type.

Please Sign in or register to post replies

Write your reply to:

Draft