Developer forum

Forum » Development » ImagePatternImages is empty with viewmodel

ImagePatternImages is empty with viewmodel

Anders Ebdrup
Anders Ebdrup
Reply

Dear Dynamicweb,

 

We are trying to change to the new product catalog viewmodel, where we encounter an issue with this property: ImagePatternImages being empty. We are using Dynamicweb.Ecommerce 1.7.46.

Is seems to be caused by an empty shopid is used to initialize ProductViewModelSettings  - see this screendump: https://www.screencast.com/t/zhS4SZKJ2n.

 

I hope you are able to help me on this one?

 

Best regards, Anders


Replies

 
Vincent Gercke
Reply

+1

 
Martin Vang
Martin Vang
Reply

Hi Anders,

I see that this was broken at some point.

I've created this bug to fix it (subject to name changes): Bug 74450: ProductViewModel does not work with shop-specific stuff like images

Sorry about that.

The only work-arround I can come up with, is to request the same data again with the webapi:

/dwapi/Products/GetProduct/PROD7?LanguageId=LANG1&CurrencyCode=EUR&CountryCode=GB&FilledProperties=ImagePatternImages&ShopId=SHOP1

/dwapi/Products/GetProductList?ProductIds=PROD65,PROD70&LanguageId=LANG1&CurrencyCode=EUR&CountryCode=DK&FilledProperties=ImagePatternImages&ShopId=SHOP1

ShopId can be found like this: PageView.Current.Area.EcomShopId

BR

Martin

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Martin,

 

Thank you. We need this in the frontend, so I cannot use the suggested work arounds, but I hope for a quick hotfix to be available?

 
Nicolai Pedersen
Reply

Hi Anders

We are actually updating and changing the viewmodel quite a bit for the 9.8 release on Tuesday. We are planning to break compatibility because of issues like this and other similar issues because some of the implementation was made a little too fast with too little thought. We are i.e. adding another variant structure to the viewmodel to better support the scenarios we encounter etc.

You might already see some of the changes in the API docs.

The image pattern issue among others are fixed with those changes.

BR Nicolai

 
Martin Vang
Martin Vang
Reply

Bug 74450 resolved. Will be part of release next week.

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Martin,

 

Sounds great! :-) Which package and version can we download?

 
Nicolai Pedersen
Reply
This post has been marked as an answer

It will be part of the 9.8 release on Tuesday.

Votes for this answer: 1

 

You must be logged in to post in the forum