Added logging in test

This commit is contained in:
Nikolaj Geisle
2021-10-14 14:07:31 +02:00
parent 7379387b2e
commit 76a8d4c474
3 changed files with 10 additions and 12 deletions

View File

@@ -65,7 +65,6 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
private readonly Lazy<IDictionary<string, ILanguage>> _allLangs;
private readonly ILogger<ContentController> _logger;
private readonly IScopeProvider _scopeProvider;
private readonly IUserDataService _userDataService;
public object Domains { get; private set; }
@@ -91,8 +90,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
ISqlContext sqlContext,
IJsonSerializer serializer,
IScopeProvider scopeProvider,
IAuthorizationService authorizationService,
IUserDataService userDataService)
IAuthorizationService authorizationService)
: base(cultureDictionary, loggerFactory, shortStringHelper, eventMessages, localizedTextService, serializer)
{
_propertyEditors = propertyEditors;
@@ -114,7 +112,6 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
_logger = loggerFactory.CreateLogger<ContentController>();
_scopeProvider = scopeProvider;
_allLangs = new Lazy<IDictionary<string, ILanguage>>(() => _localizationService.GetAllLanguages().ToDictionary(x => x.IsoCode, x => x, StringComparer.InvariantCultureIgnoreCase));
_userDataService = userDataService;
}
/// <summary>
@@ -1473,17 +1470,14 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
{
assignedDomains.UnionWith(_domainService.GetAssignedDomains(ancestorID, true));
}
foreach (var data in _userDataService.GetUserData())
{
_logger.LogWarning($"{data.Name} : {data.Data}");
}
// No domains at all, add a warning, to add domains.
if (assignedDomains.Count == 0)
{
globalNotifications.AddWarningNotification(
_localizedTextService.Localize("auditTrails", "publish"),
_localizedTextService.Localize("speechBubbles", "publishWithNoDomains"));
_logger.LogWarning("NOT REGISTRED DOMAIN FOR: {Cultures}");
_logger.LogWarning("The root node {RootNodeName} was published with multiple cultures, but no domains are configured, this will cause routing and caching issues, please register domains for: {Cultures}",
persistedContent.Name, string.Join(", ", publishedCultures));
return;