Merge pull request #2177 from umbraco/temp-U4-10384

U4-10384 Error when changing content type on media item
This commit is contained in:
Sebastiaan Janssen
2017-09-14 13:46:32 +02:00
committed by GitHub

View File

@@ -93,6 +93,10 @@ namespace Umbraco.Core.Models
//NOTE: Consider checking type before value is set: item.PropertyType.DataTypeId == property.PropertyType.DataTypeId
//Transfer the existing value to the new property
var property = this[key];
if (item.Id == 0 && property.Id != 0)
{
item.Id = property.Id;
}
if (item.Value == null && property.Value != null)
{
item.Value = property.Value;