porting 7.6-rc1 into 8

This commit is contained in:
Stephan
2017-05-12 14:49:44 +02:00
parent ade6c2f057
commit 8561d85f7a
1148 changed files with 41983 additions and 17045 deletions

View File

@@ -1,9 +1,6 @@
using System;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.UI;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence;
@@ -20,14 +17,12 @@ namespace Umbraco.Web.UI.Controls
protected UmbracoControl(UmbracoContext umbracoContext, ServiceContext services, CacheHelper appCache)
{
if (umbracoContext == null) throw new ArgumentNullException(nameof(umbracoContext));
UmbracoContext = umbracoContext;
UmbracoContext = umbracoContext ?? throw new ArgumentNullException(nameof(umbracoContext));
Umbraco = new UmbracoHelper(umbracoContext, services, appCache);
// fixme inject somehow
Logger = Current.Logger;
ProfilingLogger = Current.ProfilingLogger;
DatabaseFactory = Current.DatabaseFactory;
Services = Current.Services;
}
@@ -58,11 +53,6 @@ namespace Umbraco.Web.UI.Controls
/// </summary>
public UmbracoContext UmbracoContext { get; }
/// <summary>
/// Gets the database context.
/// </summary>
protected IUmbracoDatabaseFactory DatabaseFactory { get; }
/// <summary>
/// Gets the services context.
/// </summary>
@@ -72,6 +62,6 @@ namespace Umbraco.Web.UI.Controls
/// Gets a Url helper.
/// </summary>
/// <remarks>This URL helper is created without any route data and an empty request context.</remarks>
public UrlHelper Url => _url ?? (_url = new UrlHelper(new RequestContext(new HttpContextWrapper(Context), new RouteData())));
public UrlHelper Url => _url ?? (_url = new UrlHelper(Context.Request.RequestContext));
}
}