Developer forum

Forum » Ecommerce - Standard features » Product catalog for ViewModel

Product catalog for ViewModel

Johan Ulff
Reply

Hi,

We have a new solution running DW 9.10 and Rapdio 3.4.2 and when we try to attach the app "Product Catalog for NewModel" we get this error:

[NullReferenceException: Object reference not set to an instance of an object.] Dynamicweb.Admin._Closure$__._Lambda$__152-4(ProductField cf) +3
System.Linq.WhereSelectListIterator`2.MoveNext() +203 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +435
System.Linq.Enumerable.ToList(IEnumerable`1 source) +69
Dynamicweb.Admin.eCom_ProductCatalog_Edit.InitializePropertySelectors() +1343 Dynamicweb.Admin.eCom_ProductCatalog_Edit.InitControls() +750
System.Web.UI.Control.OnLoad(EventArgs e) +105
System.Web.UI.Control.LoadRecursive() +67
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3784

Any ideas of what is causing it?

Regards / Aki

 


Replies

 
Martin Vang
Martin Vang
Reply

Hi Johan/Aki (which one? :) )

I think you need to look at your category field values and categories. My guess would be bad data, where you somehow have partially imported data such that it looks as though a categoryfield has a category that has been deleted.

The error happens in this line, specifically in the bolded text:

     Dim productCategoryFieldList As IList(Of String) = Products.ProductField.GetCategoryFields().Where(Function(cf) cf.Category.CategoryType <> Products.Categories.CategoryType.SystemFields).Select(Function(f) $"{f.Category.Id} - {f.Id}").ToList()

I think it might be bad data, because my version of Rapido 3.4 works fine with "factory" data.

Hope this helps you find the culpit, otherwise feel free to ask for more help.

BR

Martin

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have recently discovered the "Health" section under monitoring.

You can find most of the data issues by opening the e-commerce part of the health section.

It was very useful in my case.

We have also found similar errors when changing/adding Languages, especially when messing with the default language.

I hope this helps.

Adrian

 
Martin Vang
Martin Vang
Reply

Hi Aki (and Adrian),

If you don't know what Monitoring Adrian is talking about, it's probably because it's part of the cloud licenses. If you don't have such a license, you need to upgrade or crawl through the logevents under "Settings -> System -> Event Viewer".

BR

Martin

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi Martin,

Thanks for the input. I think you are on the right track with bad data. But we have only used the admin to delete "factory" data. One might think that the platform should be able to handle that you would want to click on "delete" where it is possible. wink

We have deleted product category fileds and product categories. And have removede those from queries and facets. Maybe there are more places. I'll keep looking. smiley

Regards / Aki

 

 
Martin Vang
Martin Vang
Reply

Hi Aki,

I agree that the DW platform should be able to handle you clicking on anything in backend (if you read the warnings of course). Are you sure that you don't also have some sort of import set up or have run some once-off import to setup the initial data?

Anyway, we're taking this report quite seriously and tracking how we can improve our data handling. But it's a big product and category field value handling is... complicated. We're started some work to improve this area, but I don't know if it's a DW10, DW 9.12 or DW9.10 thing. That depends upon how big and breaking a change we need to do.

Again, sorry for the inconvenience and epsecially if you felt that I brushed you off. I might have focused a bit too much on getting you back-on-track with the project. :)

Let me know how it goes and if you find more issues like these.

BR

Martin

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi Martin,

I did not at all feel brushed off smiley and appriciate the all the help I can get. 

The solution is Rapido solution where I have deleted a bunch of Bikes/Fashion data in the admin. We currently have no integration in the solution or any initial import. I have created a number of product categories and added fields to them. I have also created som products in admin for testing. 

Attaching a screenshot showing that there is not CategoryFields without a category and there is no values yet. 

I have removed the fields from Queries, Index an Facets. 

Everything else works fine in admin except for attaching the the app "Product Catalog for ViewModel".

And as Adrian was saying, I have changed the default language to Swedish because the products from the ERP will be in Swedish and the translated to a number of other languages in the PIM. 

The Event View does not show anything related to this. It does not even have a file from today. 

Regards / Aki 

categories.png
 
Nicolai Pedersen
Reply

Changing default language - did you read the yellow box here?: https://doc.dynamicweb.com/rapido/introduction/start-up/new-project-on-dw-with-rapido#7924

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Thanks, I'll try to change back the default and edit it.

/Aki 

 
Aki Ruuskanen
Aki Ruuskanen
Reply

I still don't understand why the app "Product Catalog for View Model shouldn't work. It's not a part of the Rapido installation?

/Aki

 
Nicolai Pedersen
Reply

Hi Aki

As Martin wrote we are looking into it. The problem is some bad data - and yes, we should handle it.

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

OK, I this one is solved now. 

So it had to do with the category fields as Martin stated. And with default langiages as Adrian and Nicolai suggested.

What I had done was adding som languages and then changing the default language. 

After that I created a bunch of product categories in the new default language and added fields to them.

So what I did now was to click through all categories and fields and saved them in the original default language. After that the error disappeared. 

Maybe you have a hardcoded reference to "LANG1" somewhere? 

But it works now and thats great. yes

Thanks for the input guys!

Regards / Aki

 

 

 

 
Nicolai Pedersen
Reply

Hi Aki

Thank you for the update.

We have no reference to the lang1.

Problem is that the product record was created in lang1 and have field values in lang1 from once it was default language. Now you change default language to lang345. The field value is still there, but only in lang1. When the ui tries to load categories, it sees that original value, but cannot find a category for that value in the default language giving the exception.

It is caused because the architecture related to this is not designed for that scenario. So that is why we are looking at another approach to this that will be more resilient to data mis matches.

BR Nicolai

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi Nicolai,

OK, thanks for the explanation. yes

Always nice to know whats going on. smiley

Mvh / Aki

 

 

 

 

You must be logged in to post in the forum