Try our conversational search powered by Generative AI!

Dynamic Property issue


Upgraded the site to R2 today wich went rather OK. Some issues had to solved but one that is really bugging me is a case with a dynamic property we use as an id i different trees of the page.

On one pagetype we have the ability to override this id setting with a property named exactly the same. But here comes the problem: the id is empty on every language different from the one the page initially was created on if the local property isn't set.

This issue didn't occured in R1 and I've tried to read about any change in this but can't find anything stating this.

Jun 22, 2009 17:01

Can you give me a 1,2,3 repro for your problem, I am not sure I understand exactly how you have configured the properties with "language specific" etc.


Jun 23, 2009 9:59

We have a dynamic property called pId which helps us retrive data from our companydatabase. On one pagetype we have a local property also called pId so that we can retrive data for this page with a different criteria. This property is not set to be unique per language. If I now create a page based on this pagetype on english the page work just fine using the dynamic property. If I then create the swedish version of the page I get the error "ObjectReference not set as an instance of an object" pointing towards the code CurrentPage["pId"].ToString(). If I wrap the assignment of the variable with this line:

string pId = IsValue("pId") ? CurrentPage["pId"].ToString() : string.Empty;

it is empty. However if I set the property pId on the page all works just fine.

FYI: The dynamic property is not set to be unique per language either

As I said all worked just fine pre-update.

Edited, Jun 23, 2009 10:36
CMS Version ? RTM, SP1 or SP2 ?
Jun 23, 2009 11:21
Upgraded from CMS 5 R1 SP3 to CMS R2 SP1
Jun 23, 2009 11:27

Thanks, I can reproduce the problem and I am reporting this as a bug. If the property is global for all languages and you are on a non-master language it does not verify that this property is not NULL before returning the value (thus skipping the dynamic property).

An easy workaround is that if you get an NULL-value back from your current code you do the call for the dynamic property yourself like:

PropertyData dynProp = DynamicPropertyTree.Instance.FindDynamicProperty("pId", CurrentPage.Property); if (dynProp != null && !dynProp.IsNull) { pId = dynProp.ToString(); }
Jun 23, 2009 11:51
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.