Fixes dirty tracking with resetting properties

This commit is contained in:
Shannon
2018-10-25 15:47:25 +11:00
parent 9df4a8091e
commit 42f0d2b356
14 changed files with 117 additions and 185 deletions

View File

@@ -104,23 +104,14 @@ namespace Umbraco.Core.Models
set { SetPropertyValueAndDetectChanges(value, ref _value, Ps.Value.ValueSelector); }
}
public override object DeepClone()
protected override void PerformDeepClone(object clone)
{
var clone = (DictionaryTranslation)base.DeepClone();
base.PerformDeepClone(clone);
var clonedEntity = (DictionaryTranslation)clone;
// clear fields that were memberwise-cloned and that we don't want to clone
clone._language = null;
// turn off change tracking
clone.DisableChangeTracking();
// this shouldn't really be needed since we're not tracking
clone.ResetDirtyProperties(false);
// re-enable tracking
clone.EnableChangeTracking();
return clone;
clonedEntity._language = null;
}
}
}