Error creating second menu

Topics: Troubleshooting
Mar 14, 2012 at 5:10 PM
Edited Mar 14, 2012 at 5:27 PM

Hi Piotr,

I fixed the below reported problem I think. I found that there was a menu name missing in this table:

Szmyd_Orchard_Modules_Menu_AdvancedMenuPartRecord

Apparently the form to create a menu allowed me to leave it out, which broke the dashboard and prevented the main menu from displaying.

Regards,

Matt Renfroe

 

Original error report:

I have been using Advanced Menu with great success until I tried to create a second menu for some subnav today. Got this error below and now there is no admin dashboard and no visible menu. What did I do wrong and how do I fix it?

Thanks!

 

Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

<%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.


Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Szmyd.Orchard.Modules.Menu.Services.MenuService.GetMenuItems(String menuName) +75
   Szmyd.Orchard.Modules.Menu.Providers.NavigationProviderFactory.<get_Providers>b__1(AdvancedMenuPart m) +169
   System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +237
   Szmyd.Orchard.Modules.Menu.Providers.<get_Providers>d__2.MoveNext() +578
   Orchard.UI.Navigation.<GetSources>d__c.MoveNext() in c:\Users\sebros\My Projects\Orchard\src\Orchard\UI\Navigation\NavigationManager.cs:90
   System.Linq.<SelectManyIterator>d__14`2.MoveNext() +577
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +487
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +103
   Orchard.UI.Navigation.NavigationManager.Merge(IEnumerable`1 sources) in c:\Users\sebros\My Projects\Orchard\src\Orchard\UI\Navigation\NavigationManager.cs:131
   Orchard.UI.Navigation.NavigationManager.BuildMenu(String menuName) in c:\Users\sebros\My Projects\Orchard\src\Orchard\UI\Navigation\NavigationManager.cs:29
   Szmyd.Orchard.Modules.Menu.Filters.MenuFilter.OnResultExecuting(ResultExecutingContext filterContext) +137
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +69
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +263
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +691
   System.Web.Mvc.Controller.ExecuteCore() +162
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +305
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +62
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +20
   Orchard.Mvc.Routes.HttpAsyncHandler.EndProcessRequest(IAsyncResult result) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Mvc\Routes\ShellRoute.cs:147
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +469
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375


 

 

 


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

Coordinator
Mar 14, 2012 at 5:16 PM

This is a known issue which have been fixed in version 1.4. 1.4.1 is currently the recommended one, although it only works with Orchard >= 1.4 (due to some breaking changes in Orchard core).

Which version do you use? If you're still on Orchard 1.3 I can provide you a quick fix after I get back home, otherwise please grab the latest source as a zip file and copy them to /Modules/Szmyd.Orchard.Modules.Menu subfolder (replacing the old ones).

Mar 14, 2012 at 6:13 PM

I'm on Orchard 1.4 with this project, so I think I can manage the AM 1.4.1 update.

Thanks for being so responsive!

Matt