I had this all working on a site. We got doc type with about 3 mntp properties and the convertor was firing fine. Client the added content and now for certain properties the converter always returns null.
When i get raw value DataValue i get the csv list. However when i step through code and look at
public override object ConvertSourceToObject(PublishedPropertyType propertyType, object source, bool preview)
{
// Get the data type "content" or "media" setting
/*
var dts = ApplicationContext.Current.Services.DataTypeService;
var startNodePreValue =
dts.GetPreValuesCollectionByDataTypeId(propertyType.DataTypeId)
.PreValuesAsDictionary.FirstOrDefault(x => x.Key.ToLowerInvariant() == "startNode".ToLowerInvariant()).Value.Value;
var startNodeObj = JsonConvert.DeserializeObject<JObject>(startNodePreValue);
var pickerType = startNodeObj.GetValue("type").Value<string>();
*/
if (source == null)
{
return null;
}
var nodeIds = (int[])source;
nodeIds is null for that same property, Going further up the call stack,
Umbraco is sending the data into that method so if it's null there something is up. Have you already done the standard clear of umbraco.config, Examine indexes etc....?
some mntp properties return null
Hello,
I had this all working on a site. We got doc type with about 3 mntp properties and the convertor was firing fine. Client the added content and now for certain properties the converter always returns null.
When i get raw value DataValue i get the csv list. However when i step through code and look at
nodeIds is null for that same property, Going further up the call stack,
source is null this is really weird.
Any ideas?
Regards
Ismail
Strange, so
object source
is null when entering the ConvertDataToSource method?What version of Umbraco are you on?
Jeavon,
7.3.3. I have a different db no my dev server and it all works fine on there. Its really really weird.
Regards
Ismail
Umbraco is sending the data into that method so if it's null there something is up. Have you already done the standard clear of umbraco.config, Examine indexes etc....?
Jeavon,
Yup but will try it again.
Regards
Ismail
Jeavon,
Fixed it was me being a noob https://our.umbraco.org/forum/developers/api-questions/75382-getpropertyvalue-returns-null#241260
Happens to us all sometimes :)
is working on a reply...