diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/DocumentRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/DocumentRepository.cs index 7e783efcef..f2a91c11a1 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Implement/DocumentRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Implement/DocumentRepository.cs @@ -1091,16 +1091,18 @@ namespace Umbraco.Core.Persistence.Repositories.Implement { // here we have to ensure we have names and publish names, and to try and fix the situation if we have no name, see also: U4-11286 - if (string.IsNullOrWhiteSpace(content.Name) && content.ContentType.Variations.DoesNotSupportCulture()) + // invariant content must have an invariant name + if (content.ContentType.Variations.DoesNotSupportCulture() && string.IsNullOrWhiteSpace(content.Name)) throw new InvalidOperationException("Cannot save content with an empty name."); + // variant content must have at least one variant name if (content.ContentType.Variations.DoesSupportCulture()) { - // no variant name = error if (content.CultureNames.Count == 0) throw new InvalidOperationException("Cannot save content with an empty name."); - // sync the invariant name to the default culture name if it's empty since we can't save with an empty invariant name. + // cannot save with an empty invariant name, + // if invariant name is missing, derive it from variant names // fixme should we always sync the invariant name with the default culture name when updating? if (string.IsNullOrWhiteSpace(content.Name)) { diff --git a/src/Umbraco.Tests/Cache/RuntimeCacheProviderTests.cs b/src/Umbraco.Tests/Cache/RuntimeCacheProviderTests.cs index c0ccb75c94..48768b9c03 100644 --- a/src/Umbraco.Tests/Cache/RuntimeCacheProviderTests.cs +++ b/src/Umbraco.Tests/Cache/RuntimeCacheProviderTests.cs @@ -12,7 +12,7 @@ namespace Umbraco.Tests.Cache [Test] - [Ignore("TEMP - fails")] + [Explicit("Testing for timeouts cannot work on VSTS.")] public void Can_Add_And_Expire_Struct_Strongly_Typed_With_Null() { var now = DateTime.Now; diff --git a/src/Umbraco.Tests/Services/EntityServiceTests.cs b/src/Umbraco.Tests/Services/EntityServiceTests.cs index 103e497b42..0bfc1890d7 100644 --- a/src/Umbraco.Tests/Services/EntityServiceTests.cs +++ b/src/Umbraco.Tests/Services/EntityServiceTests.cs @@ -471,7 +471,6 @@ namespace Umbraco.Tests.Services } [Test] - [Ignore("TEMP - fails")] public void EntityService_Can_Get_Child_Content_By_ParentId_And_UmbracoObjectType_With_Variant_Names() { var service = ServiceContext.EntityService; @@ -480,7 +479,8 @@ namespace Umbraco.Tests.Services contentType.Variations = ContentVariation.CultureNeutral; ServiceContext.ContentTypeService.Save(contentType); - var root = MockedContent.CreateSimpleContent(contentType); + var root = MockedContent.CreateSimpleContent(contentType); + root.SetName("Root", _langFr.IsoCode); // else cannot save ServiceContext.ContentService.Save(root); for (int i = 0; i < 10; i++) @@ -491,6 +491,10 @@ namespace Umbraco.Tests.Services c1.SetName("Test " + i + " - FR", _langFr.IsoCode); c1.SetName("Test " + i + " - ES", _langEs.IsoCode); } + else + { + c1.SetName("Test", _langFr.IsoCode); // else cannot save + } ServiceContext.ContentService.Save(c1); }