Kill UmbracoContext.Current
This commit is contained in:
@@ -4,6 +4,7 @@ using HeyRed.MarkdownSharp;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Web.Composing;
|
||||
using Umbraco.Web.Templates;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors.ValueConverters
|
||||
@@ -26,7 +27,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
|
||||
var sourceString = source.ToString();
|
||||
|
||||
// ensures string is parsed for {localLink} and urls are resolved correctly
|
||||
sourceString = TemplateUtilities.ParseInternalLinks(sourceString, preview, UmbracoContext.Current);
|
||||
sourceString = TemplateUtilities.ParseInternalLinks(sourceString, preview, Current.UmbracoContext);
|
||||
sourceString = TemplateUtilities.ResolveUrlsFromTextString(sourceString);
|
||||
|
||||
return sourceString;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Web.Composing;
|
||||
using Umbraco.Web.PublishedCache;
|
||||
using Umbraco.Web.Security;
|
||||
|
||||
@@ -44,7 +45,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
|
||||
if (source == null)
|
||||
return null;
|
||||
|
||||
if (UmbracoContext.Current != null)
|
||||
if (Current.UmbracoContext != null)
|
||||
{
|
||||
IPublishedContent member;
|
||||
if (source is int id)
|
||||
|
||||
@@ -9,6 +9,7 @@ using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.PropertyEditors.ValueConverters;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Composing;
|
||||
using Umbraco.Web.PublishedCache;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors.ValueConverters
|
||||
@@ -67,7 +68,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
|
||||
}
|
||||
|
||||
// TODO: Inject an UmbracoHelper and create a GetUmbracoHelper method based on either injected or singleton
|
||||
if (UmbracoContext.Current != null)
|
||||
if (Current.UmbracoContext != null)
|
||||
{
|
||||
if (propertyType.EditorAlias.Equals(Constants.PropertyEditors.Aliases.MultiNodeTreePicker))
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Linq;
|
||||
using HtmlAgilityPack;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Composing;
|
||||
using Umbraco.Web.Macros;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors.ValueConverters
|
||||
@@ -72,7 +73,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
|
||||
var sourceString = source.ToString();
|
||||
|
||||
// ensures string is parsed for {localLink} and urls are resolved correctly
|
||||
sourceString = TemplateUtilities.ParseInternalLinks(sourceString, preview, UmbracoContext.Current);
|
||||
sourceString = TemplateUtilities.ParseInternalLinks(sourceString, preview, Current.UmbracoContext);
|
||||
sourceString = TemplateUtilities.ResolveUrlsFromTextString(sourceString);
|
||||
|
||||
// ensure string is parsed for macros and macros are executed correctly
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Web.Composing;
|
||||
using Umbraco.Web.Templates;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors.ValueConverters
|
||||
@@ -31,7 +32,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
|
||||
var sourceString = source.ToString();
|
||||
|
||||
// ensures string is parsed for {localLink} and urls are resolved correctly
|
||||
sourceString = TemplateUtilities.ParseInternalLinks(sourceString, preview, UmbracoContext.Current);
|
||||
sourceString = TemplateUtilities.ParseInternalLinks(sourceString, preview, Current.UmbracoContext);
|
||||
sourceString = TemplateUtilities.ResolveUrlsFromTextString(sourceString);
|
||||
|
||||
return sourceString;
|
||||
|
||||
Reference in New Issue
Block a user