New IMacroRenderer and ITemplateRenderer and hides underlying logic for these in internal classes. Massively cleans up the macro rendering logic (almost makes sense now), removes unused macro code, injects UmbracoHelper wherever it's needed (not creating manually), fixes UmbracoHelper to have it's services injected, no more empty services, allows setting the AssignedContentItem on the UmbracoHelper and ensures it's lifespan is Transient, updates all corresponding ctors. Fixes macro rendering, ensures the correct culture variation is assigned, and that we can render macros for any given IPublishedContent, not just the one assigned in the request.

This commit is contained in:
Shannon
2019-01-31 15:09:31 +11:00
parent 7f9ca716e7
commit 7b55d2f1b2
55 changed files with 457 additions and 778 deletions

View File

@@ -21,15 +21,19 @@ namespace Umbraco.Web
{
private UrlHelper _url;
protected UmbracoWebService()
protected UmbracoWebService(IProfilingLogger profilingLogger, UmbracoContext umbracoContext, UmbracoHelper umbraco, ServiceContext services, IGlobalSettings globalSettings)
{
UmbracoContext = Current.UmbracoContext;
Umbraco = new UmbracoHelper(UmbracoContext, Current.Services);
Logger = profilingLogger;
ProfilingLogger = profilingLogger;
UmbracoContext = umbracoContext;
Umbraco = umbraco;
Services = services;
GlobalSettings = globalSettings;
}
Logger = Current.Logger;
ProfilingLogger = Current.ProfilingLogger;
Services = Current.Services;
GlobalSettings = Current.Configs.Global();
protected UmbracoWebService()
: this(Current.ProfilingLogger, Current.UmbracoContext, Current.UmbracoHelper, Current.Services, Current.Configs.Global())
{
}
/// <summary>