I am trying to get a document in the GatheringNodeData event using TypedContent. I am able to get an instance of the document but all of the Property values are null.
Here is a snippet of the relevant code. Note that I am using the fake Umbraco Context to create the helper.
private void OnGatheringNodeData(object sender, IndexingNodeDataEventArgs e, UmbracoHelper helper)
{
// Get document
var doc = helper.TypedContent(e.NodeId);
// we are trying to get a value out of a NestedContent property to index so it can be searched on
// this logs an exception to the Umbraco log as the property value is null.
var prop3 = doc.GetPropertyValue<IEnumberable<IPublishedContent>>("prop");
var prop = doc.GetProperty("prop").Value; // value is null
var prop1 = doc.GetProperty("prop").DataValue; // has the raw json value
// we are using models builder so this is also null
var prop2 = doc.Prop;
}
null property values in GatheringNodeData
Hi
I am trying to get a document in the GatheringNodeData event using TypedContent. I am able to get an instance of the document but all of the Property values are null.
Here is a snippet of the relevant code. Note that I am using the fake Umbraco Context to create the helper.
@sniffdk provided an alternative solution to indexing the nested content values on the slack channel but I am still curious if this should be possible.
Dallas
i have the same issue, i am get GetPropertyValue as null but the umb://media value is availble in DataValue, how do i get the url?
I was able to solve the problem by defining the UmbracoHelper in the OnGatheringNodeData() method rather than passing it in as a parameter.
Dallas
is working on a reply...