Close

NopCommerce 3.3 Bug - Plugins Menu Tree in Admin Mode

alextretij
10 years ago
#5694 Quote
Avatar
  • 4
in Menu7Spikes.cshtml
new code

    var adminMenuPlugins = EngineContext.Current.Resolve<Nop.Core.Plugins.IPluginFinder>()
        .GetPlugins<IAdminMenuPlugin>()
        .Where(x => x.Authenticate() && x.PluginDescriptor.SystemName.Contains("SevenSpikes"))
        .ToList();


old code

    var adminMenuPlugins = EngineContext.Current.Resolve<Nop.Core.Plugins.IPluginFinder>()
        .GetPlugins<IAdminMenuPlugin>()
        .Where(x => x.Authenticate())
        .ToList();


Error message
Object reference not set to an instance of an object. 


System.NullReferenceException: Object reference not set to an instance of an object. at ASP._Page_Plugins_SevenSpikes_Core_Views_Shared_Menu7Spikes_cshtml.Execute() in d:\Root\Nop3301\Plugins\SevenSpikes.Core\Views\Shared\Menu7Spikes.cshtml:line 57 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) at ASP._Page_Plugins_SevenSpikes_Core_Views_Shared__AdminLayout7Spikes_cshtml.Execute() in d:\Root\Nop3301\Plugins\SevenSpikes.Core\Views\Shared\_AdminLayout7Spikes.cshtml:line 11 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) at System.Web.WebPages.WebPageBase.PopContext() at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at 
alextretij
10 years ago
#5695 Quote
Avatar
  • 4
How to repeat this bug?

1. Create the new plugin, ex.  FoxNetSoft.Plugin.Misc.AAAA (not your plugin!!! and the name from letter A)
2. Enable IAdminMenuPlugin and add SiteMenu
3. Restart your site.
4. Open Nop JCarousel - Settings.




Deni
10 years ago
#5696 Quote
Avatar
  • Moderator
  • 389
alextretij wrote:
in Menu7Spikes.cshtml
new code

    var adminMenuPlugins = EngineContext.Current.Resolve<Nop.Core.Plugins.IPluginFinder>()
        .GetPlugins<IAdminMenuPlugin>()
        .Where(x => x.Authenticate() && x.PluginDescriptor.SystemName.Contains("SevenSpikes"))
        .ToList();


old code

    var adminMenuPlugins = EngineContext.Current.Resolve<Nop.Core.Plugins.IPluginFinder>()
        .GetPlugins<IAdminMenuPlugin>()
        .Where(x => x.Authenticate())
        .ToList();


Hello,

We have fixed the problem and will deploy it tomorrow at the latest.
Best Regards,
Mladen Staykov
Nop-Templates.com