A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
Hi,
Do you have any controller which inherits from PageController<SitePageData>?
It seems to me that your Index method matches both CategoryController and the other one.
The short answer is no, but what strikes me as odd is that you can go directly to any of the sub-categories and they load up just fine. It's ONLY throwing an error on top level categories and even then ONLY when the app pool is recycled. You can refresh the page right then and there and it loads up fine and the error never appears again. It's very strange.
Just following up with some more details here, it seems like for whatever reason, when a category at the top level of our site's page is loaded, and only for the first time after IIS or the app pool is restarted, its trying to pass CategoryContentType instead of SitePageData, anyone experience this or something similar before?
Thanks!
John
Do you have some custom routing in your code? How are you defining the route for above controller? I suspect currentPage will always be null, even after the first load.
/K
Hey All,
We're using EpiServer 9.8 and getting a strange error when loading our top-level category page. What's weird about it is if you refresh the page, it works just fine and the error cannot be reproduced again until you refresh the app pool in IIS. The error we're getting is:
"The routed data is of type 'CMS.Models.Commerce.Catalog.CategoryContentType' and the binding context data 'currentPage' is of type 'CMS.Models.Commerce.Catalog.CategoryContentType', neither of which matches the requested type 'CMS.Models.Pages.SitePageData'."
Stack trace:
[TypeMismatchException: The routed data is of type 'CMS.Models.Commerce.Catalog.CategoryContentType' and the binding context data 'currentPage' is of type 'CMS.Models.Commerce.Catalog.CategoryContentType', neither of which matches the requested type 'CMS.Models.Pages.SitePageData'.]
EPiServer.Web.Mvc.ContentDataModelBinder.BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) +769
System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor) +296
System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +105
System.Web.Mvc.Async.<>c__DisplayClass25.
And here is our code for the controller's ActionResult:
Any insight or experience with this would be greatly appreciated, we're a bit stumped.
Thanks!
John