Copied to clipboard

Flag this post as spam?

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


  • Paul Yates 32 posts 86 karma points
    Mar 03, 2011 @ 18:20
    Paul Yates
    0

    Deleting/renaming macro in Macro Container

    Couldn't find this mentioned anywhere else so thought i better report this here

    When deleting a macro (or renaming its alias in fact), that is enabled in a Macro Container render control, this causes *all* Content pages (not just the ones that use the macro container) to fail with the following error:

    [NullReferenceException: Object reference not set to an instance of an object.]
    
       umbraco.editorControls.macrocontainer.MacroEditor.OnInit(EventArgs e) +693
       System.Web.UI.Control.InitRecursive(Control namingContainer) +142
       System.Web.UI.Control.AddedControl(Control control, Int32 index) +270
       umbraco.editorControls.macrocontainer.Editor.OnInit(EventArgs e) +3241
       System.Web.UI.Control.InitRecursive(Control namingContainer) +142
       System.Web.UI.Control.InitRecursive(Control namingContainer) +390
       System.Web.UI.Control.InitRecursive(Control namingContainer) +390
       System.Web.UI.Control.InitRecursive(Control namingContainer) +390
       System.Web.UI.Control.InitRecursive(Control namingContainer) +390
       System.Web.UI.Control.AddedControl(Control control, Int32 index) +270
       umbraco.controls.ContentControl.addControlNew(Property p, TabPage tp, String Caption) +8984
       umbraco.controls.ContentControl.CreateChildControls() +1415
       System.Web.UI.Control.EnsureChildControls() +145
       umbraco.controls.ContentControl.OnInit(EventArgs e) +152
       System.Web.UI.Control.InitRecursive(Control namingContainer) +142
       System.Web.UI.Control.AddedControl(Control control, Int32 index) +270
       umbraco.cms.presentation.editContent.OnInit(EventArgs e) +2174
       System.Web.UI.Control.InitRecursive(Control namingContainer) +142
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1476

    Not that published content pages are not affected.

    The workaround is fairly obvious - just take the macro out of the allowed macros in the picker before deleting or whatever - and remember not to do it again ;)  Still probably worth looking at though.

    I'm using umbraco v 4.5.2 (Assembly version: 1.0.3891.20719) .Net Version:2.0.50727.5420; Asp.Net Version:2.0.50727.5420

    Windows Server 2008R2 SP1 IIS 7

    Cheers

    Paul

  • Paul Yates 32 posts 86 karma points
    Mar 03, 2011 @ 18:24
    Paul Yates
    0

    Line below the code should read:

    Note that published content pages are not affected.

    I did try to edit my post but the bug forum appears to have a bug in it!  I get

    Error parsing XSLT file: \xslt\forum-commentsList.xslt

    Got to laugh at that one :)

Please Sign in or register to post replies

Write your reply to:

Draft