Merge remote-tracking branch 'origin/temp8' into temp8-injection-ihttpcontextaccessor-instead-of-controller

This commit is contained in:
Bjarke Berg
2019-02-15 11:13:18 +01:00
5 changed files with 12 additions and 7 deletions

View File

@@ -293,7 +293,6 @@ namespace Umbraco.Core.Configuration
case LocalTempStorage.AspNetTemp:
return System.IO.Path.Combine(HttpRuntime.CodegenDir, "UmbracoData");
case LocalTempStorage.EnvironmentTemp:
// TODO: why has this to be repeated everywhere?!
// include the appdomain hash is just a safety check, for example if a website is moved from worker A to worker B and then back
// to worker A again, in theory the %temp% folder should already be empty but we really want to make sure that its not
// utilizing an old path - assuming we cannot have SHA1 collisions on AppDomainAppId

View File

@@ -21,6 +21,7 @@ namespace Umbraco.Tests.TestHelpers
settings.TimeOutInMinutes == 20 &&
settings.DefaultUILanguage == "en" &&
settings.LocalTempStorageLocation == LocalTempStorage.Default &&
settings.LocalTempPath == IOHelper.MapPath("~/App_Data/TEMP") &&
settings.ReservedPaths == (GlobalSettings.StaticReservedPaths + "~/umbraco") &&
settings.ReservedUrls == GlobalSettings.StaticReservedUrls);
return config;

View File

@@ -66,13 +66,13 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.CheckboxListContro
function changed(item) {
var index = _.findIndex($scope.model.value,
function (v) {
return v === item.value;
return v === item.val;
});
if (item.checked) {
//if it doesn't exist in the model, then add it
if (index < 0) {
$scope.model.value.push(item.value);
$scope.model.value.push(item.val);
}
}
else {

View File

@@ -1,4 +1,5 @@
using Umbraco.Core.Services;
using Umbraco.Core;
using Umbraco.Core.Services;
namespace Umbraco.Web.PublishedCache
{
@@ -8,17 +9,20 @@ namespace Umbraco.Web.PublishedCache
public class DefaultCultureAccessor : IDefaultCultureAccessor
{
private readonly ILocalizationService _localizationService;
private readonly RuntimeLevel _runtimeLevel;
/// <summary>
/// Initializes a new instance of the <see cref="DefaultCultureAccessor"/> class.
/// </summary>
/// <param name="localizationService"></param>
public DefaultCultureAccessor(ILocalizationService localizationService)
public DefaultCultureAccessor(ILocalizationService localizationService, IRuntimeState runtimeState)
{
_localizationService = localizationService;
_runtimeLevel = runtimeState.Level;
}
/// <inheritdoc />
public string DefaultCulture => _localizationService.GetDefaultLanguageIsoCode() ?? ""; // fast
public string DefaultCulture => _runtimeLevel == RuntimeLevel.Run
? _localizationService.GetDefaultLanguageIsoCode() ?? "" // fast
: "en-US"; // default for install and upgrade, when the service is n/a
}
}

View File

@@ -95,6 +95,7 @@ namespace Umbraco.Web
// ok, process
// TODO: should we move this to after we've ensured we are processing a routable page?
// ensure there's an UmbracoContext registered for the current request
// registers the context reference so its disposed at end of request
var umbracoContextReference = _umbracoContextFactory.EnsureUmbracoContext(httpContext);