Merge remote-tracking branch 'origin/v8/dev' into netcore/dev

# Conflicts:
#	src/Umbraco.Core/Cache/MemberCacheRefresher.cs
#	src/Umbraco.Infrastructure/Compose/NotificationsComponent.cs
#	src/Umbraco.Infrastructure/Search/ExamineComponent.cs
#	src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs
#	src/Umbraco.Web/Security/MembershipHelper.cs
#	src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs
This commit is contained in:
Bjarke Berg
2020-09-23 12:54:13 +02:00
29 changed files with 1018 additions and 248 deletions

View File

@@ -53,32 +53,38 @@ namespace Umbraco.ModelsBuilder.Embedded.Compose
}
public void Terminate()
{ }
{
ServerVariablesParser.Parsing -= ServerVariablesParser_Parsing;
ContentModelBinder.ModelBindingException -= ContentModelBinder_ModelBindingException;
FileService.SavingTemplate -= FileService_SavingTemplate;
}
private void InstallServerVars()
{
// register our url - for the backoffice api
ServerVariablesParser.Parsing += (sender, serverVars) =>
{
if (!serverVars.ContainsKey("umbracoUrls"))
throw new ArgumentException("Missing umbracoUrls.");
var umbracoUrlsObject = serverVars["umbracoUrls"];
if (umbracoUrlsObject == null)
throw new ArgumentException("Null umbracoUrls");
if (!(umbracoUrlsObject is Dictionary<string, object> umbracoUrls))
throw new ArgumentException("Invalid umbracoUrls");
ServerVariablesParser.Parsing += ServerVariablesParser_Parsing;
}
if (!serverVars.ContainsKey("umbracoPlugins"))
throw new ArgumentException("Missing umbracoPlugins.");
if (!(serverVars["umbracoPlugins"] is Dictionary<string, object> umbracoPlugins))
throw new ArgumentException("Invalid umbracoPlugins");
private void ServerVariablesParser_Parsing(object sender, Dictionary<string, object> serverVars)
{
if (!serverVars.ContainsKey("umbracoUrls"))
throw new ArgumentException("Missing umbracoUrls.");
var umbracoUrlsObject = serverVars["umbracoUrls"];
if (umbracoUrlsObject == null)
throw new ArgumentException("Null umbracoUrls");
if (!(umbracoUrlsObject is Dictionary<string, object> umbracoUrls))
throw new ArgumentException("Invalid umbracoUrls");
if (HttpContext.Current == null) throw new InvalidOperationException("HttpContext is null");
var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData()));
if (!serverVars.ContainsKey("umbracoPlugins"))
throw new ArgumentException("Missing umbracoPlugins.");
if (!(serverVars["umbracoPlugins"] is Dictionary<string, object> umbracoPlugins))
throw new ArgumentException("Invalid umbracoPlugins");
umbracoUrls["modelsBuilderBaseUrl"] = urlHelper.GetUmbracoApiServiceBaseUrl<ModelsBuilderDashboardController>(controller => controller.BuildModels());
umbracoPlugins["modelsBuilder"] = GetModelsBuilderSettings();
};
if (HttpContext.Current == null) throw new InvalidOperationException("HttpContext is null");
var urlHelper = new UrlHelper(new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData()));
umbracoUrls["modelsBuilderBaseUrl"] = urlHelper.GetUmbracoApiServiceBaseUrl<ModelsBuilderDashboardController>(controller => controller.BuildModels());
umbracoPlugins["modelsBuilder"] = GetModelsBuilderSettings();
}
private Dictionary<string, object> GetModelsBuilderSettings()