diff --git a/src/Umbraco.Core/Models/DeepCloneHelper.cs b/src/Umbraco.Core/Models/DeepCloneHelper.cs index d8ef10751b..ed7a0e802d 100644 --- a/src/Umbraco.Core/Models/DeepCloneHelper.cs +++ b/src/Umbraco.Core/Models/DeepCloneHelper.cs @@ -46,7 +46,7 @@ namespace Umbraco.Core.Models var refProperties = inputType.GetProperties() .Where(x => //is not attributed with the ignore clone attribute - x.GetCustomAttribute() == null + Attribute.GetCustomAttribute(x, typeof(DoNotCloneAttribute)) == null //reference type but not string && x.PropertyType.IsValueType == false && x.PropertyType != typeof (string) //settable diff --git a/src/Umbraco.Core/Models/PreValue.cs b/src/Umbraco.Core/Models/PreValue.cs index c33f642744..e39f5caf1f 100644 --- a/src/Umbraco.Core/Models/PreValue.cs +++ b/src/Umbraco.Core/Models/PreValue.cs @@ -5,6 +5,13 @@ /// public class PreValue : IDeepCloneable { + public PreValue(int id, string value, int sortOrder) + { + Id = id; + Value = value; + SortOrder = sortOrder; + } + public PreValue(int id, string value) { Value = value; @@ -26,6 +33,11 @@ /// public int Id { get; private set; } + /// + /// The sort order stored for the pre-value field value + /// + public int SortOrder { get; private set; } + public virtual object DeepClone() { //Memberwise clone on PreValue will work since it doesn't have any deep elements diff --git a/src/Umbraco.Tests/Persistence/Repositories/TemplateRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/TemplateRepositoryTest.cs index a8c31b60d5..2ccc0410e4 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/TemplateRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/TemplateRepositoryTest.cs @@ -144,9 +144,8 @@ namespace Umbraco.Tests.Persistence.Repositories var unitOfWork = provider.GetUnitOfWork(); var templateRepository = new TemplateRepository(unitOfWork, NullCacheProvider.Current); - var tagRepository = new TagsRepository(unitOfWork, NullCacheProvider.Current); var contentTypeRepository = new ContentTypeRepository(unitOfWork, NullCacheProvider.Current, templateRepository); - var contentRepo = new ContentRepository(unitOfWork, NullCacheProvider.Current, contentTypeRepository, templateRepository, tagRepository, CacheHelper.CreateDisabledCacheHelper()); + var contentRepo = new ContentRepository(unitOfWork, NullCacheProvider.Current, contentTypeRepository, templateRepository, CacheHelper.CreateDisabledCacheHelper()); using (contentRepo) {