Merge branch 'netcore/task/9727-published-request' into netcore/task/9733-routabledocumentfilter

This commit is contained in:
Shannon
2021-01-11 16:44:01 +11:00
42 changed files with 231 additions and 200 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
@@ -50,6 +50,7 @@ namespace Umbraco.Web.BackOffice.Controllers
// get cultures - new-ing instances to get proper display name,
// in the current culture, and not the cached one
// (see notes in Language class about culture info names)
// TODO: Fix this requirement, see https://github.com/umbraco/Umbraco-CMS/issues/3623
return CultureInfo.GetCultures(CultureTypes.AllCultures)
.Where(x => !x.Name.IsNullOrWhiteSpace())
.Select(x => new CultureInfo(x.Name)) // important!

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Umbraco.Core;
@@ -49,7 +50,7 @@ namespace Umbraco.Web.BackOffice.Controllers
_actionDescriptorCollectionProvider = actionDescriptorCollectionProvider;
}
public IEnumerable<Section> GetSections()
public async Task<IEnumerable<Section>> GetSections()
{
var sections = _sectionService.GetAllowedSections(_backofficeSecurityAccessor.BackOfficeSecurity.GetUserId().ResultOr(0));
@@ -74,7 +75,7 @@ namespace Umbraco.Web.BackOffice.Controllers
if (hasDashboards) continue;
// get the first tree in the section and get its root node route path
var sectionRoot = appTreeController.GetApplicationTrees(section.Alias, null, null).Result;
var sectionRoot = await appTreeController.GetApplicationTrees(section.Alias, null, null);
section.RoutePath = GetRoutePathForFirstTree(sectionRoot);
}

View File

@@ -212,7 +212,9 @@ namespace Umbraco.Web.BackOffice.Mapping
// NOTE: unfortunately we're not async, we'll use .Result and hope this won't cause a deadlock anywhere for now
var urls = source.GetContentUrlsAsync(_publishedRouter, umbracoContext, _localizationService, _localizedTextService, _contentService, _variationContextAccessor, _loggerFactory.CreateLogger<IContent>(), _uriUtility, _publishedUrlProvider)
.Result
.ConfigureAwait(false)
.GetAwaiter()
.GetResult()
.ToArray();
return urls;