Fixes issue with data type pre-values and using PreValueAsArray when they are dictionary formatted.

This commit is contained in:
Shannon
2014-04-23 22:15:33 +10:00
parent b60ee9944d
commit cefc319bfb
2 changed files with 5 additions and 5 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}
}