From 1677442fadb9755225075b9abdcc222aa5e24766 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Tue, 12 Feb 2019 11:58:38 +0100 Subject: [PATCH] #4440 - If we only have one culture, we sets that's culture when requesting children. Fixes issue where a document type is varing by culture, but we don't show the mculture picker. --- src/Umbraco.Web/Editors/ContentController.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs index 27d63d9d7ad8..011c69c336f6 100644 --- a/src/Umbraco.Web/Editors/ContentController.cs +++ b/src/Umbraco.Web/Editors/ContentController.cs @@ -464,6 +464,16 @@ public PagedResult> GetChildren( { long totalChildren; List children; + + // Sets the culture to the only existing culture if we only have one culture. + if (string.IsNullOrWhiteSpace(cultureName)) + { + if (_allLangs.Value.Count == 1) + { + cultureName = _allLangs.Value.First().Key; + } + } + if (pageNumber > 0 && pageSize > 0) { IQuery queryFilter = null; @@ -1200,7 +1210,7 @@ private PublishResult PublishInternal(ContentItemSave contentItem, out bool wasC if (canPublish) { var culturesToPublish = cultureVariants.Where(x => x.Publish).Select(x => x.Culture).ToArray(); - + //proceed to publish if all validation still succeeds var publishStatus = Services.ContentService.SaveAndPublish(contentItem.PersistedContent, culturesToPublish, Security.CurrentUser.Id); wasCancelled = publishStatus.Result == PublishResultType.FailedPublishCancelledByEvent;