NodeContent and view rendering

Vote:
 

I'm using ASP.NET MVC 5.1 and have some problems with the latest version of Commerce and routing for NodeContent (categories). VariationContent, ProductContent, BundleContent and PackageContent all work fine and the normal way, but for NodeContent I get a 404 (on page edit) and my controller isen't registered to render for that type, instead it tries to use the EPiServer.Shell.UI.Controllers.EPiDefaultShellModuleController controller.

I have a very basic setup:

public class TestNodeContentController : ContentController<TestNodeContent>
    {
        public ViewResult Index()
        {
            return View();
        }
    }

  

[CatalogContentType(GUID = "4A08DC98-FE1E-443E-BF0F-123993957118", MetaClassName = "Test_Node_Content")]
    public class TestNodeContent : NodeContent
    {
         
    }

 

Any ideas where I should look? Somewhere there must be a misconfiguration in my setup.

The URL it tries to use looks something like this: http://demo.commerce.localtest.me/cms/Commerce/Catalog#context=epi.cms.contentdata:///1073741831__CatalogContent.

 

Cheers

Frederik

   

#84791
Apr 07, 2014 16:16
Vote:
 

I didn't get the problem when I tested. Can you run the following code after initialization has been done (for example in one controller): ServiceLocation.ServiceLocator.Current.GetInstance<EPiServer.DataAbstraction.IContentTypeRepository>().Load("TestNodeContent ").SupportedTemplates

You will find the templates that has been registered during initialization in that property. It would be intresting to see if the TestNodeContentController is one of the supported templates.

#84831
Apr 08, 2014 10:01
Vote:
 

When I tested within my ProductController it showed that the right controller was registered to handle TestNodeContent (TestNodeContentController). It was also the only one registered for that type. Curious that I get a 404 when within the Catalog interface and then just for types that inherit from NodeContent.

Frederik

#84834
Apr 08, 2014 10:36
Vote:
 

I will try to reproduce it.

#84835
Apr 08, 2014 10:38
Vote:
 

One more thing to look up. The TemplateResolver has two events, TemplateResolving and TemplateResolved. If you listen to those events, and look what the template resolver resolves, it might give us a hint.

#84856
Apr 08, 2014 13:27
Vote:
 

When I check TemplateResolved, SelectedTemplate is actually TestNodeController. Very strange that it doesn't render that controller and view.

#84866
Apr 08, 2014 14:42
Vote:
 

Whats the assembly version of EPiServer.Shell.UI?

#84867
Apr 08, 2014 14:43
Vote:
 

7.6.4.0

#84869
Apr 08, 2014 14:44
Vote:
 

I now see that I use 7.7.0.0 of EPiServer.Shell.UI (did a update-package on the project). I can still not get the problem.

Have you registered any routes yourself (the default route for example), and if so, where has it been registered?

#84931
Apr 09, 2014 15:39
Vote:
 

I had the default route registered through the RegisterRoutes method in global.asax, but even when removing this method the behavior was the same.

#84953
Apr 10, 2014 10:08