diff --git a/src/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/ContentControllerTests.cs b/src/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/ContentControllerTests.cs index 7e8c2c83a5..42b9eb2ddc 100644 --- a/src/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/ContentControllerTests.cs +++ b/src/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/ContentControllerTests.cs @@ -51,7 +51,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Web.BackOffice.Controllers .Done() .Build(); - var culturesPublished = new List { "en-us", "da-dk" }; + var culturesPublished = new []{ "en-us", "da-dk" }; var notifications = new SimpleNotificationModel(); ContentController contentController = CreateContentController(domainServiceMock.Object); @@ -77,7 +77,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Web.BackOffice.Controllers .Done() .Build(); - var culturesPublished = new List {"da-dk" }; + var culturesPublished = new []{"da-dk" }; var notifications = new SimpleNotificationModel(); ContentController contentController = CreateContentController(domainServiceMock.Object); @@ -106,7 +106,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Web.BackOffice.Controllers .Done() .Build(); - var culturesPublished = new List { "en-us", "da-dk" }; + var culturesPublished = new []{ "en-us", "da-dk" }; var notifications = new SimpleNotificationModel(); ContentController contentController = CreateContentController(domainServiceMock.Object); @@ -135,7 +135,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Web.BackOffice.Controllers .Done() .Build(); - var culturesPublished = new List { "en-us", "da-dk", "nl-bk", "se-sv" }; + var culturesPublished = new []{ "en-us", "da-dk", "nl-bk", "se-sv" }; var notifications = new SimpleNotificationModel(); ContentController contentController = CreateContentController(domainServiceMock.Object); @@ -184,7 +184,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Web.BackOffice.Controllers .Done() .Build(); - var culturesPublished = new List { "en-us", "da-dk", "nl-bk", "se-sv", "de-de" }; + var culturesPublished = new []{ "en-us", "da-dk", "nl-bk", "se-sv", "de-de" }; ContentController contentController = CreateContentController(domainServiceMock.Object); var notifications = new SimpleNotificationModel(); @@ -220,7 +220,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Web.BackOffice.Controllers .Done() .Build(); - var culturesPublished = new List { "en-us", "se-sv" }; + var culturesPublished = new []{ "en-us", "se-sv" }; var notifications = new SimpleNotificationModel(); ContentController contentController = CreateContentController(domainServiceMock.Object); diff --git a/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs b/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs index f67a65dde3..3fe3b784cf 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/ContentController.cs @@ -898,6 +898,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers } var publishStatus = PublishBranchInternal(contentItem, false, cultureForInvariantErrors, out wasCancelled, out var successfulCultures).ToList(); + AddDomainWarnings(publishStatus, successfulCultures, globalNotifications); AddPublishStatusNotifications(publishStatus, globalNotifications, notifications, successfulCultures); } break; @@ -1428,6 +1429,15 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers } } + private void AddDomainWarnings(IEnumerable publishResults, string[] culturesPublished, + SimpleNotificationModel globalNotifications) + { + foreach (PublishResult publishResult in publishResults) + { + AddDomainWarnings(publishResult.Content, culturesPublished, globalNotifications); + } + } + /// /// Verifies that there's an appropriate domain setup for the published cultures /// @@ -1438,7 +1448,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers /// /// /// - internal void AddDomainWarnings(IContent persistedContent, IEnumerable culturesPublished, SimpleNotificationModel globalNotifications) + internal void AddDomainWarnings(IContent persistedContent, string[] culturesPublished, SimpleNotificationModel globalNotifications) { // Don't try to verify if no cultures were published if (culturesPublished is null)