Fix up linq issues and lookup
This commit is contained in:
@@ -414,22 +414,17 @@ namespace Umbraco.Web.Editors
|
||||
{
|
||||
var result = new Dictionary<Guid, ContentItemDisplay>();
|
||||
|
||||
using (var scope = _scopeProvider.CreateScope())
|
||||
{
|
||||
var contentTypes = Services.ContentTypeService.GetAll(contentTypeKeys).ToList();
|
||||
using var scope = _scopeProvider.CreateScope(autoComplete: true);
|
||||
var contentTypes = Services.ContentTypeService.GetAll(contentTypeKeys).ToList();
|
||||
|
||||
if (contentTypes.Any(contentType => contentType == null))
|
||||
foreach (var contentType in contentTypes)
|
||||
{
|
||||
if (contentType is null)
|
||||
{
|
||||
throw new HttpResponseException(HttpStatusCode.NotFound);
|
||||
}
|
||||
|
||||
foreach (var contentTypeKey in contentTypeKeys)
|
||||
{
|
||||
var contentType = contentTypes.First(c => c.Key == contentTypeKey);
|
||||
result.Add(contentTypeKey, GetEmpty(contentType, parentId));
|
||||
}
|
||||
|
||||
scope.Complete();
|
||||
result.Add(contentType.Key, GetEmpty(contentType, parentId));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -156,15 +156,15 @@ namespace Umbraco.Web.PropertyEditors
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!valEditors.ContainsKey(dataType.Id))
|
||||
if (!valEditors.TryGetValue(dataType.Id, out var valEditor))
|
||||
{
|
||||
var tempConfig = dataType.Configuration;
|
||||
var valEditor = propEditor.GetValueEditor(tempConfig);
|
||||
valEditor = propEditor.GetValueEditor(tempConfig);
|
||||
|
||||
valEditors.Add(dataType.Id, valEditor);
|
||||
}
|
||||
|
||||
var convValue = valEditors[dataType.Id].ToEditor(tempProp, dataTypeService);
|
||||
var convValue = valEditor.ToEditor(tempProp, dataTypeService);
|
||||
|
||||
// update the raw value since this is what will get serialized out
|
||||
row.RawPropertyValues[prop.Key] = convValue;
|
||||
|
||||
Reference in New Issue
Block a user