Developer forum

Forum » Templates » Problem with ProductCategoryFields after DW upgrade

Problem with ProductCategoryFields after DW upgrade

Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

After upgrading to latest DW (9.14.3) I got problems with ProductCategoryFields. I upgraded from 9.13.11.

I get a : 

SYSTEM.NULLREFERENCEEXCEPTION: OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT.
   AT DYNAMICWEB.ECOMMERCE.PRODUCTS.CATEGORIES.FIELD.GET_DEFAULTVALUE()

I have narrowed it down to that even code with the "TemplateTags" below gives this error. Same thing if I have a "@c.TemplateTags()" in the inner loop. 

What has changed regarding ProductCategoryFields between those versions? We use productcategory fields quite extensive in the solution sp this is bit of big issue. Any suggestions is appriciated. 

@{

    foreach (LoopItem categoryGroup in GetLoop("ProductCategories")){
        @categoryGroup.TemplateTags()
        foreach(var c in categoryGroup.GetLoop("ProductCategoryFields")){          
        }
    }
}


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Seems like a list field with no options - we did make a change around this, so we will bug it.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

We have a similar situation but in our case the fields are not listbox fields but regular text fields.

I was actually planning on investigating it further since I have not seen anyone posting a similar issue.

But now I know I am not alone :)

I would also appreciate a solution to it.

Thank you,

Adrian

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

Hi Aki and Adrian,

I was not able to reproduce the issue on DW9.14.3 using category has sipmly text field and list-box fields with various 'Display as' setting, no option, one option with Default not checked and two options has Default checked for one from them. Your code mentioned above has been used in template of product details via regular Product Catalog module, couple products having no the field selected-edited and selected options. The setup has been done on DW9.13.11 and the solution was moved under 9.14.3. Could you please specify setup (like category\field definition's settings and selection in product) and conditions of your case. Thanks.

BR, Oleg QA  

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi Oleg,

In my case it is a Rapido-based solution. We have a number of product categories of type "Property"

 

This example product uses property fields from the product category "Property F" where most fields are of type "Checkboxlist"

http://industrilas.stage.mindflower.se/en/products/hinges/butt-hinges/butt-hinge

 

And those Checkboxlist does not have any default values checked. And that is because it does not make any sense to have a default value. 

Regards / Aki

 

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

In my case it's a single ProductCategory with 37 fields, all fields are Text and are not editable in languages.

Values come from Integration.

The isssue arrised after upgrading the solution to 9.13.8. All worked well before.
The solution is based on Rapido and the product category fields are retrieved with stabdard methods.

We have also noticed that productcategoryfields are not displayed correctly in Printable papers either.

Could there be anything lost in the upgrade process? Maybe some table updates? I can confirm it works correctly on solutions installed directly on 9.13.x.

In our case the upgrade was from 9.9.x.

Thank you,

Adrian

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply
This post has been marked as an answer

Hi,

I was able to reproduce the exception on 9.14.3 when just added category field type of list has only name\system name\tag filled and no option. The issue is reproduced after resycle IIS pool. If I have option list where no Default option checked exusts then it' OK. New bug 10743 has been created. Thanks.

BR, Oleg QA

Votes for this answer: 1

 

You must be logged in to post in the forum