Copied to clipboard

Flag this post as spam?

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


  • Mohammad Adnan 7 posts 78 karma points
    Feb 12, 2016 @ 13:48
    Mohammad Adnan
    0

    Umbraco 7.4 - Error loading Partial View script (file: ~/Views/MacroPartials/pageheader.cshtml)

    Hi guys,

    First post here.

    I've just upgraded to 7.4 from 7.3.7 and all my macro partials have partially stopped working.

    They work in the front-end but in the backoffice I get the error

    Error loading Partial View script (file: ~/Views/MacroPartials/pageheader.cshtml)

    I tried creating an empty Macro Partial and It still spits out the same error when I place it anywhere on the grid or the RTE.

    Here is the log from the Umbraco Trace.

     2016-02-13 00:41:42,132 [P22864/D14/T56] WARN  umbraco.macro - Error loading partial view macro (View: ~/Views/MacroPartials/pageheader.cshtml). Exception: System.NullReferenceException: Object reference not set to an instance of an object.
       at Umbraco.Web.Mvc.UmbracoViewPage`1.SetViewData(ViewDataDictionary viewData)
       at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
       at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
       at Umbraco.Web.Mvc.ControllerExtensions.RenderViewResultAsString(ControllerBase controller, ViewResultBase viewResult)
       at Umbraco.Web.Macros.PartialViewMacroEngine.Execute(MacroModel macro, IPublishedContent content)
       at umbraco.macro.LoadPartialViewMacro(MacroModel macro)
       at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)
     2016-02-13 00:41:42,134 [P22864/D14/T56] WARN  umbraco.macro - Error loading Partial View (file: ~/Views/MacroPartials/pageheader.cshtml). Exception: System.NullReferenceException: Object reference not set to an instance of an object.
       at Umbraco.Web.Mvc.UmbracoViewPage`1.SetViewData(ViewDataDictionary viewData)
       at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
       at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
       at Umbraco.Web.Mvc.ControllerExtensions.RenderViewResultAsString(ControllerBase controller, ViewResultBase viewResult)
       at Umbraco.Web.Macros.PartialViewMacroEngine.Execute(MacroModel macro, IPublishedContent content)
       at umbraco.macro.LoadPartialViewMacro(MacroModel macro)
       at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)
    

    Hope someone can help :)

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Feb 12, 2016 @ 13:52
    Sebastiaan Janssen
    0

    Someone else reported the same error message here: http://issues.umbraco.org/issue/U4-7950

    Can you verify, double, tripple check that you copied all new files over and that your web.config looks the same as the one you get in the UmbracoCms.7.4.0.zip file from https://our.umbraco.org/contribute/releases/740

  • Mohammad Adnan 7 posts 78 karma points
    Feb 12, 2016 @ 14:10
    Mohammad Adnan
    0

    Hi,

    I actually created a new MVC project and installed a fresh 7.4 via Nuget and then it just upgraded the database.

    I copied over the Macro Partials and the necessary templates.

    Everything else seems to be working just not the backoffice macro partials

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Feb 12, 2016 @ 14:22
    Sebastiaan Janssen
    0

    Would you be able to send me the site + database? A Dropbox or WeTransfer link can be sent to [email protected] - that way I can debug this as I'm unable to reproduce this issue myself.

  • Mohammad Adnan 7 posts 78 karma points
    Feb 12, 2016 @ 14:32
    Mohammad Adnan
    0

    Hi Sebestian,

    I just did a fresh install and installed Umbraco Via Nuget and created a document type with a grid layout and created a simple Macro and same issue on this version as well.

    Not sure - it might be something with the nuget version.

    I will send the demo app over.

    Cheers

  • Mohammad Adnan 7 posts 78 karma points
    Feb 12, 2016 @ 14:56
    Mohammad Adnan
    0

    Sent over.

    Only thing I didn't mention is that I'm using 4.6.1

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Feb 12, 2016 @ 15:49
    Sebastiaan Janssen
    0

    Thanks Mohammed, will have a look at it on Monday!

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Feb 14, 2016 @ 16:29
    Douglas Robar
    0

    This happens in a fresh 7.4.0 installation as well using the built-in Gallery macro snippet.

    1. Create a new 'Gallery' Macro Partial File, using the 'Gallery' snippet.
    2. Allow the Gallery macro to be used in the RTE and to render in the RTE.
    3. Add the 'mediaIds' parameter to the macro as a Multiple Media Picker.
    4. Upload a few images to the Media section.
    5. Insert the Gallery macro in an RTE on a content page.

    You'll get the error described in the OP, but it'll render properly without error when you view the website.

    cheers,
    doug.

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Feb 14, 2016 @ 17:24
    Sebastiaan Janssen
    0

    Yep, this happens with any macro in the RTE currently.

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Feb 15, 2016 @ 08:07
    Sebastiaan Janssen
    1

    An updated, a fixed dll is now available on that issue ( http://issues.umbraco.org/issue/U4-7950 ) which can be used until 7.4.1 is out.

  • Sean Ryan 1 post 71 karma points
    Feb 16, 2016 @ 17:43
    Sean Ryan
    0

    thanks for fixing this, it helped me a lot ...

  • Warren Harding 132 posts 275 karma points
    Feb 16, 2016 @ 23:09
    Warren Harding
    0

    This resolved issues for me to with any Macro enabled in RTE

  • Clamond Ng 7 posts 74 karma points
    Feb 17, 2016 @ 00:04
    Clamond Ng
    0

    Thanks guys, that solve it. I thought I didn't do the upgrade properly. (Upgrade form 7.4.0-Beta to 7.4.0, using NuGet).

Please Sign in or register to post replies

Write your reply to:

Draft