I attempted to add a new text-string property to an existing Grid Editor. I am able to add the property just fine and see that the property was added when editing the Grid Editor properties & within the Content section. However I am having an issue accessing the new property.
I am receiving this error on the front end where my Grid Editor should be rendering:
Object reference not set to an instance of an object.
Here is the snippet where I am attempting to access my new property and get the value:
var trackingEvent = item.GetValue("trackingEvent");
I have tried several different ways to grab this value. It seems like LeBlender does not recognize my new property even though I am able to see it within the Developer and Content sections.
I initially thought I was receiving the object reference error because all of my grid editors now had a new property with an empty or null value. I tried to run some if else logic past it to check but I am unable to resolve this error. It seems like my new property is not being stored somewhere?
I've hit a wall. What am I missing? Thanks in advance for any input!
can you post code which shows this line in a wider context as I don't think that line alone would produce an object reference error. Namely I would be interested in where 'item' is defined as that would be more likey but without seeing I could be wrong
looking at that it doesn't make much sense why you would get an error is if you put a break point I'm assuming its on that very line that it throws an exception?
What happens if you put this on the line before and step into a breakpoint there?
error CS1928: 'Lecoati.LeBlender.Extension.Models.LeBlenderValue' does not contain a definition for 'HasProperty' and the best extension method overload 'umbraco.ContentExtensions.HasProperty(umbraco.cms.businesslogic.Content, string)' has some invalid arguments
Current version is 1.0.8.4. I reinstalled the package and that fixed the HasProperty issue.
I logged in to my sites Umbraco admin area and under the Developer section I looked at the XML Cache Data. The 'Content in the cmsContentXml table' had an error. I ran the Fix and that seems to have fixed all of my issues. I am able to run the snippet of code you provided and my grid editors are now rendering properly on the front end.
You can consider the issue closed. Thank you for your time and effort it is much appreciated!
LeBlender Property Issue
I attempted to add a new text-string property to an existing Grid Editor. I am able to add the property just fine and see that the property was added when editing the Grid Editor properties & within the Content section. However I am having an issue accessing the new property.
I am receiving this error on the front end where my Grid Editor should be rendering:
Object reference not set to an instance of an object.
Here is the snippet where I am attempting to access my new property and get the value:
var trackingEvent = item.GetValue("trackingEvent");
I have tried several different ways to grab this value. It seems like LeBlender does not recognize my new property even though I am able to see it within the Developer and Content sections.
I initially thought I was receiving the object reference error because all of my grid editors now had a new property with an empty or null value. I tried to run some if else logic past it to check but I am unable to resolve this error. It seems like my new property is not being stored somewhere?
I've hit a wall. What am I missing? Thanks in advance for any input!
can you post code which shows this line in a wider context as I don't think that line alone would produce an object reference error. Namely I would be interested in where 'item' is defined as that would be more likey but without seeing I could be wrong
Sure! Here is the code in full context:
I should also note that I have tried getting the value using
looking at that it doesn't make much sense why you would get an error is if you put a break point I'm assuming its on that very line that it throws an exception?
What happens if you put this on the line before and step into a breakpoint there?
Hey Ian,
I am receiving this error:
error CS1928: 'Lecoati.LeBlender.Extension.Models.LeBlenderValue' does not contain a definition for 'HasProperty' and the best extension method overload 'umbraco.ContentExtensions.HasProperty(umbraco.cms.businesslogic.Content, string)' has some invalid arguments
With this code:
Not sure what version of leblender you are using but if you see here the latest version does have hasproperty https://github.com/Lecoati/LeBlender/blob/master/Src/Lecoati.LeBlender.Extension/Models/LeBlenderValue.cs
Current version is 1.0.8.4. I reinstalled the package and that fixed the HasProperty issue.
I logged in to my sites Umbraco admin area and under the Developer section I looked at the XML Cache Data. The 'Content in the cmsContentXml table' had an error. I ran the Fix and that seems to have fixed all of my issues. I am able to run the snippet of code you provided and my grid editors are now rendering properly on the front end.
You can consider the issue closed. Thank you for your time and effort it is much appreciated!
is working on a reply...