diff --git a/src/Umbraco.Web/PropertyEditors/BlockEditorPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/BlockEditorPropertyEditor.cs index a98a85922b..b32a91c058 100644 --- a/src/Umbraco.Web/PropertyEditors/BlockEditorPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/BlockEditorPropertyEditor.cs @@ -161,17 +161,17 @@ namespace Umbraco.Web.PropertyEditors internal class BlockEditorValues { private readonly IBlockEditorDataHelper _dataHelper; - private readonly Lazy> _contentTypes; + private readonly Lazy> _contentTypes; public BlockEditorValues(IBlockEditorDataHelper dataHelper, IContentTypeService contentTypeService) { _dataHelper = dataHelper; - _contentTypes = new Lazy>(() => contentTypeService.GetAll().ToDictionary(c => c.Key)); + _contentTypes = new Lazy>(() => contentTypeService.GetAll().ToDictionary(c => c.Key)); } private IContentType GetElementType(JObject item) { - var contentTypeKey = item[ContentTypeKeyPropertyKey]?.ToObject() ?? string.Empty; + Guid contentTypeKey = item[ContentTypeKeyPropertyKey]?.ToObject() ?? Guid.Empty; _contentTypes.Value.TryGetValue(contentTypeKey, out var contentType); return contentType; } diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs index 907c44c8f3..7bd410f55a 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs @@ -102,8 +102,8 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters if (!elements.TryGetValue(guidUdi.Guid, out var data)) continue; - // TODO: make this work with key, not Alias. - if (!contentTypeMap.TryGetValue(data.ContentType.Alias, out var blockConfig)) + // Make this work with Key, not alias, since contentTypeMap is now a dctionary with contentTypeKey as the dictionary key. + if (!contentTypeMap.TryGetValue(data.ContentType.Key, out var blockConfig)) continue; // this can happen if they have a settings type, save content, remove the settings type, and display the front-end page before saving the content again