Fixes issue with data type pre-values and using PreValueAsArray when they are dictionary formatted.
This commit is contained in:
@@ -354,8 +354,8 @@ AND umbracoNode.id <> @id",
|
||||
{
|
||||
//return from the cache
|
||||
var collection = cached.First();
|
||||
var preVal = collection.PreValuesAsArray.Single(x => x.Id == preValueId);
|
||||
return preVal.Value;
|
||||
var preVal = collection.FormatAsDictionary().Single(x => x.Value.Id == preValueId);
|
||||
return preVal.Value.Value;
|
||||
}
|
||||
|
||||
l.UpgradeToWriteLock();
|
||||
@@ -371,8 +371,8 @@ AND umbracoNode.id <> @id",
|
||||
var preVals = GetAndCachePreValueCollection(dto.DataTypeNodeId);
|
||||
|
||||
//return the single value for this id
|
||||
var pv = preVals.PreValuesAsArray.Single(x => x.Id == preValueId);
|
||||
return pv.Value;
|
||||
var pv = preVals.FormatAsDictionary().Single(x => x.Value.Id == preValueId);
|
||||
return pv.Value.Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace Umbraco.Core.Services
|
||||
{
|
||||
var collection = repository.GetPreValuesCollectionByDataTypeId(id);
|
||||
//now convert the collection to a string list
|
||||
var list = collection.PreValuesAsArray.Select(x => x.Value).ToList();
|
||||
var list = collection.FormatAsDictionary().Select(x => x.Value.Value).ToList();
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user