diff --git a/src/Umbraco.Core/Persistence/Repositories/ContentTypeBaseRepository.cs b/src/Umbraco.Core/Persistence/Repositories/ContentTypeBaseRepository.cs
index 3201213b8c..487c43b89c 100644
--- a/src/Umbraco.Core/Persistence/Repositories/ContentTypeBaseRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/ContentTypeBaseRepository.cs
@@ -426,13 +426,13 @@ namespace Umbraco.Core.Persistence.Repositories
///
private void AssignDataTypeFromPropertyEditor(PropertyType propertyType)
{
- //we cannot try to assign a data type of it's an empty guid
- if (propertyType.DataTypeId != Guid.Empty)
+ //we cannot try to assign a data type of it's empty
+ if (propertyType.PropertyEditorAlias.IsNullOrWhiteSpace() == false)
{
var sql = new Sql()
.Select("*")
.From()
- .Where("controlId = @Id", new { Id = propertyType.DataTypeId })
+ .Where("propertyEditorAlias = @propertyEditorAlias", new { propertyEditorAlias = propertyType.PropertyEditorAlias })
.OrderBy(typeDto => typeDto.DataTypeId);
var datatype = Database.FirstOrDefault(sql);
//we cannot assign a data type if one was not found
@@ -442,7 +442,7 @@ namespace Umbraco.Core.Persistence.Repositories
}
else
{
- LogHelper.Warn>("Could not assign a data type for the property type " + propertyType.Alias + " since no data type was found with a property editor " + propertyType.DataTypeId);
+ LogHelper.Warn>("Could not assign a data type for the property type " + propertyType.Alias + " since no data type was found with a property editor " + propertyType.PropertyEditorAlias);
}
}
}