NullReferenceException while loading Widgets Admin

Topics: Installing Orchard
Sep 1, 2011 at 3:48 PM

Getting NullReferenceException when loading widgets admin page. I'm running Orchard v.1.2.41.0. 

[NullReferenceException: Object reference not set to an instance of an object.]
   Orchard.Widgets.Services.WidgetsService.GetZones(ExtensionDescriptor theme) +37
   Orchard.Widgets.Controllers.AdminController.Index(Nullable`1 layerId) +523
   lambda_method(Closure , ControllerBase , Object[] ) +86
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +208
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
   System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
   System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +191
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   Orchard.Mvc.Routes.HttpAsyncHandler.EndProcessRequest(IAsyncResult result) in d:\TeamCity\Projects\Orchard-Default\src\Orchard\Mvc\Routes\ShellRoute.cs:148
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8963149
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

Orchard v.1.2.41.0
Coordinator
Sep 1, 2011 at 6:09 PM

What does the theme.txt file look like in your currently active theme?

Sep 1, 2011 at 6:31 PM

from ..\orchard\Themes\TheAdmin\

Name: The AdminVersion: 1.2.41Author: Jon WallTags: hidden, adminDescription: An admin theme not to be used for the site so don't click "Activate" (or "Uninstall"). In the near future admin themes won't be mixed in with site themes.Website: http://www.orchardproject.netZones: Header, Messages, BeforeContent, LocalNavigation, Content, AfterContent, Footer

 

from ..\orchard\Themes\TheThemeMachine

Name: The Theme MachineAuthor: jowall, mibach, loudej, heskewDescription: Orchard Theme Machine is a flexible multi-zone theme that provides a solid foundation to build your site. It features 20 collapsible widget zones and is flexible enough to cover a wide range of layouts.Version: 1.2.41Tags: AwesomeWebsite: http://orchardproject.netZones: Header, Navigation, Featured, BeforeMain, AsideFirst, Messages, BeforeContent, Content, AfterContent, AsideSecond, AfterMain, TripelFirst, TripelSecond, TripelThird, FooterQuadFirst, FooterQuadSecond, FooterQuadThird, FooterQuadFourth, Footer

Coordinator
Sep 1, 2011 at 7:00 PM

Is this a fresh install, with nothing added?

Sep 1, 2011 at 8:03 PM

Yes, its fresh install. I added few modules from gallery after i downloaded. 

Coordinator
Sep 1, 2011 at 8:08 PM

What modules? (this works perfectly fine with a clean fresh install) Try to disable those modules and bring them back one by one to see if it makes a difference.

Mar 7, 2013 at 4:25 AM
I've experienced the same error and find out this post.

For my problem it was because the default Theme "TheThemeMachine" is not set to current.

I think it might be good to improve the error message when user trying to applied layer rules to empty theme at Wiget panel.
Coordinator
Mar 7, 2013 at 8:19 PM
What's an empty theme?
Mar 8, 2013 at 2:48 AM
Sorry I mean "No current theme specified"
Coordinator
Mar 8, 2013 at 3:52 AM
Edited Mar 8, 2013 at 3:53 AM
I see. Please file a bug.