Developer forum

Forum » Ecommerce - Standard features » .Net error when filtering with the Product catalog for ViewModel

.Net error when filtering with the Product catalog for ViewModel

Lars Larsen
Lars Larsen
Reply

Hi

I am using the Product catalog for ViewModel to render a product list. I am using the standard product list template "ProductViewListFacets.cshtml" to render the list. That works well, the product list with facets is rendered. But when using a filter on the page I get this .Net error. What can be the problem?

An error occurred while attaching module (Dynamicweb.Frontend.Content)
System.NullReferenceException: Object reference not set to an instance of an object.
   at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.CreateProductGroup(ProductGroupViewModelSettings settings, ViewModelPropertyFiller`1 filler, Group group)
   at Dynamicweb.Ecommerce.ProductCatalog.ViewModelPropertyFiller`1.Fill[S](T model, String propertyName, Func`1 source)
   at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.CreateView(ProductListViewModelSettings settings, Group group, IList`1 products)
   at Dynamicweb.Ecommerce.ProductCatalog.ProductCatalogFrontend.RenderProductList(ProductCatalogSettings settings, String groupId)
   at Dynamicweb.Ecommerce.ProductCatalog.ProductCatalogFrontend.GetContent()
   at Dynamicweb.Frontend.Content.GetModuleOutput(Paragraph paragraph, PageView pageview)

Replies

 
Nicolai Pedersen
Reply

Seems like a product that does not belong to a group...?

You should not get the exception though, so if that is the case, we also have a bug to fix.

 
Lars Larsen
Lars Larsen
Reply

Hi Nicolai

Yes I've got a lot of products not related to a group. So that's not allowed anymore?

I do get the exception.

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Well, the code does not take it into consideration. But it is allowed, so consider it a bug!

Already made a bugfix for it - will be out in ecommerce package very soon.

BR Nicolai

Votes for this answer: 1
 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Lars

The problem TFS#77402 "Null reference exception when having a product with no group in product view models" has now been fixed in Package "Dynamicweb.Ecommerces" version 1.8.61

You are able to find this update in the backend Package update section.

Also the correction are part of the 9.8.7 release 

You are able to find this build in the download section:

http://doc.dynamicweb.com/releases-and-downloads/releases

Please contact Dynamicweb Support if you need any additional help regarding this.

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 

You must be logged in to post in the forum