diff --git a/src/Umbraco.Core/Models/ContentType.cs b/src/Umbraco.Core/Models/ContentType.cs
index c37e165837..f4ff7bccf7 100644
--- a/src/Umbraco.Core/Models/ContentType.cs
+++ b/src/Umbraco.Core/Models/ContentType.cs
@@ -32,8 +32,11 @@ namespace Umbraco.Cms.Core.Models
///
/// Only use this for creating ContentTypes at the root (with ParentId -1).
///
- public ContentType(IShortStringHelper shortStringHelper, int parentId) : base(shortStringHelper, parentId) =>
+ public ContentType(IShortStringHelper shortStringHelper, int parentId) : base(shortStringHelper, parentId)
+ {
_allowedTemplates = new List();
+ HistoryCleanup = new HistoryCleanup();
+ }
///
@@ -43,8 +46,11 @@ namespace Umbraco.Cms.Core.Models
///
///
public ContentType(IShortStringHelper shortStringHelper, IContentType parent, string alias)
- : base(shortStringHelper, parent, alias) =>
+ : base(shortStringHelper, parent, alias)
+ {
_allowedTemplates = new List();
+ HistoryCleanup = new HistoryCleanup();
+ }
///
public override bool SupportsPublishing => SupportsPublishingConst;
diff --git a/src/Umbraco.Core/Models/Mapping/ContentTypeMapDefinition.cs b/src/Umbraco.Core/Models/Mapping/ContentTypeMapDefinition.cs
index 9d41c4def9..3281701c84 100644
--- a/src/Umbraco.Core/Models/Mapping/ContentTypeMapDefinition.cs
+++ b/src/Umbraco.Core/Models/Mapping/ContentTypeMapDefinition.cs
@@ -183,7 +183,8 @@ namespace Umbraco.Cms.Core.Models.Mapping
KeepAllVersionsNewerThanDays = source.HistoryCleanup.KeepAllVersionsNewerThanDays,
KeepLatestVersionPerDayForDays = source.HistoryCleanup.KeepLatestVersionPerDayForDays,
GlobalKeepAllVersionsNewerThanDays = _contentSettings.ContentVersionCleanupPolicy.KeepAllVersionsNewerThanDays,
- GlobalKeepLatestVersionPerDayForDays = _contentSettings.ContentVersionCleanupPolicy.KeepLatestVersionPerDayForDays
+ GlobalKeepLatestVersionPerDayForDays = _contentSettings.ContentVersionCleanupPolicy.KeepLatestVersionPerDayForDays,
+ GlobalEnableCleanup = _contentSettings.ContentVersionCleanupPolicy.EnableCleanup
};
target.AllowCultureVariant = source.VariesByCulture();
diff --git a/src/Umbraco.Web.UI.Client/src/views/documentTypes/views/permissions/permissions.html b/src/Umbraco.Web.UI.Client/src/views/documentTypes/views/permissions/permissions.html
index 84bef68274..d78e0647d7 100644
--- a/src/Umbraco.Web.UI.Client/src/views/documentTypes/views/permissions/permissions.html
+++ b/src/Umbraco.Web.UI.Client/src/views/documentTypes/views/permissions/permissions.html
@@ -102,6 +102,12 @@
+
+
+
+
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml
index 8e1065bc33..84b66bc6a9 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml
@@ -1829,6 +1829,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
Keep all versions newer than days
Keep latest version per day for days
Prevent cleanup
+ NOTE! The cleanup of historically content versions are disabled globally. These settings will not take effect before it is enabled.
Add language
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
index 1dd15b373f..639021d82d 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
@@ -1886,6 +1886,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
Keep all versions newer than days
Keep latest version per day for days
Prevent cleanup
+ NOTE! The cleanup of historically content versions are disabled globally. These settings will not take effect before it is enabled.
Add language
diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ContentTypeRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ContentTypeRepositoryTest.cs
index dfe799e2b8..decd1d7c5c 100644
--- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ContentTypeRepositoryTest.cs
+++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ContentTypeRepositoryTest.cs
@@ -273,7 +273,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos
Assert.AreNotEqual(propertyType.Key, Guid.Empty);
}
- TestHelper.AssertPropertyValuesAreEqual(fetched, contentType, ignoreProperties: new[] { "DefaultTemplate", "AllowedTemplates", "UpdateDate" });
+ TestHelper.AssertPropertyValuesAreEqual(fetched, contentType, ignoreProperties: new[] { "DefaultTemplate", "AllowedTemplates", "UpdateDate", "HistoryCleanup" });
}
}
@@ -378,6 +378,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos
//// Alias = display.Alias,
Path = display.Path,
//// AdditionalData = display.AdditionalData,
+ HistoryCleanup = display.HistoryCleanup,
// ContentTypeBasic
Alias = display.Alias,
diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs
index 946d4a236a..04617ae5f3 100644
--- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs
+++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs
@@ -3,27 +3,26 @@
using System;
using System.Linq;
-using System.Threading;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using NPoco;
using NUnit.Framework;
-using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Models;
+using Umbraco.Cms.Core.Models.ContentEditing;
using Umbraco.Cms.Core.Scoping;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Sync;
using Umbraco.Cms.Infrastructure.Persistence;
using Umbraco.Cms.Infrastructure.Persistence.Dtos;
using Umbraco.Cms.Infrastructure.PublishedCache;
-using Umbraco.Cms.Infrastructure.PublishedCache.DataSource;
using Umbraco.Cms.Tests.Common.Builders;
using Umbraco.Cms.Tests.Common.Testing;
using Umbraco.Cms.Tests.Integration.Testing;
using Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Scoping;
using Umbraco.Extensions;
+using Language = Umbraco.Cms.Core.Models.Language;
namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services
{
@@ -1338,7 +1337,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services
{
Alias = alias,
Name = alias,
- Variations = variance
+ Variations = variance,
};
private PropertyTypeCollection CreatePropertyCollection(params (string alias, ContentVariation variance)[] props)