diff --git a/src/Umbraco.Abstractions/StringExtensions.cs b/src/Umbraco.Abstractions/StringExtensions.cs
index 67c44c9793..d61c0a87ca 100644
--- a/src/Umbraco.Abstractions/StringExtensions.cs
+++ b/src/Umbraco.Abstractions/StringExtensions.cs
@@ -14,13 +14,11 @@ using Umbraco.Core.Strings;
namespace Umbraco.Core
{
-
///
/// String extension methods
///
public static class StringExtensions
{
-
private static readonly char[] ToCSharpHexDigitLower = "0123456789abcdef".ToCharArray();
private static readonly char[] ToCSharpEscapeChars;
@@ -72,13 +70,10 @@ namespace Umbraco.Core
return string.Format("{0}", fileName.Substring(0, fileName.IndexOf(ext, StringComparison.Ordinal)));
}
+
return fileName;
-
-
}
-
-
///
/// This tries to detect a json string, this is not a fail safe way but it is quicker than doing
/// a try/catch when deserializing when it is not json.
@@ -100,8 +95,6 @@ namespace Umbraco.Core
return JsonEmpties.Contains(Whitespace.Value.Replace(input, string.Empty));
}
-
-
public static string ReplaceNonAlphanumericChars(this string input, string replacement)
{
//any character that is not alphanumeric, convert to a hyphen
@@ -190,9 +183,6 @@ namespace Umbraco.Core
}
-
-
-
//this is from SqlMetal and just makes it a bit of fun to allow pluralization
public static string MakePluralName(this string name)
{
@@ -1232,7 +1222,7 @@ namespace Umbraco.Core
&& Path.GetPathRoot(path).Equals(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) == false;
}
- ///
+ ///
/// Based on the input string, this will detect if the string is a JS path or a JS snippet.
/// If a path cannot be determined, then it is assumed to be a snippet the original text is returned
/// with an invalid attempt, otherwise a valid attempt is returned with the resolved path
@@ -1277,77 +1267,83 @@ namespace Umbraco.Core
}
- // FORMAT STRINGS
+ // FORMAT STRINGS
- ///
- /// Cleans a string to produce a string that can safely be used in an alias.
- ///
- /// The text to filter.
- /// The safe alias.
- public static string ToSafeAlias(this string alias, IShortStringHelper shortStringHelper)
- {
- return shortStringHelper.CleanStringForSafeAlias(alias);
- }
+ ///
+ /// Cleans a string to produce a string that can safely be used in an alias.
+ ///
+ /// The text to filter.
+ /// The short string helper.
+ /// The safe alias.
+ public static string ToSafeAlias(this string alias, IShortStringHelper shortStringHelper)
+ {
+ return shortStringHelper.CleanStringForSafeAlias(alias);
+ }
- ///
- /// Cleans a string to produce a string that can safely be used in an alias.
- ///
- /// The text to filter.
- /// A value indicating that we want to camel-case the alias.
- /// The safe alias.
- public static string ToSafeAlias(this string alias, IShortStringHelper shortStringHelper, bool camel)
- {
- var a = shortStringHelper.CleanStringForSafeAlias(alias);
- if (string.IsNullOrWhiteSpace(a) || camel == false) return a;
- return char.ToLowerInvariant(a[0]) + a.Substring(1);
- }
+ ///
+ /// Cleans a string to produce a string that can safely be used in an alias.
+ ///
+ /// The text to filter.
+ /// A value indicating that we want to camel-case the alias.
+ /// The short string helper.
+ /// The safe alias.
+ public static string ToSafeAlias(this string alias, IShortStringHelper shortStringHelper, bool camel)
+ {
+ var a = shortStringHelper.CleanStringForSafeAlias(alias);
+ if (string.IsNullOrWhiteSpace(a) || camel == false) return a;
+ return char.ToLowerInvariant(a[0]) + a.Substring(1);
+ }
- ///
- /// Cleans a string, in the context of a specified culture, to produce a string that can safely be used in an alias.
- ///
- /// The text to filter.
- /// The culture.
- /// The safe alias.
- public static string ToSafeAlias(this string alias, IShortStringHelper shortStringHelper, string culture)
- {
- return shortStringHelper.CleanStringForSafeAlias(alias, culture);
- }
+ ///
+ /// Cleans a string, in the context of a specified culture, to produce a string that can safely be used in an alias.
+ ///
+ /// The text to filter.
+ /// The culture.
+ /// The short string helper.
+ /// The safe alias.
+ public static string ToSafeAlias(this string alias, IShortStringHelper shortStringHelper, string culture)
+ {
+ return shortStringHelper.CleanStringForSafeAlias(alias, culture);
+ }
- // the new methods to get a url segment
+ // the new methods to get a url segment
- ///
- /// Cleans a string to produce a string that can safely be used in an url segment.
- ///
- /// The text to filter.
- /// The safe url segment.
- public static string ToUrlSegment(this string text, IShortStringHelper shortStringHelper)
- {
- if (text == null) throw new ArgumentNullException(nameof(text));
- if (string.IsNullOrWhiteSpace(text)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(text));
+ ///
+ /// Cleans a string to produce a string that can safely be used in an url segment.
+ ///
+ /// The text to filter.
+ /// The short string helper.
+ /// The safe url segment.
+ public static string ToUrlSegment(this string text, IShortStringHelper shortStringHelper)
+ {
+ if (text == null) throw new ArgumentNullException(nameof(text));
+ if (string.IsNullOrWhiteSpace(text)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(text));
- return shortStringHelper.CleanStringForUrlSegment(text);
- }
+ return shortStringHelper.CleanStringForUrlSegment(text);
+ }
- ///
- /// Cleans a string, in the context of a specified culture, to produce a string that can safely be used in an url segment.
- ///
- /// The text to filter.
- /// The culture.
- /// The safe url segment.
- public static string ToUrlSegment(this string text, IShortStringHelper shortStringHelper, string culture)
- {
- if (text == null) throw new ArgumentNullException(nameof(text));
- if (string.IsNullOrWhiteSpace(text)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(text));
+ ///
+ /// Cleans a string, in the context of a specified culture, to produce a string that can safely be used in an url segment.
+ ///
+ /// The text to filter.
+ /// The short string helper.
+ /// The culture.
+ /// The safe url segment.
+ public static string ToUrlSegment(this string text, IShortStringHelper shortStringHelper, string culture)
+ {
+ if (text == null) throw new ArgumentNullException(nameof(text));
+ if (string.IsNullOrWhiteSpace(text)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(text));
- return shortStringHelper.CleanStringForUrlSegment(text, culture);
- }
+ return shortStringHelper.CleanStringForUrlSegment(text, culture);
+ }
- ///
+ ///
/// Cleans a string.
///
/// The text to clean.
+ /// The short string helper.
/// A flag indicating the target casing and encoding of the string. By default,
/// strings are cleaned up to camelCase and Ascii.
/// The clean string.
@@ -1361,6 +1357,7 @@ namespace Umbraco.Core
/// Cleans a string, using a specified separator.
///
/// The text to clean.
+ /// The short string helper.
/// A flag indicating the target casing and encoding of the string. By default,
/// strings are cleaned up to camelCase and Ascii.
/// The separator.
@@ -1375,6 +1372,7 @@ namespace Umbraco.Core
/// Cleans a string in the context of a specified culture.
///
/// The text to clean.
+ /// The short string helper.
/// A flag indicating the target casing and encoding of the string. By default,
/// strings are cleaned up to camelCase and Ascii.
/// The culture.
@@ -1388,6 +1386,7 @@ namespace Umbraco.Core
/// Cleans a string in the context of a specified culture, using a specified separator.
///
/// The text to clean.
+ /// The short string helper.
/// A flag indicating the target casing and encoding of the string. By default,
/// strings are cleaned up to camelCase and Ascii.
/// The separator.
diff --git a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs
index f6902d77b8..1699365dfd 100644
--- a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs
+++ b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs
@@ -1231,7 +1231,7 @@ namespace Umbraco.Core.Packaging
var name = prop.Element("Name")?.Value;
if (sp == null)
{
- sp = new StylesheetProperty(name, "#" + name.ToSafeAlias(_shortStringHelper), "");
+ sp = new StylesheetProperty(name, "#" + name.ToSafeAlias(_shortStringHelper), string.Empty);
s.AddProperty(sp);
}
else
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/DataEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/DataEditor.cs
index b0b12b8370..8ccb1680cc 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/DataEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/DataEditor.cs
@@ -25,7 +25,6 @@ namespace Umbraco.Core.PropertyEditors
private readonly IDataTypeService _dataTypeService;
private readonly ILocalizationService _localizationService;
private readonly ILocalizedTextService _localizedTextService;
- private readonly IShortStringHelper _shortStringHelper;
private IDictionary _defaultConfiguration;
private IDataValueEditor _dataValueEditor;
@@ -37,7 +36,7 @@ namespace Umbraco.Core.PropertyEditors
_dataTypeService = dataTypeService;
_localizationService = localizationService;
_localizedTextService = localizedTextService;
- _shortStringHelper = shortStringHelper;
+ ShortStringHelper = shortStringHelper ?? throw new ArgumentNullException(nameof(shortStringHelper));
Logger = logger ?? throw new ArgumentNullException(nameof(logger));
// defaults
@@ -62,6 +61,8 @@ namespace Umbraco.Core.PropertyEditors
///
protected DataEditorAttribute Attribute { get; }
+ protected IShortStringHelper ShortStringHelper { get; }
+
///
/// Gets a logger.
///
@@ -178,7 +179,7 @@ namespace Umbraco.Core.PropertyEditors
if (Attribute == null)
throw new InvalidOperationException($"The editor is not attributed with {nameof(DataEditorAttribute)}");
- return new DataValueEditor(_dataTypeService, _localizationService, _localizedTextService, _shortStringHelper, Attribute);
+ return new DataValueEditor(_dataTypeService, _localizationService, _localizedTextService, ShortStringHelper, Attribute);
}
///
diff --git a/src/Umbraco.ModelsBuilder.Embedded/Compose/ModelsBuilderComponent.cs b/src/Umbraco.ModelsBuilder.Embedded/Compose/ModelsBuilderComponent.cs
index 6847c45129..d856cae1e7 100644
--- a/src/Umbraco.ModelsBuilder.Embedded/Compose/ModelsBuilderComponent.cs
+++ b/src/Umbraco.ModelsBuilder.Embedded/Compose/ModelsBuilderComponent.cs
@@ -17,21 +17,20 @@ using Umbraco.Web.Mvc;
namespace Umbraco.ModelsBuilder.Embedded.Compose
{
-
internal class ModelsBuilderComponent : IComponent
{
-
private readonly IModelsBuilderConfig _config;
private readonly IShortStringHelper _shortStringHelper;
private readonly LiveModelsProvider _liveModelsProvider;
private readonly OutOfDateModelsStatus _outOfDateModels;
- public ModelsBuilderComponent(IModelsBuilderConfig config, IShortStringHelper shortStringHelper, LiveModelsProvider liveModelsProvider, OutOfDateModelsStatus outOfDateModels)
+ public ModelsBuilderComponent(IModelsBuilderConfig config, IShortStringHelper shortStringHelper, LiveModelsProvider liveModelsProvider, OutOfDateModelsStatus outOfDateModels)
{
_config = config;
_shortStringHelper = shortStringHelper;
_liveModelsProvider = liveModelsProvider;
_outOfDateModels = outOfDateModels;
+ _shortStringHelper = shortStringHelper;
}
public void Initialize()
diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs
index d644239777..a744a8d488 100644
--- a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs
+++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs
@@ -47,10 +47,6 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache
private readonly IEntityXmlSerializer _entitySerializer;
private readonly IHostingEnvironment _hostingEnvironment;
private readonly IShortStringHelper _shortStringHelper;
- private XmlStoreFilePersister _persisterTask;
- private volatile bool _released;
- private bool _withRepositoryEvents;
-
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
private readonly PublishedContentTypeCache _contentTypeCache;
private readonly RoutesCache _routesCache;
@@ -58,6 +54,10 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache
private readonly IContentService _contentService;
private readonly IScopeProvider _scopeProvider;
+ private XmlStoreFilePersister _persisterTask;
+ private volatile bool _released;
+ private bool _withRepositoryEvents;
+
#region Constructors
///
@@ -65,7 +65,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache
///
/// The default constructor will boot the cache, load data from file or database, /// wire events in order to manage changes, etc.
public XmlStore(IContentTypeService contentTypeService, IContentService contentService, IScopeProvider scopeProvider, RoutesCache routesCache, PublishedContentTypeCache contentTypeCache,
- IPublishedSnapshotAccessor publishedSnapshotAccessor, MainDom mainDom, IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository, IGlobalSettings globalSettings, IEntityXmlSerializer entitySerializer, IHostingEnvironment hostingEnvironment, IShortStringHelper shortStringHelper)
+ IPublishedSnapshotAccessor publishedSnapshotAccessor, MainDom mainDom, IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository, IGlobalSettings globalSettings, IEntityXmlSerializer entitySerializer, IHostingEnvironment hostingEnvironment, IShortStringHelper shortStringHelper)
: this(contentTypeService, contentService, scopeProvider, routesCache, contentTypeCache, publishedSnapshotAccessor, mainDom, false, false, documentRepository, mediaRepository, memberRepository, globalSettings, entitySerializer, hostingEnvironment, shortStringHelper)
{ }
@@ -74,7 +74,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache
// TODO: er, we DO have a DB?
internal XmlStore(IContentTypeService contentTypeService, IContentService contentService, IScopeProvider scopeProvider, RoutesCache routesCache, PublishedContentTypeCache contentTypeCache,
IPublishedSnapshotAccessor publishedSnapshotAccessor, MainDom mainDom,
- bool testing, bool enableRepositoryEvents, IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository, IGlobalSettings globalSettings, IEntityXmlSerializer entitySerializer, IHostingEnvironment hostingEnvironment, IShortStringHelper shortStringHelper)
+ bool testing, bool enableRepositoryEvents, IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository, IGlobalSettings globalSettings, IEntityXmlSerializer entitySerializer, IHostingEnvironment hostingEnvironment, IShortStringHelper shortStringHelper)
{
if (testing == false)
EnsureConfigurationIsValid();
diff --git a/src/Umbraco.Tests/Models/MediaXmlTest.cs b/src/Umbraco.Tests/Models/MediaXmlTest.cs
index 36961ebdd3..f312744db6 100644
--- a/src/Umbraco.Tests/Models/MediaXmlTest.cs
+++ b/src/Umbraco.Tests/Models/MediaXmlTest.cs
@@ -3,13 +3,12 @@ using System.Xml.Linq;
using Moq;
using NUnit.Framework;
using Umbraco.Core;
-using Umbraco.Core.Composing;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
-using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
+using Umbraco.Tests.Strings;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.TestHelpers.Entities;
using Umbraco.Tests.Testing;
@@ -21,8 +20,6 @@ namespace Umbraco.Tests.Models
[UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerFixture)]
public class MediaXmlTest : TestWithDatabaseBase
{
-
-
[Test]
public void Can_Generate_Xml_Representation_Of_Media()
{
@@ -39,7 +36,7 @@ namespace Umbraco.Tests.Models
var localizationService = Mock.Of();
var mediaFileSystem = new MediaFileSystem(Mock.Of(), scheme, logger, ShortStringHelper);
- var ignored = new FileUploadPropertyEditor(Mock.Of(), mediaFileSystem, config, dataTypeService, localizationService);
+ var ignored = new FileUploadPropertyEditor(Mock.Of(), mediaFileSystem, config, dataTypeService, localizationService, ShortStringHelper);
var media = MockedMedia.CreateMediaImage(mediaType, -1);
media.WriterId = -1; // else it's zero and that's not a user and it breaks the tests
diff --git a/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs
index a5b4372283..069d93f409 100644
--- a/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs
+++ b/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs
@@ -36,9 +36,9 @@ namespace Umbraco.Tests.Persistence.Repositories
using (provider.CreateScope())
{
var dtRepo = CreateRepository();
- IDataType dataType1 = new DataType(new RadioButtonsPropertyEditor(Logger, ServiceContext.TextService, IOHelper)) { Name = "dt1" };
+ IDataType dataType1 = new DataType(new RadioButtonsPropertyEditor(Logger, ServiceContext.TextService, IOHelper, ShortStringHelper)) { Name = "dt1" };
dtRepo.Save(dataType1);
- IDataType dataType2 = new DataType(new RadioButtonsPropertyEditor(Logger, ServiceContext.TextService, IOHelper)) { Name = "dt2" };
+ IDataType dataType2 = new DataType(new RadioButtonsPropertyEditor(Logger, ServiceContext.TextService, IOHelper, ShortStringHelper)) { Name = "dt2" };
dtRepo.Save(dataType2);
var ctRepo = Factory.GetInstance();
@@ -106,14 +106,14 @@ namespace Umbraco.Tests.Persistence.Repositories
var container2 = new EntityContainer(Constants.ObjectTypes.DataType) { Name = "blah2", ParentId = container1.Id };
containerRepository.Save(container2);
- var dataType = (IDataType) new DataType(new RadioButtonsPropertyEditor(Logger, ServiceContext.TextService, IOHelper), container2.Id)
+ var dataType = (IDataType) new DataType(new RadioButtonsPropertyEditor(Logger, ServiceContext.TextService, IOHelper, ShortStringHelper), container2.Id)
{
Name = "dt1"
};
repository.Save(dataType);
//create a
- var dataType2 = (IDataType)new DataType(new RadioButtonsPropertyEditor(Logger, ServiceContext.TextService, IOHelper), dataType.Id)
+ var dataType2 = (IDataType)new DataType(new RadioButtonsPropertyEditor(Logger, ServiceContext.TextService, IOHelper, ShortStringHelper), dataType.Id)
{
Name = "dt2"
};
@@ -185,7 +185,7 @@ namespace Umbraco.Tests.Persistence.Repositories
var container = new EntityContainer(Constants.ObjectTypes.DataType) { Name = "blah" };
containerRepository.Save(container);
- var dataTypeDefinition = new DataType(new RadioButtonsPropertyEditor(Logger, ServiceContext.TextService, IOHelper), container.Id) { Name = "test" };
+ var dataTypeDefinition = new DataType(new RadioButtonsPropertyEditor(Logger, ServiceContext.TextService, IOHelper, ShortStringHelper), container.Id) { Name = "test" };
repository.Save(dataTypeDefinition);
Assert.AreEqual(container.Id, dataTypeDefinition.ParentId);
@@ -205,7 +205,7 @@ namespace Umbraco.Tests.Persistence.Repositories
var container = new EntityContainer(Constants.ObjectTypes.DataType) { Name = "blah" };
containerRepository.Save(container);
- IDataType dataType = new DataType(new RadioButtonsPropertyEditor(Logger, ServiceContext.TextService, IOHelper), container.Id) { Name = "test" };
+ IDataType dataType = new DataType(new RadioButtonsPropertyEditor(Logger, ServiceContext.TextService, IOHelper, ShortStringHelper), container.Id) { Name = "test" };
repository.Save(dataType);
// Act
@@ -228,7 +228,7 @@ namespace Umbraco.Tests.Persistence.Repositories
using (provider.CreateScope())
{
var repository = CreateRepository();
- IDataType dataType = new DataType(new RadioButtonsPropertyEditor(Logger, ServiceContext.TextService, IOHelper)) {Name = "test"};
+ IDataType dataType = new DataType(new RadioButtonsPropertyEditor(Logger, ServiceContext.TextService, IOHelper, ShortStringHelper)) {Name = "test"};
repository.Save(dataType);
diff --git a/src/Umbraco.Tests/Persistence/Repositories/DocumentRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/DocumentRepositoryTest.cs
index 5c97bdf034..17a01b128a 100644
--- a/src/Umbraco.Tests/Persistence/Repositories/DocumentRepositoryTest.cs
+++ b/src/Umbraco.Tests/Persistence/Repositories/DocumentRepositoryTest.cs
@@ -359,7 +359,7 @@ namespace Umbraco.Tests.Persistence.Repositories
{
var repository = CreateRepository((IScopeAccessor)provider, out var contentTypeRepository, out DataTypeRepository dataTypeDefinitionRepository);
- var editor = new DecimalPropertyEditor(Logger);
+ var editor = new DecimalPropertyEditor(Logger, ShortStringHelper);
var dtd = new DataType(editor) { Name = "test", DatabaseType = ValueStorageType.Decimal };
dataTypeDefinitionRepository.Save(dtd);
diff --git a/src/Umbraco.Tests/PublishedContent/NuCacheChildrenTests.cs b/src/Umbraco.Tests/PublishedContent/NuCacheChildrenTests.cs
index 943125bd21..2f10b23f5a 100644
--- a/src/Umbraco.Tests/PublishedContent/NuCacheChildrenTests.cs
+++ b/src/Umbraco.Tests/PublishedContent/NuCacheChildrenTests.cs
@@ -1,9 +1,7 @@
using System;
-using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data;
using System.Linq;
-using System.Reflection;
using Moq;
using NUnit.Framework;
using Umbraco.Core;
@@ -11,7 +9,6 @@ using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Events;
using Umbraco.Core.Hosting;
-using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
@@ -21,6 +18,7 @@ using Umbraco.Core.Scoping;
using Umbraco.Core.Services;
using Umbraco.Core.Services.Changes;
using Umbraco.Core.Strings;
+using Umbraco.Tests.Strings;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.Testing.Objects;
using Umbraco.Tests.Testing.Objects.Accessors;
@@ -29,7 +27,6 @@ using Umbraco.Web.Cache;
using Umbraco.Web.PublishedCache;
using Umbraco.Web.PublishedCache.NuCache;
using Umbraco.Web.PublishedCache.NuCache.DataSource;
-using Umbraco.Web.PublishedCache.NuCache.Snap;
namespace Umbraco.Tests.PublishedContent
{
@@ -166,7 +163,8 @@ namespace Umbraco.Tests.PublishedContent
Mock.Of(),
new UrlSegmentProviderCollection(new[] { new DefaultUrlSegmentProvider(TestHelper.ShortStringHelper) }),
typeFinder,
- hostingEnvironment);
+ hostingEnvironment,
+ new MockShortStringHelper());
// invariant is the current default
_variationAccesor.VariationContext = new VariationContext();
diff --git a/src/Umbraco.Tests/PublishedContent/NuCacheTests.cs b/src/Umbraco.Tests/PublishedContent/NuCacheTests.cs
index 92c0d697fb..c0ed53d281 100644
--- a/src/Umbraco.Tests/PublishedContent/NuCacheTests.cs
+++ b/src/Umbraco.Tests/PublishedContent/NuCacheTests.cs
@@ -8,7 +8,6 @@ using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Events;
-using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
@@ -18,6 +17,7 @@ using Umbraco.Core.Scoping;
using Umbraco.Core.Services;
using Umbraco.Core.Services.Changes;
using Umbraco.Core.Strings;
+using Umbraco.Tests.Strings;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.Testing.Objects;
using Umbraco.Tests.Testing.Objects.Accessors;
@@ -206,7 +206,8 @@ namespace Umbraco.Tests.PublishedContent
Mock.Of(),
new UrlSegmentProviderCollection(new[] { new DefaultUrlSegmentProvider(TestHelper.ShortStringHelper) }),
typeFinder,
- TestHelper.GetHostingEnvironment());
+ TestHelper.GetHostingEnvironment(),
+ new MockShortStringHelper());
// invariant is the current default
_variationAccesor.VariationContext = new VariationContext();
diff --git a/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs b/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs
index 58e13583ca..7bf520b0cf 100644
--- a/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs
+++ b/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs
@@ -149,16 +149,16 @@ namespace Umbraco.Tests.Routing
ContentTypesCache.GetPublishedContentTypeByAlias = alias => type;
var handler = new RenderRouteHandler(umbracoContext, new TestControllerFactory(umbracoContextAccessor, Mock.Of(), context =>
- {
- var membershipHelper = new MembershipHelper(
- umbracoContext.HttpContext, Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), AppCaches.Disabled, Mock.Of());
- return new CustomDocumentController(Factory.GetInstance(),
- umbracoContextAccessor,
- Factory.GetInstance(),
- Factory.GetInstance(),
- Factory.GetInstance(),
- new UmbracoHelper(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), membershipHelper));
- }), ShortStringHelper);
+ {
+ var membershipHelper = new MembershipHelper(
+ umbracoContext.HttpContext, Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), AppCaches.Disabled, Mock.Of(), ShortStringHelper);
+ return new CustomDocumentController(Factory.GetInstance(),
+ umbracoContextAccessor,
+ Factory.GetInstance(),
+ Factory.GetInstance(),
+ Factory.GetInstance(),
+ new UmbracoHelper(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), membershipHelper));
+ }), ShortStringHelper);
handler.GetHandlerForRoute(umbracoContext.HttpContext.Request.RequestContext, frequest);
Assert.AreEqual("CustomDocument", routeData.Values["controller"].ToString());
diff --git a/src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs b/src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs
index 22afd913fb..73f8f38d6c 100644
--- a/src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs
+++ b/src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs
@@ -14,11 +14,11 @@ using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Persistence.Repositories;
-using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
using Umbraco.Core.Services.Implement;
using Umbraco.Core.Strings;
using Umbraco.Core.Sync;
+using Umbraco.Tests.Strings;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.Testing;
using Umbraco.Tests.Testing.Objects.Accessors;
@@ -104,7 +104,8 @@ namespace Umbraco.Tests.Scoping
Mock.Of(),
new UrlSegmentProviderCollection(new[] { new DefaultUrlSegmentProvider(ShortStringHelper) }),
typeFinder,
- hostingEnvironment);
+ hostingEnvironment,
+ new MockShortStringHelper());
}
protected UmbracoContext GetUmbracoContextNu(string url, int templateId = 1234, RouteData routeData = null, bool setSingleton = false, IUmbracoSettingsSection umbracoSettings = null, IEnumerable urlProviders = null)
diff --git a/src/Umbraco.Tests/Services/ContentTypeServiceVariantsTests.cs b/src/Umbraco.Tests/Services/ContentTypeServiceVariantsTests.cs
index 0f66b6e273..0f1b1fed32 100644
--- a/src/Umbraco.Tests/Services/ContentTypeServiceVariantsTests.cs
+++ b/src/Umbraco.Tests/Services/ContentTypeServiceVariantsTests.cs
@@ -15,10 +15,10 @@ using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.Dtos;
using Umbraco.Core.Persistence.Repositories;
-using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using Umbraco.Core.Sync;
+using Umbraco.Tests.Strings;
using Umbraco.Tests.TestHelpers.Entities;
using Umbraco.Tests.Testing;
using Umbraco.Web.PublishedCache;
@@ -78,7 +78,8 @@ namespace Umbraco.Tests.Services
Mock.Of(),
new UrlSegmentProviderCollection(new[] { new DefaultUrlSegmentProvider(ShortStringHelper) }),
typeFinder,
- hostingEnvironment);
+ hostingEnvironment,
+ new MockShortStringHelper());
}
public class LocalServerMessenger : ServerMessengerBase
diff --git a/src/Umbraco.Tests/Strings/MockShortStringHelper.cs b/src/Umbraco.Tests/Strings/MockShortStringHelper.cs
index a39f962908..1cc959414d 100644
--- a/src/Umbraco.Tests/Strings/MockShortStringHelper.cs
+++ b/src/Umbraco.Tests/Strings/MockShortStringHelper.cs
@@ -1,5 +1,4 @@
-using System.Collections.Generic;
-using Umbraco.Core.Strings;
+using Umbraco.Core.Strings;
namespace Umbraco.Tests.Strings
{
diff --git a/src/Umbraco.Tests/Strings/StringExtensionsTests.cs b/src/Umbraco.Tests/Strings/StringExtensionsTests.cs
index e89607250b..fa00539e57 100644
--- a/src/Umbraco.Tests/Strings/StringExtensionsTests.cs
+++ b/src/Umbraco.Tests/Strings/StringExtensionsTests.cs
@@ -16,18 +16,7 @@ namespace Umbraco.Tests.Strings
[TestFixture]
public class StringExtensionsTests : UmbracoTestBase
{
- protected override void Compose()
- {
- base.Compose();
- Composition.RegisterUnique(_ => new MockShortStringHelper());
- }
-
- [Test]
- public void CurrentHelper()
- {
- var helper = Current.ShortStringHelper;
- Assert.IsInstanceOf(helper);
- }
+ private readonly IShortStringHelper _mockShortStringHelper = new MockShortStringHelper();
[TestCase("hello-world.png", "Hello World")]
[TestCase("hello-world .png", "Hello World")]
@@ -228,77 +217,77 @@ namespace Umbraco.Tests.Strings
[Test]
public void ToUrlAlias()
{
- var output = "JUST-ANYTHING".ToUrlSegment(ShortStringHelper);
+ var output = "JUST-ANYTHING".ToUrlSegment(_mockShortStringHelper);
Assert.AreEqual("URL-SEGMENT::JUST-ANYTHING", output);
}
[Test]
public void FormatUrl()
{
- var output = "JUST-ANYTHING".ToUrlSegment(ShortStringHelper);
+ var output = "JUST-ANYTHING".ToUrlSegment(_mockShortStringHelper);
Assert.AreEqual("URL-SEGMENT::JUST-ANYTHING", output);
}
[Test]
public void ToUmbracoAlias()
{
- var output = "JUST-ANYTHING".ToSafeAlias(ShortStringHelper);
+ var output = "JUST-ANYTHING".ToSafeAlias(_mockShortStringHelper);
Assert.AreEqual("SAFE-ALIAS::JUST-ANYTHING", output);
}
[Test]
public void ToSafeAlias()
{
- var output = "JUST-ANYTHING".ToSafeAlias(ShortStringHelper);
+ var output = "JUST-ANYTHING".ToSafeAlias(_mockShortStringHelper);
Assert.AreEqual("SAFE-ALIAS::JUST-ANYTHING", output);
}
[Test]
public void ToSafeAliasWithCulture()
{
- var output = "JUST-ANYTHING".ToSafeAlias(ShortStringHelper, (string)null);
+ var output = "JUST-ANYTHING".ToSafeAlias(_mockShortStringHelper, (string)null);
Assert.AreEqual("SAFE-ALIAS-CULTURE::JUST-ANYTHING", output);
}
[Test]
public void ToUrlSegment()
{
- var output = "JUST-ANYTHING".ToUrlSegment(ShortStringHelper);
+ var output = "JUST-ANYTHING".ToUrlSegment(_mockShortStringHelper);
Assert.AreEqual("URL-SEGMENT::JUST-ANYTHING", output);
}
[Test]
public void ToUrlSegmentWithCulture()
{
- var output = "JUST-ANYTHING".ToUrlSegment(ShortStringHelper, (string)null);
+ var output = "JUST-ANYTHING".ToUrlSegment(_mockShortStringHelper, (string)null);
Assert.AreEqual("URL-SEGMENT-CULTURE::JUST-ANYTHING", output);
}
[Test]
public void ToSafeFileName()
{
- var output = "JUST-ANYTHING".ToSafeFileName(ShortStringHelper);
+ var output = "JUST-ANYTHING".ToSafeFileName(_mockShortStringHelper);
Assert.AreEqual("SAFE-FILE-NAME::JUST-ANYTHING", output);
}
[Test]
public void ToSafeFileNameWithCulture()
{
- var output = "JUST-ANYTHING".ToSafeFileName(ShortStringHelper, null);
+ var output = "JUST-ANYTHING".ToSafeFileName(_mockShortStringHelper, null);
Assert.AreEqual("SAFE-FILE-NAME-CULTURE::JUST-ANYTHING", output);
}
[Test]
public void ConvertCase()
{
- var output = "JUST-ANYTHING".ToCleanString(ShortStringHelper, CleanStringType.Unchanged);
+ var output = "JUST-ANYTHING".ToCleanString(_mockShortStringHelper, CleanStringType.Unchanged);
Assert.AreEqual("CLEAN-STRING-A::JUST-ANYTHING", output);
}
[Test]
public void SplitPascalCasing()
{
- var output = "JUST-ANYTHING".SplitPascalCasing(ShortStringHelper);
+ var output = "JUST-ANYTHING".SplitPascalCasing(_mockShortStringHelper);
Assert.AreEqual("SPLIT-PASCAL-CASING::JUST-ANYTHING", output);
}
diff --git a/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs b/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs
index fdc2e6a5bd..cf6438b673 100644
--- a/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs
+++ b/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs
@@ -23,6 +23,7 @@ using Umbraco.Web.WebApi;
using Umbraco.Core.Logging;
using Umbraco.Tests.Testing.Objects.Accessors;
using Umbraco.Web.Security.Providers;
+using Umbraco.Tests.Strings;
namespace Umbraco.Tests.TestHelpers.ControllerTesting
{
@@ -152,7 +153,7 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting
urlHelper.Setup(provider => provider.GetUrl(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()))
.Returns(UrlInfo.Url("/hello/world/1234"));
- var membershipHelper = new MembershipHelper(umbCtx.HttpContext, Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), AppCaches.Disabled, Mock.Of());
+ var membershipHelper = new MembershipHelper(umbCtx.HttpContext, Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), AppCaches.Disabled, Mock.Of(), new MockShortStringHelper());
var umbHelper = new UmbracoHelper(Mock.Of(),
Mock.Of(),
diff --git a/src/Umbraco.Tests/Testing/TestingTests/MockTests.cs b/src/Umbraco.Tests/Testing/TestingTests/MockTests.cs
index 1b1d3172d3..52e86b36db 100644
--- a/src/Umbraco.Tests/Testing/TestingTests/MockTests.cs
+++ b/src/Umbraco.Tests/Testing/TestingTests/MockTests.cs
@@ -71,7 +71,7 @@ namespace Umbraco.Tests.Testing.TestingTests
Mock.Of(),
Mock.Of(),
Mock.Of(),
- new MembershipHelper(umbracoContext.HttpContext, Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), AppCaches.Disabled, Mock.Of()));
+ new MembershipHelper(umbracoContext.HttpContext, Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), AppCaches.Disabled, Mock.Of(), ShortStringHelper));
Assert.Pass();
}
@@ -103,7 +103,7 @@ namespace Umbraco.Tests.Testing.TestingTests
var memberService = Mock.Of();
var memberTypeService = Mock.Of();
var membershipProvider = new MembersMembershipProvider(memberService, memberTypeService, Mock.Of(), TestHelper.GetHostingEnvironment(), TestHelper.GetIpResolver());
- var membershipHelper = new MembershipHelper(umbracoContext.HttpContext, Mock.Of(), membershipProvider, Mock.Of(), memberService, memberTypeService, Mock.Of(), AppCaches.Disabled, logger);
+ var membershipHelper = new MembershipHelper(umbracoContext.HttpContext, Mock.Of(), membershipProvider, Mock.Of(), memberService, memberTypeService, Mock.Of(), AppCaches.Disabled, logger, ShortStringHelper);
var umbracoHelper = new UmbracoHelper(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), membershipHelper);
var umbracoMapper = new UmbracoMapper(new MapDefinitionCollection(new[] { Mock.Of() }));
diff --git a/src/Umbraco.Tests/Web/Controllers/ContentControllerTests.cs b/src/Umbraco.Tests/Web/Controllers/ContentControllerTests.cs
index 9e6068373f..b71624a12e 100644
--- a/src/Umbraco.Tests/Web/Controllers/ContentControllerTests.cs
+++ b/src/Umbraco.Tests/Web/Controllers/ContentControllerTests.cs
@@ -1,4 +1,6 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
using System.Linq;
using System.Net;
using System.Net.Http;
@@ -8,32 +10,31 @@ using Moq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NUnit.Framework;
+using Umbraco.Core;
+using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
+using Umbraco.Core.Configuration;
+using Umbraco.Core.Dictionary;
+using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Entities;
using Umbraco.Core.Models.Membership;
+using Umbraco.Core.Persistence;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.TestHelpers.ControllerTesting;
using Umbraco.Tests.TestHelpers.Entities;
using Umbraco.Tests.Testing;
using Umbraco.Web;
+using Umbraco.Web.Actions;
using Umbraco.Web.Editors;
using Umbraco.Web.Models.ContentEditing;
-using Task = System.Threading.Tasks.Task;
-using Umbraco.Core.Dictionary;
using Umbraco.Web.PropertyEditors;
-using System;
-using Umbraco.Web.WebApi;
using Umbraco.Web.Trees;
-using System.Globalization;
-using Umbraco.Core;
-using Umbraco.Core.Cache;
-using Umbraco.Core.Configuration;
-using Umbraco.Core.Logging;
-using Umbraco.Core.Persistence;
-using Umbraco.Web.Actions;
+using Umbraco.Web.WebApi;
+using Task = System.Threading.Tasks.Task;
namespace Umbraco.Tests.Web.Controllers
{
diff --git a/src/Umbraco.Tests/Web/Controllers/UsersControllerTests.cs b/src/Umbraco.Tests/Web/Controllers/UsersControllerTests.cs
index bfd1f10233..ccb25b1b9a 100644
--- a/src/Umbraco.Tests/Web/Controllers/UsersControllerTests.cs
+++ b/src/Umbraco.Tests/Web/Controllers/UsersControllerTests.cs
@@ -24,6 +24,7 @@ using Umbraco.Core.Persistence.Mappers;
using Umbraco.Core.Persistence.Querying;
using Umbraco.Core.Persistence.SqlSyntax;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.TestHelpers.ControllerTesting;
using Umbraco.Tests.TestHelpers.Entities;
@@ -87,8 +88,7 @@ namespace Umbraco.Tests.Web.Controllers
Factory.GetInstance(),
helper,
Factory.GetInstance(),
- ShortStringHelper
- );
+ ShortStringHelper);
return usersController;
}
diff --git a/src/Umbraco.Tests/Web/Mvc/SurfaceControllerTests.cs b/src/Umbraco.Tests/Web/Mvc/SurfaceControllerTests.cs
index 4299b57e07..0660564a52 100644
--- a/src/Umbraco.Tests/Web/Mvc/SurfaceControllerTests.cs
+++ b/src/Umbraco.Tests/Web/Mvc/SurfaceControllerTests.cs
@@ -124,7 +124,7 @@ namespace Umbraco.Tests.Web.Mvc
Mock.Of(),
Mock.Of(),
Mock.Of(query => query.Content(2) == content.Object),
- new MembershipHelper(umbracoContext.HttpContext, Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), AppCaches.Disabled, Mock.Of()));
+ new MembershipHelper(umbracoContext.HttpContext, Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), AppCaches.Disabled, Mock.Of(), ShortStringHelper));
var ctrl = new TestSurfaceController(umbracoContextAccessor, helper);
var result = ctrl.GetContent(2) as PublishedContentResult;
diff --git a/src/Umbraco.Web/Editors/BackOfficeNotificationsController.cs b/src/Umbraco.Web/Editors/BackOfficeNotificationsController.cs
index aebd13b6c4..24548a8089 100644
--- a/src/Umbraco.Web/Editors/BackOfficeNotificationsController.cs
+++ b/src/Umbraco.Web/Editors/BackOfficeNotificationsController.cs
@@ -4,6 +4,7 @@ using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.WebApi;
using Umbraco.Web.WebApi.Filters;
@@ -18,8 +19,8 @@ namespace Umbraco.Web.Editors
[PrefixlessBodyModelValidator]
public abstract class BackOfficeNotificationsController : UmbracoAuthorizedJsonController
{
- protected BackOfficeNotificationsController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper)
- : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ protected BackOfficeNotificationsController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper)
+ : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
}
}
diff --git a/src/Umbraco.Web/Editors/Binders/MemberBinder.cs b/src/Umbraco.Web/Editors/Binders/MemberBinder.cs
index 63bf0f0473..c63e2c13a6 100644
--- a/src/Umbraco.Web/Editors/Binders/MemberBinder.cs
+++ b/src/Umbraco.Web/Editors/Binders/MemberBinder.cs
@@ -5,6 +5,7 @@ using System.Web.Http.ModelBinding;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Models.ContentEditing;
using System.Linq;
using Umbraco.Web.Composing;
@@ -17,15 +18,17 @@ namespace Umbraco.Web.Editors.Binders
internal class MemberBinder : IModelBinder
{
private readonly ContentModelBinderHelper _modelBinderHelper;
+ private readonly IShortStringHelper _shortStringHelper;
private readonly ServiceContext _services;
- public MemberBinder() : this(Current.Services)
+ public MemberBinder() : this(Current.Services, Current.ShortStringHelper)
{
}
- public MemberBinder(ServiceContext services)
+ public MemberBinder(ServiceContext services, IShortStringHelper shortStringHelper)
{
- _services = services;
+ _services = services ?? throw new ArgumentNullException(nameof(services));
+ _shortStringHelper = shortStringHelper ?? throw new ArgumentNullException(nameof(shortStringHelper));
_modelBinderHelper = new ContentModelBinderHelper();
}
@@ -107,7 +110,7 @@ namespace Umbraco.Web.Editors.Binders
///
private void FilterMembershipProviderProperties(IContentTypeBase contentType)
{
- var defaultProps = ConventionsHelper.GetStandardPropertyTypeStubs(Current.ShortStringHelper);
+ var defaultProps = ConventionsHelper.GetStandardPropertyTypeStubs(_shortStringHelper);
//remove all membership properties, these values are set with the membership provider.
var exclude = defaultProps.Select(x => x.Value.Alias).ToArray();
FilterContentTypeProperties(contentType, exclude);
diff --git a/src/Umbraco.Web/Editors/CodeFileController.cs b/src/Umbraco.Web/Editors/CodeFileController.cs
index ecf0c94483..96a99830d6 100644
--- a/src/Umbraco.Web/Editors/CodeFileController.cs
+++ b/src/Umbraco.Web/Editors/CodeFileController.cs
@@ -34,8 +34,6 @@ namespace Umbraco.Web.Editors
[UmbracoApplicationAuthorize(Core.Constants.Applications.Settings)]
public class CodeFileController : BackOfficeNotificationsController
{
- private readonly IShortStringHelper _shortStringHelper;
-
public CodeFileController(
IGlobalSettings globalSettings,
IUmbracoContextAccessor umbracoContextAccessor,
@@ -46,9 +44,9 @@ namespace Umbraco.Web.Editors
IRuntimeState runtimeState,
UmbracoHelper umbracoHelper,
IShortStringHelper shortStringHelper)
- : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
+
{
- _shortStringHelper = shortStringHelper;
}
///
@@ -242,7 +240,7 @@ namespace Umbraco.Web.Editors
throw new HttpResponseException(HttpStatusCode.NotFound);
}
- return snippets.Select(snippet => new SnippetDisplay() {Name = snippet.SplitPascalCasing(_shortStringHelper).ToFirstUpperInvariant(), FileName = snippet});
+ return snippets.Select(snippet => new SnippetDisplay() {Name = snippet.SplitPascalCasing(ShortStringHelper).ToFirstUpperInvariant(), FileName = snippet});
}
///
diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs
index b4e5064737..952a924adb 100644
--- a/src/Umbraco.Web/Editors/ContentController.cs
+++ b/src/Umbraco.Web/Editors/ContentController.cs
@@ -11,31 +11,32 @@ using System.Web.Http.ModelBinding;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;
+using Umbraco.Core.Dictionary;
+using Umbraco.Core.Events;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
-using Umbraco.Core.Models.Membership;
-using Umbraco.Core.Services;
-using Umbraco.Web.Models.ContentEditing;
-using Umbraco.Web.Models.Mapping;
-using Umbraco.Web.Mvc;
-using Umbraco.Web.WebApi;
-using Umbraco.Web.WebApi.Filters;
-using Umbraco.Core.Persistence.Querying;
-using Umbraco.Core.Events;
using Umbraco.Core.Models.ContentEditing;
+using Umbraco.Core.Models.Entities;
+using Umbraco.Core.Models.Membership;
using Umbraco.Core.Models.Validation;
-using Umbraco.Web.Composing;
+using Umbraco.Core.Persistence;
+using Umbraco.Core.Persistence.Querying;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Security;
+using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Actions;
+using Umbraco.Web.Composing;
using Umbraco.Web.ContentApps;
using Umbraco.Web.Editors.Binders;
using Umbraco.Web.Editors.Filters;
-using Umbraco.Core.Models.Entities;
-using Umbraco.Core.Persistence;
-using Umbraco.Core.Security;
+using Umbraco.Web.Models.ContentEditing;
+using Umbraco.Web.Models.Mapping;
+using Umbraco.Web.Mvc;
using Umbraco.Web.Routing;
+using Umbraco.Web.WebApi;
+using Umbraco.Web.WebApi.Filters;
using Constants = Umbraco.Core.Constants;
-using Umbraco.Core.Dictionary;
using Umbraco.Core.Strings;
namespace Umbraco.Web.Editors
diff --git a/src/Umbraco.Web/Editors/ContentControllerBase.cs b/src/Umbraco.Web/Editors/ContentControllerBase.cs
index 10dc95cc68..4f9e41eeb0 100644
--- a/src/Umbraco.Web/Editors/ContentControllerBase.cs
+++ b/src/Umbraco.Web/Editors/ContentControllerBase.cs
@@ -19,7 +19,6 @@ using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.WebApi;
using Umbraco.Web.WebApi.Filters;
-
namespace Umbraco.Web.Editors
{
///
@@ -29,7 +28,6 @@ namespace Umbraco.Web.Editors
public abstract class ContentControllerBase : BackOfficeNotificationsController
{
protected ICultureDictionary CultureDictionary { get; }
- public IShortStringHelper ShortStringHelper { get; }
protected ContentControllerBase(
ICultureDictionary cultureDictionary,
@@ -42,10 +40,9 @@ namespace Umbraco.Web.Editors
IRuntimeState runtimeState,
UmbracoHelper umbracoHelper,
IShortStringHelper shortStringHelper)
- : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ :base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
CultureDictionary = cultureDictionary;
- ShortStringHelper = shortStringHelper;
}
protected HttpResponseMessage HandleContentNotFound(object id, bool throwException = true)
diff --git a/src/Umbraco.Web/Editors/ContentTypeController.cs b/src/Umbraco.Web/Editors/ContentTypeController.cs
index 4563a51afb..e64485e5ab 100644
--- a/src/Umbraco.Web/Editors/ContentTypeController.cs
+++ b/src/Umbraco.Web/Editors/ContentTypeController.cs
@@ -14,11 +14,9 @@ using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Dictionary;
-using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Editors;
-using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Packaging;
using Umbraco.Core.Persistence;
using Umbraco.Core.PropertyEditors;
@@ -52,7 +50,6 @@ namespace Umbraco.Web.Editors
private readonly IGlobalSettings _globalSettings;
private readonly PropertyEditorCollection _propertyEditors;
private readonly IScopeProvider _scopeProvider;
- private readonly IShortStringHelper _shortStringHelper;
public ContentTypeController(IEntityXmlSerializer serializer,
ICultureDictionary cultureDictionary,
@@ -63,13 +60,12 @@ namespace Umbraco.Web.Editors
IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper,
IScopeProvider scopeProvider,
IShortStringHelper shortStringHelper)
- : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
_serializer = serializer;
_globalSettings = globalSettings;
_propertyEditors = propertyEditors;
_scopeProvider = scopeProvider;
- _shortStringHelper = shortStringHelper;
}
public int GetCount()
@@ -229,9 +225,9 @@ namespace Umbraco.Web.Editors
public CreatedContentTypeCollectionResult PostCreateCollection(int parentId, string collectionName, bool collectionCreateTemplate, string collectionItemName, bool collectionItemCreateTemplate, string collectionIcon, string collectionItemIcon)
{
// create item doctype
- var itemDocType = new ContentType(_shortStringHelper, parentId);
+ var itemDocType = new ContentType(ShortStringHelper, parentId);
itemDocType.Name = collectionItemName;
- itemDocType.Alias = collectionItemName.ToSafeAlias(_shortStringHelper, true);
+ itemDocType.Alias = collectionItemName.ToSafeAlias(ShortStringHelper, true);
itemDocType.Icon = collectionItemIcon;
// create item doctype template
@@ -245,9 +241,9 @@ namespace Umbraco.Web.Editors
Services.ContentTypeService.Save(itemDocType);
// create collection doctype
- var collectionDocType = new ContentType(_shortStringHelper, parentId);
+ var collectionDocType = new ContentType(ShortStringHelper, parentId);
collectionDocType.Name = collectionName;
- collectionDocType.Alias = collectionName.ToSafeAlias(_shortStringHelper, true);
+ collectionDocType.Alias = collectionName.ToSafeAlias(ShortStringHelper, true);
collectionDocType.Icon = collectionIcon;
collectionDocType.IsContainer = true;
collectionDocType.AllowedContentTypes = new List()
@@ -380,10 +376,10 @@ namespace Umbraco.Web.Editors
if (parentId != Constants.System.Root)
{
var parent = Services.ContentTypeService.Get(parentId);
- ct = parent != null ? new ContentType(_shortStringHelper, parent, string.Empty) : new ContentType(_shortStringHelper, parentId);
+ ct = parent != null ? new ContentType(ShortStringHelper, parent, string.Empty) : new ContentType(ShortStringHelper, parentId);
}
else
- ct = new ContentType(_shortStringHelper, parentId);
+ ct = new ContentType(ShortStringHelper, parentId);
ct.Icon = Constants.Icons.Content;
@@ -528,7 +524,7 @@ namespace Umbraco.Web.Editors
}
var dataInstaller = new PackageDataInstallation(Logger, Services.FileService, Services.MacroService, Services.LocalizationService,
- Services.DataTypeService, Services.EntityService, Services.ContentTypeService, Services.ContentService, _propertyEditors, _scopeProvider, _shortStringHelper, _globalSettings, Services.TextService);
+ Services.DataTypeService, Services.EntityService, Services.ContentTypeService, Services.ContentService, _propertyEditors, _scopeProvider, ShortStringHelper, _globalSettings, Services.TextService);
var xd = new XmlDocument {XmlResolver = null};
xd.Load(filePath);
diff --git a/src/Umbraco.Web/Editors/ContentTypeControllerBase.cs b/src/Umbraco.Web/Editors/ContentTypeControllerBase.cs
index 138ef7e43d..1e4500ddac 100644
--- a/src/Umbraco.Web/Editors/ContentTypeControllerBase.cs
+++ b/src/Umbraco.Web/Editors/ContentTypeControllerBase.cs
@@ -14,6 +14,7 @@ using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi;
@@ -28,8 +29,8 @@ namespace Umbraco.Web.Editors
public abstract class ContentTypeControllerBase : UmbracoAuthorizedJsonController
where TContentType : class, IContentTypeComposition
{
- protected ContentTypeControllerBase(ICultureDictionary cultureDictionary, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper)
- : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ protected ContentTypeControllerBase(ICultureDictionary cultureDictionary, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper)
+ : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
CultureDictionary = cultureDictionary;
}
diff --git a/src/Umbraco.Web/Editors/CurrentUserController.cs b/src/Umbraco.Web/Editors/CurrentUserController.cs
index f6b0c48e4d..b235aabf6a 100644
--- a/src/Umbraco.Web/Editors/CurrentUserController.cs
+++ b/src/Umbraco.Web/Editors/CurrentUserController.cs
@@ -31,7 +31,6 @@ namespace Umbraco.Web.Editors
public class CurrentUserController : UmbracoAuthorizedJsonController
{
private readonly IMediaFileSystem _mediaFileSystem;
- private readonly IShortStringHelper _shortStringHelper;
public CurrentUserController(
IGlobalSettings globalSettings,
@@ -44,10 +43,9 @@ namespace Umbraco.Web.Editors
UmbracoHelper umbracoHelper,
IMediaFileSystem mediaFileSystem,
IShortStringHelper shortStringHelper)
- : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
_mediaFileSystem = mediaFileSystem;
- _shortStringHelper = shortStringHelper;
}
///
@@ -181,7 +179,7 @@ namespace Umbraco.Web.Editors
public async Task PostSetAvatar()
{
//borrow the logic from the user controller
- return await UsersController.PostSetAvatarInternal(Request, Services.UserService, AppCaches.RuntimeCache, _mediaFileSystem, _shortStringHelper, Security.GetUserId().ResultOr(0));
+ return await UsersController.PostSetAvatarInternal(Request, Services.UserService, AppCaches.RuntimeCache, _mediaFileSystem, ShortStringHelper, Security.GetUserId().ResultOr(0));
}
///
diff --git a/src/Umbraco.Web/Editors/DashboardController.cs b/src/Umbraco.Web/Editors/DashboardController.cs
index cf6fc32113..80d4172473 100644
--- a/src/Umbraco.Web/Editors/DashboardController.cs
+++ b/src/Umbraco.Web/Editors/DashboardController.cs
@@ -16,6 +16,7 @@ using Umbraco.Web.WebApi.Filters;
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Core.Dashboards;
using Umbraco.Core.Strings;
using Umbraco.Web.Services;
diff --git a/src/Umbraco.Web/Editors/DataTypeController.cs b/src/Umbraco.Web/Editors/DataTypeController.cs
index 5329a312e5..670c574d87 100644
--- a/src/Umbraco.Web/Editors/DataTypeController.cs
+++ b/src/Umbraco.Web/Editors/DataTypeController.cs
@@ -8,6 +8,7 @@ using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi;
@@ -38,8 +39,8 @@ namespace Umbraco.Web.Editors
{
private readonly PropertyEditorCollection _propertyEditors;
- public DataTypeController(PropertyEditorCollection propertyEditors, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper)
- : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ public DataTypeController(PropertyEditorCollection propertyEditors, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper)
+ : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
_propertyEditors = propertyEditors;
}
diff --git a/src/Umbraco.Web/Editors/DictionaryController.cs b/src/Umbraco.Web/Editors/DictionaryController.cs
index d132fdc201..ce808bab1e 100644
--- a/src/Umbraco.Web/Editors/DictionaryController.cs
+++ b/src/Umbraco.Web/Editors/DictionaryController.cs
@@ -11,6 +11,7 @@ using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi;
@@ -33,8 +34,8 @@ namespace Umbraco.Web.Editors
[EnableOverrideAuthorization]
public class DictionaryController : BackOfficeNotificationsController
{
- public DictionaryController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper)
- : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ public DictionaryController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper)
+ : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
}
diff --git a/src/Umbraco.Web/Editors/EntityController.cs b/src/Umbraco.Web/Editors/EntityController.cs
index 8371978903..c0a5212535 100644
--- a/src/Umbraco.Web/Editors/EntityController.cs
+++ b/src/Umbraco.Web/Editors/EntityController.cs
@@ -11,7 +11,6 @@ using System.Net.Http;
using System.Net.Http.Formatting;
using System.Reflection;
using Umbraco.Core.Models;
-using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using System.Web.Http.Controllers;
using System.Web.Http.ModelBinding;
using Umbraco.Core.Cache;
@@ -51,7 +50,6 @@ namespace Umbraco.Web.Editors
{
private readonly ITreeService _treeService;
private readonly UmbracoTreeSearcher _treeSearcher;
- private readonly IShortStringHelper _shortStringHelper;
private readonly SearchableTreeCollection _searchableTreeCollection;
public EntityController(
@@ -67,12 +65,12 @@ namespace Umbraco.Web.Editors
SearchableTreeCollection searchableTreeCollection,
UmbracoTreeSearcher treeSearcher,
IShortStringHelper shortStringHelper)
- : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
+
{
_treeService = treeService;
_searchableTreeCollection = searchableTreeCollection;
_treeSearcher = treeSearcher;
- _shortStringHelper = shortStringHelper;
}
///
@@ -102,7 +100,7 @@ namespace Umbraco.Web.Editors
///
public dynamic GetSafeAlias(string value, bool camelCase = true)
{
- var returnValue = string.IsNullOrWhiteSpace(value) ? string.Empty : value.ToSafeAlias(_shortStringHelper, camelCase);
+ var returnValue = string.IsNullOrWhiteSpace(value) ? string.Empty : value.ToSafeAlias(ShortStringHelper, camelCase);
dynamic returnObj = new System.Dynamic.ExpandoObject();
returnObj.alias = returnValue;
returnObj.original = value;
diff --git a/src/Umbraco.Web/Editors/Filters/MemberSaveModelValidator.cs b/src/Umbraco.Web/Editors/Filters/MemberSaveModelValidator.cs
index fbbd7582f9..1b2ddf2ace 100644
--- a/src/Umbraco.Web/Editors/Filters/MemberSaveModelValidator.cs
+++ b/src/Umbraco.Web/Editors/Filters/MemberSaveModelValidator.cs
@@ -6,12 +6,11 @@ using System.Net.Http;
using System.Web.Http.Controllers;
using System.Web.Http.ModelBinding;
using Umbraco.Core;
-using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Models.ContentEditing;
-using Umbraco.Web.Security;
namespace Umbraco.Web.Editors.Filters
{
@@ -22,17 +21,20 @@ namespace Umbraco.Web.Editors.Filters
{
private readonly IMemberTypeService _memberTypeService;
private readonly IMemberService _memberService;
+ private readonly IShortStringHelper _shortStringHelper;
public MemberSaveModelValidator(
ILogger logger,
IUmbracoContextAccessor umbracoContextAccessor,
ILocalizedTextService textService,
IMemberTypeService memberTypeService,
- IMemberService memberService)
+ IMemberService memberService,
+ IShortStringHelper shortStringHelper)
: base(logger, umbracoContextAccessor, textService)
{
_memberTypeService = memberTypeService ?? throw new ArgumentNullException(nameof(memberTypeService));
_memberService = memberService ?? throw new ArgumentNullException(nameof(memberService));
+ _shortStringHelper = shortStringHelper ?? throw new ArgumentNullException(nameof(shortStringHelper));
}
///
@@ -90,7 +92,7 @@ namespace Umbraco.Web.Editors.Filters
public override bool ValidateProperties(MemberSave model, IContentProperties modelWithProperties, HttpActionContext actionContext)
{
var propertiesToValidate = model.Properties.ToList();
- var defaultProps = ConventionsHelper.GetStandardPropertyTypeStubs(Current.ShortStringHelper);
+ var defaultProps = ConventionsHelper.GetStandardPropertyTypeStubs(_shortStringHelper);
var exclude = defaultProps.Select(x => x.Value.Alias).ToArray();
foreach (var remove in exclude)
{
diff --git a/src/Umbraco.Web/Editors/Filters/MemberSaveValidationAttribute.cs b/src/Umbraco.Web/Editors/Filters/MemberSaveValidationAttribute.cs
index 629a5a4eec..51fa5652ea 100644
--- a/src/Umbraco.Web/Editors/Filters/MemberSaveValidationAttribute.cs
+++ b/src/Umbraco.Web/Editors/Filters/MemberSaveValidationAttribute.cs
@@ -3,6 +3,7 @@ using System.Web.Http.Controllers;
using System.Web.Http.Filters;
using Umbraco.Core.Logging;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Composing;
using Umbraco.Web.Models.ContentEditing;
@@ -18,24 +19,26 @@ namespace Umbraco.Web.Editors.Filters
private readonly ILocalizedTextService _textService;
private readonly IMemberTypeService _memberTypeService;
private readonly IMemberService _memberService;
+ private readonly IShortStringHelper _shortStringHelper;
public MemberSaveValidationAttribute()
- : this(Current.Logger, Current.UmbracoContextAccessor, Current.Services.TextService, Current.Services.MemberTypeService, Current.Services.MemberService)
+ : this(Current.Logger, Current.UmbracoContextAccessor, Current.Services.TextService, Current.Services.MemberTypeService, Current.Services.MemberService, Current.ShortStringHelper)
{ }
- public MemberSaveValidationAttribute(ILogger logger, IUmbracoContextAccessor umbracoContextAccessor, ILocalizedTextService textService, IMemberTypeService memberTypeService, IMemberService memberService)
+ public MemberSaveValidationAttribute(ILogger logger, IUmbracoContextAccessor umbracoContextAccessor, ILocalizedTextService textService, IMemberTypeService memberTypeService, IMemberService memberService, IShortStringHelper shortStringHelper)
{
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_umbracoContextAccessor = umbracoContextAccessor ?? throw new ArgumentNullException(nameof(umbracoContextAccessor));
_textService = textService ?? throw new ArgumentNullException(nameof(textService));
_memberTypeService = memberTypeService ?? throw new ArgumentNullException(nameof(memberTypeService));
- _memberService = memberService ?? throw new ArgumentNullException(nameof(memberService));;
+ _memberService = memberService ?? throw new ArgumentNullException(nameof(memberService));
+ _shortStringHelper = shortStringHelper ?? throw new ArgumentNullException(nameof(shortStringHelper));
}
public override void OnActionExecuting(HttpActionContext actionContext)
{
var model = (MemberSave)actionContext.ActionArguments["contentItem"];
- var contentItemValidator = new MemberSaveModelValidator(_logger, _umbracoContextAccessor,_textService, _memberTypeService, _memberService);
+ var contentItemValidator = new MemberSaveModelValidator(_logger, _umbracoContextAccessor,_textService, _memberTypeService, _memberService, _shortStringHelper);
//now do each validation step
if (contentItemValidator.ValidateExistingContent(model, actionContext))
if (contentItemValidator.ValidateProperties(model, model, actionContext))
diff --git a/src/Umbraco.Web/Editors/LogController.cs b/src/Umbraco.Web/Editors/LogController.cs
index 1924d9c228..f02a79b574 100644
--- a/src/Umbraco.Web/Editors/LogController.cs
+++ b/src/Umbraco.Web/Editors/LogController.cs
@@ -9,6 +9,7 @@ using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi.Filters;
@@ -32,8 +33,9 @@ namespace Umbraco.Web.Editors
IProfilingLogger logger,
IRuntimeState runtimeState,
UmbracoHelper umbracoHelper,
- IMediaFileSystem mediaFileSystem)
- : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ IMediaFileSystem mediaFileSystem,
+ IShortStringHelper shortStringHelper)
+ : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
_mediaFileSystem = mediaFileSystem;
}
diff --git a/src/Umbraco.Web/Editors/MacroRenderingController.cs b/src/Umbraco.Web/Editors/MacroRenderingController.cs
index 2940f81f28..9e9b7efc1b 100644
--- a/src/Umbraco.Web/Editors/MacroRenderingController.cs
+++ b/src/Umbraco.Web/Editors/MacroRenderingController.cs
@@ -164,7 +164,7 @@ namespace Umbraco.Web.Editors
var macro = new Macro(_shortStringHelper)
{
- Alias = macroName.ToSafeAlias(_shortStringHelper),
+ Alias = macroName.ToSafeAlias(ShortStringHelper),
Name = macroName,
MacroSource = model.VirtualPath.EnsureStartsWith("~"),
MacroType = MacroTypes.PartialView
diff --git a/src/Umbraco.Web/Editors/MacrosController.cs b/src/Umbraco.Web/Editors/MacrosController.cs
index cda9bacf73..4a25fd174b 100644
--- a/src/Umbraco.Web/Editors/MacrosController.cs
+++ b/src/Umbraco.Web/Editors/MacrosController.cs
@@ -9,7 +9,6 @@ using System.Web.Http;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;
-using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence;
@@ -35,7 +34,7 @@ namespace Umbraco.Web.Editors
private readonly IMacroService _macroService;
public MacrosController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper)
- : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
_shortStringHelper = shortStringHelper;
_macroService = Services.MacroService;
@@ -58,7 +57,7 @@ namespace Umbraco.Web.Editors
return this.ReturnErrorResponse("Name can not be empty");
}
- var alias = name.ToSafeAlias(_shortStringHelper);
+ var alias = name.ToSafeAlias(ShortStringHelper);
if (_macroService.GetByAlias(alias) != null)
{
diff --git a/src/Umbraco.Web/Editors/MediaController.cs b/src/Umbraco.Web/Editors/MediaController.cs
index c1675f924e..421e861620 100644
--- a/src/Umbraco.Web/Editors/MediaController.cs
+++ b/src/Umbraco.Web/Editors/MediaController.cs
@@ -1,43 +1,43 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
+using System.Web.Http.Controllers;
using System.Web.Http.ModelBinding;
using Umbraco.Core;
-using Umbraco.Core.IO;
-using Umbraco.Core.Logging;
-using Umbraco.Core.Models;
-using Umbraco.Core.Models.Membership;
-using Umbraco.Core.Persistence.DatabaseModelDefinitions;
-using Umbraco.Core.Services;
-using Umbraco.Web.Models.ContentEditing;
-using Umbraco.Web.Mvc;
-using Umbraco.Web.WebApi;
-using System.Linq;
-using System.Web.Http.Controllers;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
-using Umbraco.Web.WebApi.Filters;
-using Umbraco.Core.Persistence.Querying;
-using Notification = Umbraco.Web.Models.ContentEditing.Notification;
-using Umbraco.Core.Persistence;
using Umbraco.Core.Configuration.UmbracoSettings;
+using Umbraco.Core.Dictionary;
+using Umbraco.Core.IO;
+using Umbraco.Core.Logging;
+using Umbraco.Core.Models;
using Umbraco.Core.Models.ContentEditing;
using Umbraco.Core.Models.Editors;
+using Umbraco.Core.Models.Entities;
+using Umbraco.Core.Models.Membership;
using Umbraco.Core.Models.Validation;
+using Umbraco.Core.Persistence;
+using Umbraco.Core.Persistence.Querying;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.ContentApps;
using Umbraco.Web.Editors.Binders;
using Umbraco.Web.Editors.Filters;
-using Umbraco.Core.Models.Entities;
+using Umbraco.Web.Models.ContentEditing;
+using Umbraco.Web.Mvc;
+using Umbraco.Web.WebApi;
+using Umbraco.Web.WebApi.Filters;
using Constants = Umbraco.Core.Constants;
-using Umbraco.Core.Dictionary;
+using Notification = Umbraco.Web.Models.ContentEditing.Notification;
using Umbraco.Core.Strings;
namespace Umbraco.Web.Editors
diff --git a/src/Umbraco.Web/Editors/MediaTypeController.cs b/src/Umbraco.Web/Editors/MediaTypeController.cs
index e590f2860f..b0f21e26e0 100644
--- a/src/Umbraco.Web/Editors/MediaTypeController.cs
+++ b/src/Umbraco.Web/Editors/MediaTypeController.cs
@@ -40,7 +40,7 @@ namespace Umbraco.Web.Editors
private readonly IShortStringHelper _shortStringHelper;
public MediaTypeController(ICultureDictionary cultureDictionary, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper)
- : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
_shortStringHelper = shortStringHelper;
}
diff --git a/src/Umbraco.Web/Editors/MemberController.cs b/src/Umbraco.Web/Editors/MemberController.cs
index 2c5c079c36..4c395a56f9 100644
--- a/src/Umbraco.Web/Editors/MemberController.cs
+++ b/src/Umbraco.Web/Editors/MemberController.cs
@@ -1,36 +1,36 @@
using System;
+using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
+using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.ModelBinding;
using Umbraco.Core;
-using Umbraco.Core.Logging;
-using Umbraco.Core.Models;
-using Umbraco.Core.Models.Membership;
-using Umbraco.Core.Services;
-using Umbraco.Core.Services.Implement;
-using Umbraco.Web.WebApi;
-using Umbraco.Web.Models.ContentEditing;
-using Umbraco.Web.Mvc;
-using Umbraco.Web.WebApi.Filters;
-using System.Collections.Generic;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;
+using Umbraco.Core.Dictionary;
+using Umbraco.Core.Logging;
+using Umbraco.Core.Models;
using Umbraco.Core.Models.ContentEditing;
+using Umbraco.Core.Models.Membership;
using Umbraco.Core.Persistence;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Security;
+using Umbraco.Core.Services;
+using Umbraco.Core.Services.Implement;
+using Umbraco.Core.Strings;
using Umbraco.Web.ContentApps;
using Umbraco.Web.Editors.Binders;
using Umbraco.Web.Editors.Filters;
+using Umbraco.Web.Models.ContentEditing;
+using Umbraco.Web.Mvc;
+using Umbraco.Web.WebApi;
+using Umbraco.Web.WebApi.Filters;
using Constants = Umbraco.Core.Constants;
-using Umbraco.Core.Dictionary;
-using Umbraco.Web.Security;
-using Umbraco.Core.Security;
-using System.Threading.Tasks;
using Umbraco.Core.Strings;
namespace Umbraco.Web.Editors
diff --git a/src/Umbraco.Web/Editors/MemberTypeController.cs b/src/Umbraco.Web/Editors/MemberTypeController.cs
index 0ad0d405e3..b10fc23e50 100644
--- a/src/Umbraco.Web/Editors/MemberTypeController.cs
+++ b/src/Umbraco.Web/Editors/MemberTypeController.cs
@@ -13,6 +13,7 @@ using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi.Filters;
@@ -20,7 +21,6 @@ using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Editors
{
-
///
/// An API controller used for dealing with member types
///
@@ -28,8 +28,8 @@ namespace Umbraco.Web.Editors
[UmbracoTreeAuthorize(new string[] { Constants.Trees.MemberTypes, Constants.Trees.Members})]
public class MemberTypeController : ContentTypeControllerBase
{
- public MemberTypeController(ICultureDictionary cultureDictionary, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper)
- : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ public MemberTypeController(ICultureDictionary cultureDictionary, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper)
+ : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
}
@@ -98,7 +98,7 @@ namespace Umbraco.Web.Editors
[UmbracoTreeAuthorize(Constants.Trees.MemberTypes)]
public MemberTypeDisplay GetEmpty()
{
- var ct = new MemberType(Current.ShortStringHelper, -1);
+ var ct = new MemberType(ShortStringHelper, -1);
ct.Icon = Constants.Icons.Member;
var dto = Mapper.Map(ct);
diff --git a/src/Umbraco.Web/Editors/PackageInstallController.cs b/src/Umbraco.Web/Editors/PackageInstallController.cs
index 64141a32f2..8b62b23688 100644
--- a/src/Umbraco.Web/Editors/PackageInstallController.cs
+++ b/src/Umbraco.Web/Editors/PackageInstallController.cs
@@ -16,6 +16,7 @@ using Umbraco.Core.Models.Packaging;
using Umbraco.Core.Packaging;
using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.JavaScript;
using Umbraco.Web.Models;
using Umbraco.Web.Models.ContentEditing;
@@ -38,8 +39,8 @@ namespace Umbraco.Web.Editors
private readonly IUmbracoVersion _umbracoVersion;
public PackageInstallController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor,
ISqlContext sqlContext, ServiceContext services, AppCaches appCaches,
- IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IUmbracoVersion umbracoVersion)
- : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper, IUmbracoVersion umbracoVersion)
+ : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
_umbracoVersion = umbracoVersion;
diff --git a/src/Umbraco.Web/Editors/RelationTypeController.cs b/src/Umbraco.Web/Editors/RelationTypeController.cs
index eb70342ec5..55b3ced23a 100644
--- a/src/Umbraco.Web/Editors/RelationTypeController.cs
+++ b/src/Umbraco.Web/Editors/RelationTypeController.cs
@@ -10,7 +10,6 @@ using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence;
-using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using Umbraco.Web.Models.ContentEditing;
@@ -29,8 +28,6 @@ namespace Umbraco.Web.Editors
[EnableOverrideAuthorization]
public class RelationTypeController : BackOfficeNotificationsController
{
- private readonly IShortStringHelper _shortStringHelper;
-
public RelationTypeController(
IGlobalSettings globalSettings,
IUmbracoContextAccessor umbracoContextAccessor,
@@ -41,9 +38,8 @@ namespace Umbraco.Web.Editors
IRuntimeState runtimeState,
UmbracoHelper umbracoHelper,
IShortStringHelper shortStringHelper)
- : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
- _shortStringHelper = shortStringHelper;
}
///
@@ -113,7 +109,7 @@ namespace Umbraco.Web.Editors
/// A containing the persisted relation type's ID.
public HttpResponseMessage PostCreate(RelationTypeSave relationType)
{
- var relationTypePersisted = new RelationType(relationType.Name, relationType.Name.ToSafeAlias(_shortStringHelper, true), relationType.IsBidirectional, relationType.ChildObjectType, relationType.ParentObjectType);
+ var relationTypePersisted = new RelationType(relationType.Name, relationType.Name.ToSafeAlias(ShortStringHelper, true), relationType.IsBidirectional, relationType.ChildObjectType, relationType.ParentObjectType);
try
{
diff --git a/src/Umbraco.Web/Editors/SectionController.cs b/src/Umbraco.Web/Editors/SectionController.cs
index ac98f576d4..102f962ecb 100644
--- a/src/Umbraco.Web/Editors/SectionController.cs
+++ b/src/Umbraco.Web/Editors/SectionController.cs
@@ -8,6 +8,7 @@ using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Trees;
using Section = Umbraco.Web.Models.ContentEditing.Section;
using Umbraco.Web.Models.Trees;
@@ -26,8 +27,8 @@ namespace Umbraco.Web.Editors
private readonly ITreeService _treeService;
public SectionController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState,
- IDashboardService dashboardService, ISectionService sectionService, ITreeService treeService, UmbracoHelper umbracoHelper)
- : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ IDashboardService dashboardService, ISectionService sectionService, ITreeService treeService, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper)
+ : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
_dashboardService = dashboardService;
_sectionService = sectionService;
diff --git a/src/Umbraco.Web/Editors/TemplateController.cs b/src/Umbraco.Web/Editors/TemplateController.cs
index 666e1d2987..524ecea1eb 100644
--- a/src/Umbraco.Web/Editors/TemplateController.cs
+++ b/src/Umbraco.Web/Editors/TemplateController.cs
@@ -1,17 +1,18 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Umbraco.Core;
using Umbraco.Core.Cache;
-using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi.Filters;
@@ -23,8 +24,8 @@ namespace Umbraco.Web.Editors
[UmbracoTreeAuthorize(Constants.Trees.Templates)]
public class TemplateController : BackOfficeNotificationsController
{
- public TemplateController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper)
- : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ public TemplateController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper)
+ : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
}
@@ -82,7 +83,7 @@ namespace Umbraco.Web.Editors
public TemplateDisplay GetScaffold(int id)
{
//empty default
- var dt = new Template(Current.ShortStringHelper, "", "");
+ var dt = new Template(ShortStringHelper, string.Empty, string.Empty);
dt.Path = "-1";
if (id > 0)
diff --git a/src/Umbraco.Web/Editors/TinyMceController.cs b/src/Umbraco.Web/Editors/TinyMceController.cs
index d701ce8ddb..65e3f7ea18 100644
--- a/src/Umbraco.Web/Editors/TinyMceController.cs
+++ b/src/Umbraco.Web/Editors/TinyMceController.cs
@@ -7,7 +7,6 @@ using System.Threading.Tasks;
using System.Web.Http;
using Umbraco.Core;
using Umbraco.Core.Configuration.UmbracoSettings;
-using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
@@ -26,11 +25,10 @@ namespace Umbraco.Web.Editors
Constants.Applications.Members)]
public class TinyMceController : UmbracoAuthorizedApiController
{
- private IMediaService _mediaService;
- private IContentTypeBaseServiceProvider _contentTypeBaseServiceProvider;
+ private readonly IMediaService _mediaService;
+ private readonly IContentTypeBaseServiceProvider _contentTypeBaseServiceProvider;
private readonly IShortStringHelper _shortStringHelper;
-
public TinyMceController(IMediaService mediaService, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, IShortStringHelper shortStringHelper)
{
_mediaService = mediaService;
@@ -41,7 +39,6 @@ namespace Umbraco.Web.Editors
[HttpPost]
public async Task UploadImage()
{
-
if (Request.Content.IsMimeMultipartContent() == false)
{
throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType);
diff --git a/src/Umbraco.Web/Editors/UmbracoAuthorizedJsonController.cs b/src/Umbraco.Web/Editors/UmbracoAuthorizedJsonController.cs
index 385ed89b8f..81727dbb1d 100644
--- a/src/Umbraco.Web/Editors/UmbracoAuthorizedJsonController.cs
+++ b/src/Umbraco.Web/Editors/UmbracoAuthorizedJsonController.cs
@@ -1,9 +1,11 @@
-using Umbraco.Core;
+using System;
+using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.WebApi;
using Umbraco.Web.WebApi.Filters;
@@ -24,9 +26,12 @@ namespace Umbraco.Web.Editors
{
}
- protected UmbracoAuthorizedJsonController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper)
+ protected UmbracoAuthorizedJsonController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper)
: base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
{
+ ShortStringHelper = shortStringHelper ?? throw new ArgumentNullException(nameof(shortStringHelper));
}
+
+ public IShortStringHelper ShortStringHelper { get; }
}
}
diff --git a/src/Umbraco.Web/Editors/UserGroupsController.cs b/src/Umbraco.Web/Editors/UserGroupsController.cs
index 101716c84e..394a08433e 100644
--- a/src/Umbraco.Web/Editors/UserGroupsController.cs
+++ b/src/Umbraco.Web/Editors/UserGroupsController.cs
@@ -9,6 +9,7 @@ using Umbraco.Core.Composing;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Editors.Filters;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Mvc;
@@ -107,7 +108,7 @@ namespace Umbraco.Web.Editors
///
public UserGroupDisplay GetEmptyUserGroup()
{
- return Mapper.Map(new UserGroup(Current.ShortStringHelper));
+ return Mapper.Map(new UserGroup(ShortStringHelper));
}
///
diff --git a/src/Umbraco.Web/Editors/UsersController.cs b/src/Umbraco.Web/Editors/UsersController.cs
index 55f719f9b7..f26b2df355 100644
--- a/src/Umbraco.Web/Editors/UsersController.cs
+++ b/src/Umbraco.Web/Editors/UsersController.cs
@@ -43,7 +43,6 @@ namespace Umbraco.Web.Editors
public class UsersController : UmbracoAuthorizedJsonController
{
private readonly IMediaFileSystem _mediaFileSystem;
- private readonly IShortStringHelper _shortStringHelper;
public UsersController(
IGlobalSettings globalSettings,
@@ -56,10 +55,9 @@ namespace Umbraco.Web.Editors
UmbracoHelper umbracoHelper,
IMediaFileSystem mediaFileSystem,
IShortStringHelper shortStringHelper)
- : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
_mediaFileSystem = mediaFileSystem;
- _shortStringHelper = shortStringHelper;
}
///
@@ -80,7 +78,7 @@ namespace Umbraco.Web.Editors
[AdminUsersAuthorize]
public async Task PostSetAvatar(int id)
{
- return await PostSetAvatarInternal(Request, Services.UserService, AppCaches.RuntimeCache, _mediaFileSystem, _shortStringHelper, id);
+ return await PostSetAvatarInternal(Request, Services.UserService, AppCaches.RuntimeCache, _mediaFileSystem, ShortStringHelper, id);
}
internal static async Task PostSetAvatarInternal(HttpRequestMessage request, IUserService userService, IAppCache cache, IMediaFileSystem mediaFileSystem, IShortStringHelper shortStringHelper, int id)
diff --git a/src/Umbraco.Web/Macros/PublishedContentHashtableConverter.cs b/src/Umbraco.Web/Macros/PublishedContentHashtableConverter.cs
index 88b957ad96..97d4d2db79 100644
--- a/src/Umbraco.Web/Macros/PublishedContentHashtableConverter.cs
+++ b/src/Umbraco.Web/Macros/PublishedContentHashtableConverter.cs
@@ -77,8 +77,8 @@ namespace Umbraco.Web.Macros
/// The content.
///
/// This is for usage only.
- internal PublishedContentHashtableConverter(IContent content, IVariationContextAccessor variationContextAccessor, IUserService userService)
- : this(new PagePublishedContent(content, variationContextAccessor, userService))
+ internal PublishedContentHashtableConverter(IContent content, IVariationContextAccessor variationContextAccessor, IUserService userService, IShortStringHelper shortStringHelper)
+ : this(new PagePublishedContent(content, variationContextAccessor, userService, shortStringHelper))
{ }
#endregion
@@ -185,6 +185,7 @@ namespace Umbraco.Web.Macros
private readonly IPublishedProperty[] _properties;
private IReadOnlyDictionary _cultureInfos;
private readonly IVariationContextAccessor _variationContextAccessor;
+ private readonly IShortStringHelper _shortStringHelper;
private static readonly IReadOnlyDictionary NoCultureInfos = new Dictionary();
@@ -193,10 +194,12 @@ namespace Umbraco.Web.Macros
Id = id;
}
- public PagePublishedContent(IContent inner, IVariationContextAccessor variationContextAccessor, IUserService userService)
+ public PagePublishedContent(IContent inner, IVariationContextAccessor variationContextAccessor, IUserService userService, IShortStringHelper shortStringHelper)
{
- _inner = inner ?? throw new NullReferenceException("content");
+ _inner = inner ?? throw new ArgumentNullException(nameof(inner));
_variationContextAccessor = variationContextAccessor;
+ _shortStringHelper = shortStringHelper ?? throw new ArgumentNullException(nameof(shortStringHelper));
+
Id = _inner.Id;
Key = _inner.Key;
@@ -243,7 +246,7 @@ namespace Umbraco.Web.Macros
var urlSegmentProviders = Current.UrlSegmentProviders; // TODO inject
return _cultureInfos = _inner.PublishCultureInfos.Values
- .ToDictionary(x => x.Culture, x => new PublishedCultureInfo(x.Culture, x.Name, _inner.GetUrlSegment(Current.ShortStringHelper, urlSegmentProviders, x.Culture), x.Date));
+ .ToDictionary(x => x.Culture, x => new PublishedCultureInfo(x.Culture, x.Name, _inner.GetUrlSegment(_shortStringHelper, urlSegmentProviders, x.Culture), x.Date));
}
}
diff --git a/src/Umbraco.Web/Models/Mapping/ContentTypeMapDefinition.cs b/src/Umbraco.Web/Models/Mapping/ContentTypeMapDefinition.cs
index 6eaeef17f2..c39d90682d 100644
--- a/src/Umbraco.Web/Models/Mapping/ContentTypeMapDefinition.cs
+++ b/src/Umbraco.Web/Models/Mapping/ContentTypeMapDefinition.cs
@@ -31,7 +31,7 @@ namespace Umbraco.Web.Models.Mapping
public ContentTypeMapDefinition(PropertyEditorCollection propertyEditors, IDataTypeService dataTypeService, IFileService fileService,
IContentTypeService contentTypeService, IMediaTypeService mediaTypeService, IMemberTypeService memberTypeService,
- ILogger logger)
+ ILogger logger, IShortStringHelper shortStringHelper)
{
_propertyEditors = propertyEditors;
_dataTypeService = dataTypeService;
@@ -40,7 +40,7 @@ namespace Umbraco.Web.Models.Mapping
_mediaTypeService = mediaTypeService;
_memberTypeService = memberTypeService;
_logger = logger;
- _shortStringHelper = Current.ShortStringHelper;
+ _shortStringHelper = shortStringHelper;
}
@@ -510,7 +510,7 @@ namespace Umbraco.Web.Models.Mapping
{
MapTypeToDisplayBase(source, target);
- var groupsMapper = new PropertyTypeGroupMapper(_propertyEditors, _dataTypeService, _logger);
+ var groupsMapper = new PropertyTypeGroupMapper(_propertyEditors, _dataTypeService, _shortStringHelper, _logger);
target.Groups = groupsMapper.Map(source);
}
diff --git a/src/Umbraco.Web/Models/Mapping/PropertyTypeGroupMapper.cs b/src/Umbraco.Web/Models/Mapping/PropertyTypeGroupMapper.cs
index 104f0acb15..c41065a967 100644
--- a/src/Umbraco.Web/Models/Mapping/PropertyTypeGroupMapper.cs
+++ b/src/Umbraco.Web/Models/Mapping/PropertyTypeGroupMapper.cs
@@ -1,12 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Umbraco.Composing;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Models.ContentEditing;
using Current = Umbraco.Core.Composing.Current;
@@ -17,12 +17,14 @@ namespace Umbraco.Web.Models.Mapping
{
private readonly PropertyEditorCollection _propertyEditors;
private readonly IDataTypeService _dataTypeService;
+ private readonly IShortStringHelper _shortStringHelper;
private readonly ILogger _logger;
- public PropertyTypeGroupMapper(PropertyEditorCollection propertyEditors, IDataTypeService dataTypeService, ILogger logger)
+ public PropertyTypeGroupMapper(PropertyEditorCollection propertyEditors, IDataTypeService dataTypeService, IShortStringHelper shortStringHelper, ILogger logger)
{
_propertyEditors = propertyEditors;
_dataTypeService = dataTypeService;
+ _shortStringHelper = shortStringHelper;
_logger = logger;
}
@@ -152,7 +154,7 @@ namespace Umbraco.Web.Models.Mapping
// handle locked properties
var lockedPropertyAliases = new List();
// add built-in member property aliases to list of aliases to be locked
- foreach (var propertyAlias in ConventionsHelper.GetStandardPropertyTypeStubs(Current.ShortStringHelper).Keys)
+ foreach (var propertyAlias in ConventionsHelper.GetStandardPropertyTypeStubs(_shortStringHelper).Keys)
{
lockedPropertyAliases.Add(propertyAlias);
}
diff --git a/src/Umbraco.Web/Models/Mapping/UserMapDefinition.cs b/src/Umbraco.Web/Models/Mapping/UserMapDefinition.cs
index ea0acea6f8..3b824f9051 100644
--- a/src/Umbraco.Web/Models/Mapping/UserMapDefinition.cs
+++ b/src/Umbraco.Web/Models/Mapping/UserMapDefinition.cs
@@ -14,6 +14,7 @@ using Umbraco.Core.Models;
using Umbraco.Core.Models.Entities;
using Umbraco.Core.Models.Sections;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Actions;
using Umbraco.Web.Services;
@@ -29,9 +30,10 @@ namespace Umbraco.Web.Models.Mapping
private readonly AppCaches _appCaches;
private readonly IGlobalSettings _globalSettings;
private readonly IMediaFileSystem _mediaFileSystem;
+ private readonly IShortStringHelper _shortStringHelper;
public UserMapDefinition(ILocalizedTextService textService, IUserService userService, IEntityService entityService, ISectionService sectionService,
- AppCaches appCaches, ActionCollection actions, IGlobalSettings globalSettings, IMediaFileSystem mediaFileSystem)
+ AppCaches appCaches, ActionCollection actions, IGlobalSettings globalSettings, IMediaFileSystem mediaFileSystem, IShortStringHelper shortStringHelper)
{
_sectionService = sectionService;
_entityService = entityService;
@@ -41,11 +43,12 @@ namespace Umbraco.Web.Models.Mapping
_appCaches = appCaches;
_globalSettings = globalSettings;
_mediaFileSystem = mediaFileSystem;
+ _shortStringHelper = shortStringHelper;
}
public void DefineMaps(UmbracoMapper mapper)
{
- mapper.Define((source, context) => new UserGroup(Current.ShortStringHelper) { CreateDate = DateTime.UtcNow }, Map);
+ mapper.Define((source, context) => new UserGroup(_shortStringHelper) { CreateDate = DateTime.UtcNow }, Map);
mapper.Define(Map);
mapper.Define((source, context) => new ContentEditing.UserProfile(), Map);
mapper.Define((source, context) => new UserGroupBasic(), Map);
diff --git a/src/Umbraco.Web/Mvc/RenderRouteHandler.cs b/src/Umbraco.Web/Mvc/RenderRouteHandler.cs
index e8b9ca7fb1..fdf38e78b3 100644
--- a/src/Umbraco.Web/Mvc/RenderRouteHandler.cs
+++ b/src/Umbraco.Web/Mvc/RenderRouteHandler.cs
@@ -1,19 +1,18 @@
using System;
using System.Linq;
using System.Web;
-using System.Web.Compilation;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.SessionState;
using Umbraco.Core;
-using Umbraco.Core.Logging;
using Umbraco.Core.Composing;
+using Umbraco.Core.Logging;
+using Umbraco.Core.Strings;
+using Umbraco.Web.Features;
using Umbraco.Web.Models;
using Umbraco.Web.Routing;
-using System.Collections.Generic;
using Umbraco.Core.Strings;
using Current = Umbraco.Web.Composing.Current;
-using Umbraco.Web.Features;
namespace Umbraco.Web.Mvc
{
diff --git a/src/Umbraco.Web/Profiling/WebProfilingController.cs b/src/Umbraco.Web/Profiling/WebProfilingController.cs
index a8935da033..218ecd0669 100644
--- a/src/Umbraco.Web/Profiling/WebProfilingController.cs
+++ b/src/Umbraco.Web/Profiling/WebProfilingController.cs
@@ -4,6 +4,7 @@ using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Editors;
using Umbraco.Web.WebApi.Filters;
@@ -17,8 +18,8 @@ namespace Umbraco.Web.Profiling
{
private readonly IRuntimeState _runtimeState;
- public WebProfilingController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper)
- : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper)
+ public WebProfilingController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper)
+ : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
{
_runtimeState = runtimeState;
}
diff --git a/src/Umbraco.Web/PropertyEditors/ContentPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ContentPickerPropertyEditor.cs
index 0815d09d08..0a32a2eb7c 100644
--- a/src/Umbraco.Web/PropertyEditors/ContentPickerPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/ContentPickerPropertyEditor.cs
@@ -6,6 +6,7 @@ using Umbraco.Core.Logging;
using Umbraco.Core.Models.Editors;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
@@ -29,8 +30,9 @@ namespace Umbraco.Web.PropertyEditors
IDataTypeService dataTypeService,
ILocalizationService localizationService,
ILogger logger,
- IIOHelper ioHelper)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService,Current.Services.TextService, Current.ShortStringHelper)
+ IIOHelper ioHelper,
+ IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService,Current.Services.TextService, shortStringHelper)
{
_dataTypeService = dataTypeService;
_localizationService = localizationService;
@@ -42,11 +44,11 @@ namespace Umbraco.Web.PropertyEditors
return new ContentPickerConfigurationEditor(_ioHelper);
}
- protected override IDataValueEditor CreateValueEditor() => new ContentPickerPropertyValueEditor(_dataTypeService, _localizationService, Attribute);
+ protected override IDataValueEditor CreateValueEditor() => new ContentPickerPropertyValueEditor(_dataTypeService, _localizationService, ShortStringHelper, Attribute);
internal class ContentPickerPropertyValueEditor : DataValueEditor, IDataValueReference
{
- public ContentPickerPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute) : base(dataTypeService, localizationService,Current.Services.TextService, Current.ShortStringHelper, attribute)
+ public ContentPickerPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper, DataEditorAttribute attribute) : base(dataTypeService, localizationService,Current.Services.TextService, shortStringHelper, attribute)
{
}
diff --git a/src/Umbraco.Web/PropertyEditors/DateTimePropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/DateTimePropertyEditor.cs
index d34a630d8b..35d4e29737 100644
--- a/src/Umbraco.Web/PropertyEditors/DateTimePropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/DateTimePropertyEditor.cs
@@ -3,6 +3,7 @@ using Umbraco.Core.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
@@ -23,8 +24,8 @@ namespace Umbraco.Web.PropertyEditors
/// Initializes a new instance of the class.
///
///
- public DateTimePropertyEditor(ILogger logger, IIOHelper ioHelper)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService,Current.Services.TextService, Current.ShortStringHelper)
+ public DateTimePropertyEditor(ILogger logger, IIOHelper ioHelper, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService,Current.Services.TextService, shortStringHelper)
{
_ioHelper = ioHelper;
}
diff --git a/src/Umbraco.Web/PropertyEditors/DateValueEditor.cs b/src/Umbraco.Web/PropertyEditors/DateValueEditor.cs
index 6bf48c6be2..4e242fc380 100644
--- a/src/Umbraco.Web/PropertyEditors/DateValueEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/DateValueEditor.cs
@@ -14,8 +14,8 @@ namespace Umbraco.Web.PropertyEditors
///
internal class DateValueEditor : DataValueEditor
{
- public DateValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute)
- : base(dataTypeService, localizationService, Current.Services.TextService,Current.ShortStringHelper, attribute)
+ public DateValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper, DataEditorAttribute attribute)
+ : base(dataTypeService, localizationService, Current.Services.TextService, shortStringHelper, attribute)
{
Validators.Add(new DateTimeValidator());
}
diff --git a/src/Umbraco.Web/PropertyEditors/DecimalPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/DecimalPropertyEditor.cs
index 8780a5de0d..894c8a3a43 100644
--- a/src/Umbraco.Web/PropertyEditors/DecimalPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/DecimalPropertyEditor.cs
@@ -3,6 +3,7 @@ using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.PropertyEditors.Validators;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
@@ -20,8 +21,8 @@ namespace Umbraco.Web.PropertyEditors
///
/// Initializes a new instance of the class.
///
- public DecimalPropertyEditor(ILogger logger)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService,Current.Services.TextService, Current.ShortStringHelper)
+ public DecimalPropertyEditor(ILogger logger, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService,Current.Services.TextService, shortStringHelper)
{ }
///
diff --git a/src/Umbraco.Web/PropertyEditors/EmailAddressPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/EmailAddressPropertyEditor.cs
index 94ac6f4d36..619419085d 100644
--- a/src/Umbraco.Web/PropertyEditors/EmailAddressPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/EmailAddressPropertyEditor.cs
@@ -4,6 +4,7 @@ using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.PropertyEditors.Validators;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
@@ -20,8 +21,8 @@ namespace Umbraco.Web.PropertyEditors
///
/// The constructor will setup the property editor based on the attribute if one is found
///
- public EmailAddressPropertyEditor(ILogger logger, IIOHelper ioHelper)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService,Current.ShortStringHelper)
+ public EmailAddressPropertyEditor(ILogger logger, IIOHelper ioHelper, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService, shortStringHelper)
{
_ioHelper = ioHelper;
}
diff --git a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs
index 30e233dee3..a1b0b99d8d 100644
--- a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs
@@ -9,7 +9,7 @@ using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
-using Umbraco.Core.Services.Implement;
+using Umbraco.Core.Strings;
using Umbraco.Web.Media;
namespace Umbraco.Web.PropertyEditors
@@ -28,8 +28,8 @@ namespace Umbraco.Web.PropertyEditors
private readonly IDataTypeService _dataTypeService;
private readonly ILocalizationService _localizationService;
- public FileUploadPropertyEditor(ILogger logger, IMediaFileSystem mediaFileSystem, IContentSection contentSection, IDataTypeService dataTypeService, ILocalizationService localizationService)
- : base(logger, dataTypeService, localizationService, Current.Services.TextService,Current.ShortStringHelper)
+ public FileUploadPropertyEditor(ILogger logger, IMediaFileSystem mediaFileSystem, IContentSection contentSection, IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper)
+ : base(logger, dataTypeService, localizationService, Current.Services.TextService, shortStringHelper)
{
_mediaFileSystem = mediaFileSystem ?? throw new ArgumentNullException(nameof(mediaFileSystem));
_contentSection = contentSection;
@@ -44,7 +44,7 @@ namespace Umbraco.Web.PropertyEditors
/// The corresponding property value editor.
protected override IDataValueEditor CreateValueEditor()
{
- var editor = new FileUploadPropertyValueEditor(Attribute, _mediaFileSystem, _dataTypeService, _localizationService);
+ var editor = new FileUploadPropertyValueEditor(Attribute, _mediaFileSystem, _dataTypeService, _localizationService, ShortStringHelper);
editor.Validators.Add(new UploadFileTypeValidator());
return editor;
}
diff --git a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs
index a07cfe9dcd..a5e12165af 100644
--- a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs
@@ -1,14 +1,12 @@
using System;
-using System.Collections.Generic;
using System.IO;
-using System.Linq;
-using Newtonsoft.Json.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Models.Editors;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
@@ -19,8 +17,8 @@ namespace Umbraco.Web.PropertyEditors
{
private readonly IMediaFileSystem _mediaFileSystem;
- public FileUploadPropertyValueEditor(DataEditorAttribute attribute, IMediaFileSystem mediaFileSystem, IDataTypeService dataTypeService, ILocalizationService localizationService)
- : base(dataTypeService, localizationService, Current.Services.TextService,Current.ShortStringHelper, attribute)
+ public FileUploadPropertyValueEditor(DataEditorAttribute attribute, IMediaFileSystem mediaFileSystem, IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper)
+ : base(dataTypeService, localizationService, Current.Services.TextService, shortStringHelper, attribute)
{
_mediaFileSystem = mediaFileSystem ?? throw new ArgumentNullException(nameof(mediaFileSystem));
}
diff --git a/src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs
index 8baca0e27d..51f1197245 100644
--- a/src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs
@@ -10,11 +10,11 @@ using Umbraco.Core.Models;
using Umbraco.Core.Models.Editors;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Templates;
namespace Umbraco.Web.PropertyEditors
{
-
///
/// Represents a grid property and parameter editor.
///
@@ -28,11 +28,11 @@ namespace Umbraco.Web.PropertyEditors
Group = Constants.PropertyEditors.Groups.RichContent)]
public class GridPropertyEditor : DataEditor
{
- private IUmbracoContextAccessor _umbracoContextAccessor;
+ private readonly IUmbracoContextAccessor _umbracoContextAccessor;
private readonly IDataTypeService _dataTypeService;
private readonly ILocalizationService _localizationService;
private readonly IIOHelper _ioHelper;
- private ILogger _logger;
+ private readonly ILogger _logger;
private readonly IMediaService _mediaService;
private readonly IContentTypeBaseServiceProvider _contentTypeBaseServiceProvider;
private readonly HtmlImageSourceParser _imageSourceParser;
@@ -49,8 +49,9 @@ namespace Umbraco.Web.PropertyEditors
HtmlImageSourceParser imageSourceParser,
RichTextEditorPastedImages pastedImages,
HtmlLocalLinkParser localLinkParser,
- IIOHelper ioHelper)
- : base(logger, dataTypeService, localizationService, Current.Services.TextService, Current.ShortStringHelper)
+ IIOHelper ioHelper,
+ IShortStringHelper shortStringHelper)
+ : base(logger, dataTypeService, localizationService, Current.Services.TextService, shortStringHelper)
{
_umbracoContextAccessor = umbracoContextAccessor;
_dataTypeService = dataTypeService;
@@ -70,7 +71,7 @@ namespace Umbraco.Web.PropertyEditors
/// Overridden to ensure that the value is validated
///
///
- protected override IDataValueEditor CreateValueEditor() => new GridPropertyValueEditor(Attribute, _mediaService, _contentTypeBaseServiceProvider, _umbracoContextAccessor, _logger, _dataTypeService, _localizationService, _imageSourceParser, _pastedImages, _localLinkParser);
+ protected override IDataValueEditor CreateValueEditor() => new GridPropertyValueEditor(Attribute, _mediaService, _contentTypeBaseServiceProvider, _umbracoContextAccessor, _logger, _dataTypeService, _localizationService, _imageSourceParser, _pastedImages, _localLinkParser, ShortStringHelper);
protected override IConfigurationEditor CreateConfigurationEditor() => new GridConfigurationEditor(_ioHelper);
@@ -92,14 +93,15 @@ namespace Umbraco.Web.PropertyEditors
ILocalizationService localizationService,
HtmlImageSourceParser imageSourceParser,
RichTextEditorPastedImages pastedImages,
- HtmlLocalLinkParser localLinkParser)
- : base(dataTypeService, localizationService, Current.Services.TextService, Current.ShortStringHelper, attribute)
+ HtmlLocalLinkParser localLinkParser,
+ IShortStringHelper shortStringHelper)
+ : base(dataTypeService, localizationService, Current.Services.TextService, shortStringHelper, attribute)
{
_umbracoContextAccessor = umbracoContextAccessor;
_imageSourceParser = imageSourceParser;
_pastedImages = pastedImages;
- _richTextPropertyValueEditor = new RichTextPropertyEditor.RichTextPropertyValueEditor(attribute, mediaService, contentTypeBaseServiceProvider, umbracoContextAccessor,logger, dataTypeService, localizationService, imageSourceParser, localLinkParser, pastedImages);
- _mediaPickerPropertyValueEditor = new MediaPickerPropertyEditor.MediaPickerPropertyValueEditor(dataTypeService, localizationService, attribute);
+ _richTextPropertyValueEditor = new RichTextPropertyEditor.RichTextPropertyValueEditor(attribute, mediaService, contentTypeBaseServiceProvider, umbracoContextAccessor,logger, dataTypeService, localizationService, shortStringHelper, imageSourceParser, localLinkParser, pastedImages);
+ _mediaPickerPropertyValueEditor = new MediaPickerPropertyEditor.MediaPickerPropertyValueEditor(dataTypeService, localizationService, shortStringHelper, attribute);
}
///
diff --git a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs
index 8151e312a8..7901f2d862 100644
--- a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs
@@ -60,7 +60,7 @@ namespace Umbraco.Web.PropertyEditors
/// Creates the corresponding property value editor.
///
/// The corresponding property value editor.
- protected override IDataValueEditor CreateValueEditor() => new ImageCropperPropertyValueEditor(Attribute, Logger, _mediaFileSystem, _dataTypeService, _localizationService);
+ protected override IDataValueEditor CreateValueEditor() => new ImageCropperPropertyValueEditor(Attribute, Logger, _mediaFileSystem, _dataTypeService, _localizationService, ShortStringHelper);
///
/// Creates the corresponding preValue editor.
diff --git a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs
index 1e404109ce..f8b6688ded 100644
--- a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs
@@ -10,6 +10,7 @@ using Umbraco.Core.Models.Editors;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.PropertyEditors.ValueConverters;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using File = System.IO.File;
namespace Umbraco.Web.PropertyEditors
@@ -22,8 +23,8 @@ namespace Umbraco.Web.PropertyEditors
private readonly ILogger _logger;
private readonly IMediaFileSystem _mediaFileSystem;
- public ImageCropperPropertyValueEditor(DataEditorAttribute attribute, ILogger logger, IMediaFileSystem mediaFileSystem, IDataTypeService dataTypeService, ILocalizationService localizationService)
- : base(dataTypeService, localizationService, Current.Services.TextService, Current.ShortStringHelper, attribute)
+ public ImageCropperPropertyValueEditor(DataEditorAttribute attribute, ILogger logger, IMediaFileSystem mediaFileSystem, IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper)
+ : base(dataTypeService, localizationService, Current.Services.TextService, shortStringHelper, attribute)
{
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_mediaFileSystem = mediaFileSystem ?? throw new ArgumentNullException(nameof(mediaFileSystem));
diff --git a/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs
index a47dd125e5..705506abd5 100644
--- a/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs
@@ -1,9 +1,9 @@
-using System.Collections.Generic;
-using Umbraco.Core;
+using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
@@ -25,8 +25,8 @@ namespace Umbraco.Web.PropertyEditors
/// Initializes a new instance of the class.
///
///
- public ListViewPropertyEditor(ILogger logger, IIOHelper iioHelper)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService,Current.ShortStringHelper)
+ public ListViewPropertyEditor(ILogger logger, IIOHelper iioHelper, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService, shortStringHelper)
{
_iioHelper = iioHelper;
}
diff --git a/src/Umbraco.Web/PropertyEditors/MarkdownPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MarkdownPropertyEditor.cs
index 16a4ad0597..f08452294d 100644
--- a/src/Umbraco.Web/PropertyEditors/MarkdownPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/MarkdownPropertyEditor.cs
@@ -3,6 +3,7 @@ using Umbraco.Core.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
@@ -23,8 +24,8 @@ namespace Umbraco.Web.PropertyEditors
///
/// Initializes a new instance of the class.
///
- public MarkdownPropertyEditor(ILogger logger, IIOHelper ioHelper)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService,Current.ShortStringHelper)
+ public MarkdownPropertyEditor(ILogger logger, IIOHelper ioHelper, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService, shortStringHelper)
{
_ioHelper = ioHelper;
}
diff --git a/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs
index ad287f5f2e..735cd1ac79 100644
--- a/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs
@@ -49,11 +49,12 @@ namespace Umbraco.Web.PropertyEditors
///
protected override IConfigurationEditor CreateConfigurationEditor() => new MediaPickerConfigurationEditor(_ioHelper);
- protected override IDataValueEditor CreateValueEditor() => new MediaPickerPropertyValueEditor(_dataTypeService, _localizationService, Attribute);
+ protected override IDataValueEditor CreateValueEditor() => new MediaPickerPropertyValueEditor(_dataTypeService, _localizationService, ShortStringHelper, Attribute);
internal class MediaPickerPropertyValueEditor : DataValueEditor, IDataValueReference
{
- public MediaPickerPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute) : base(dataTypeService,localizationService, Current.Services.TextService,Current.ShortStringHelper,attribute)
+ public MediaPickerPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper, DataEditorAttribute attribute)
+ : base(dataTypeService,localizationService, Current.Services.TextService, shortStringHelper,attribute)
{
}
diff --git a/src/Umbraco.Web/PropertyEditors/MemberGroupPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MemberGroupPickerPropertyEditor.cs
index c2189c57f4..f88e08d84d 100644
--- a/src/Umbraco.Web/PropertyEditors/MemberGroupPickerPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/MemberGroupPickerPropertyEditor.cs
@@ -2,6 +2,7 @@
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
@@ -14,8 +15,8 @@ namespace Umbraco.Web.PropertyEditors
Icon = Constants.Icons.MemberGroup)]
public class MemberGroupPickerPropertyEditor : DataEditor
{
- public MemberGroupPickerPropertyEditor(ILogger logger)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService,Current.ShortStringHelper)
+ public MemberGroupPickerPropertyEditor(ILogger logger, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService, shortStringHelper)
{ }
}
}
diff --git a/src/Umbraco.Web/PropertyEditors/MemberPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MemberPickerPropertyEditor.cs
index 4c643a356b..b7ee696940 100644
--- a/src/Umbraco.Web/PropertyEditors/MemberPickerPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/MemberPickerPropertyEditor.cs
@@ -2,6 +2,7 @@
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
@@ -14,8 +15,8 @@ namespace Umbraco.Web.PropertyEditors
Icon = Constants.Icons.Member)]
public class MemberPickerPropertyEditor : DataEditor
{
- public MemberPickerPropertyEditor(ILogger logger)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService,Current.ShortStringHelper)
+ public MemberPickerPropertyEditor(ILogger logger, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService, shortStringHelper)
{ }
protected override IConfigurationEditor CreateConfigurationEditor() => new MemberPickerConfiguration();
diff --git a/src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs
index 02b0a31596..946b11f365 100644
--- a/src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs
@@ -6,6 +6,7 @@ using Umbraco.Core.Logging;
using Umbraco.Core.Models.Editors;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
@@ -22,8 +23,8 @@ namespace Umbraco.Web.PropertyEditors
private readonly ILocalizationService _localizationService;
private readonly IIOHelper _ioHelper;
- public MultiNodeTreePickerPropertyEditor(ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService,Current.Services.TextService, Current.ShortStringHelper)
+ public MultiNodeTreePickerPropertyEditor(ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService,Current.Services.TextService, shortStringHelper)
{
_dataTypeService = dataTypeService;
_localizationService = localizationService;
@@ -32,11 +33,12 @@ namespace Umbraco.Web.PropertyEditors
protected override IConfigurationEditor CreateConfigurationEditor() => new MultiNodePickerConfigurationEditor(_ioHelper);
- protected override IDataValueEditor CreateValueEditor() => new MultiNodeTreePickerPropertyValueEditor(_dataTypeService, _localizationService, Attribute);
+ protected override IDataValueEditor CreateValueEditor() => new MultiNodeTreePickerPropertyValueEditor(_dataTypeService, _localizationService, ShortStringHelper, Attribute);
public class MultiNodeTreePickerPropertyValueEditor : DataValueEditor, IDataValueReference
{
- public MultiNodeTreePickerPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute): base(dataTypeService, localizationService, Current.Services.TextService, Current.ShortStringHelper, attribute)
+ public MultiNodeTreePickerPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper, DataEditorAttribute attribute)
+ : base(dataTypeService, localizationService, Current.Services.TextService, shortStringHelper, attribute)
{
}
diff --git a/src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs
index 63b3d4fcd3..a56a0a8c63 100644
--- a/src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs
@@ -5,10 +5,8 @@ using Umbraco.Core.IO;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Logging;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.PublishedCache;
-using System.Collections.Generic;
-using Umbraco.Core.Models.Editors;
-using Newtonsoft.Json;
namespace Umbraco.Web.PropertyEditors
{
@@ -28,8 +26,8 @@ namespace Umbraco.Web.PropertyEditors
private readonly ILocalizationService _localizationService;
private readonly IIOHelper _ioHelper;
- public MultiUrlPickerPropertyEditor(ILogger logger, IEntityService entityService, IPublishedSnapshotAccessor publishedSnapshotAccessor, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper)
- : base(logger, dataTypeService, localizationService, Current.Services.TextService,Current.ShortStringHelper, EditorType.PropertyValue)
+ public MultiUrlPickerPropertyEditor(ILogger logger, IEntityService entityService, IPublishedSnapshotAccessor publishedSnapshotAccessor, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper, IShortStringHelper shortStringHelper)
+ : base(logger, dataTypeService, localizationService, Current.Services.TextService, shortStringHelper, EditorType.PropertyValue)
{
_entityService = entityService ?? throw new ArgumentNullException(nameof(entityService));
_publishedSnapshotAccessor = publishedSnapshotAccessor ?? throw new ArgumentNullException(nameof(publishedSnapshotAccessor));
@@ -40,6 +38,6 @@ namespace Umbraco.Web.PropertyEditors
protected override IConfigurationEditor CreateConfigurationEditor() => new MultiUrlPickerConfigurationEditor(_ioHelper);
- protected override IDataValueEditor CreateValueEditor() => new MultiUrlPickerValueEditor(_entityService, _publishedSnapshotAccessor, Logger, _dataTypeService, _localizationService, Attribute);
+ protected override IDataValueEditor CreateValueEditor() => new MultiUrlPickerValueEditor(_entityService, _publishedSnapshotAccessor, Logger, _dataTypeService, _localizationService, ShortStringHelper, Attribute);
}
}
diff --git a/src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs b/src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs
index 6363048b34..5564d44e4a 100644
--- a/src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs
@@ -10,6 +10,7 @@ using Umbraco.Core.Models.Editors;
using Umbraco.Core.Models.Entities;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Composing;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.PublishedCache;
@@ -22,8 +23,8 @@ namespace Umbraco.Web.PropertyEditors
private readonly ILogger _logger;
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
- public MultiUrlPickerValueEditor(IEntityService entityService, IPublishedSnapshotAccessor publishedSnapshotAccessor, ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute)
- : base(dataTypeService, localizationService, Current.Services.TextService,Current.ShortStringHelper, attribute)
+ public MultiUrlPickerValueEditor(IEntityService entityService, IPublishedSnapshotAccessor publishedSnapshotAccessor, ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper, DataEditorAttribute attribute)
+ : base(dataTypeService, localizationService, Current.Services.TextService, shortStringHelper, attribute)
{
_entityService = entityService ?? throw new ArgumentNullException(nameof(entityService));
_publishedSnapshotAccessor = publishedSnapshotAccessor ?? throw new ArgumentNullException(nameof(publishedSnapshotAccessor));
diff --git a/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs
index c1937562df..7db6c6f0d9 100644
--- a/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs
@@ -13,6 +13,7 @@ using Umbraco.Core.Models.Editors;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.PropertyEditors.Validators;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
@@ -36,8 +37,8 @@ namespace Umbraco.Web.PropertyEditors
///
/// Initializes a new instance of the class.
///
- public MultipleTextStringPropertyEditor(ILogger logger, IIOHelper ioHelper, IDataTypeService dataTypeService, ILocalizationService localizationService, ILocalizedTextService localizedTextService)
- : base(logger, dataTypeService, localizationService, Current.Services.TextService,Current.ShortStringHelper)
+ public MultipleTextStringPropertyEditor(ILogger logger, IIOHelper ioHelper, IDataTypeService dataTypeService, ILocalizationService localizationService, ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper)
+ : base(logger, dataTypeService, localizationService, Current.Services.TextService, shortStringHelper)
{
_ioHelper = ioHelper;
_dataTypeService = dataTypeService;
@@ -46,7 +47,7 @@ namespace Umbraco.Web.PropertyEditors
}
///
- protected override IDataValueEditor CreateValueEditor() => new MultipleTextStringPropertyValueEditor(_dataTypeService, _localizationService,Attribute, _localizedTextService);
+ protected override IDataValueEditor CreateValueEditor() => new MultipleTextStringPropertyValueEditor(_dataTypeService, _localizationService, _localizedTextService, ShortStringHelper, Attribute);
///
protected override IConfigurationEditor CreateConfigurationEditor() => new MultipleTextStringConfigurationEditor(_ioHelper);
@@ -58,8 +59,8 @@ namespace Umbraco.Web.PropertyEditors
{
private readonly ILocalizedTextService _localizedTextService;
- public MultipleTextStringPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute, ILocalizedTextService localizedTextService)
- : base(dataTypeService, localizationService, Current.Services.TextService,Current.ShortStringHelper, attribute)
+ public MultipleTextStringPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, DataEditorAttribute attribute)
+ : base(dataTypeService, localizationService, Current.Services.TextService, shortStringHelper, attribute)
{
_localizedTextService = localizedTextService;
}
diff --git a/src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs
index 82fad308e5..995f7ae509 100644
--- a/src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs
@@ -67,7 +67,7 @@ namespace Umbraco.Web.PropertyEditors
#region Value Editor
- protected override IDataValueEditor CreateValueEditor() => new NestedContentPropertyValueEditor(_dataTypeService, _localizationService, Attribute, PropertyEditors, _contentTypeService);
+ protected override IDataValueEditor CreateValueEditor() => new NestedContentPropertyValueEditor(_dataTypeService, _localizationService, _contentTypeService, ShortStringHelper, Attribute, PropertyEditors);
internal class NestedContentPropertyValueEditor : DataValueEditor, IDataValueReference
{
@@ -79,8 +79,8 @@ namespace Umbraco.Web.PropertyEditors
Current.Services.ContentTypeService.GetAll().ToDictionary(c => c.Alias)
);
- public NestedContentPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute, PropertyEditorCollection propertyEditors, IContentTypeService contentTypeService)
- : base(dataTypeService, localizationService, Current.Services.TextService, Current.ShortStringHelper, attribute)
+ public NestedContentPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, IContentTypeService contentTypeService, IShortStringHelper shortStringHelper, DataEditorAttribute attribute, PropertyEditorCollection propertyEditors)
+ : base(dataTypeService, localizationService, Current.Services.TextService, shortStringHelper, attribute)
{
_propertyEditors = propertyEditors;
_dataTypeService = dataTypeService;
diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/ContentTypeParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/ContentTypeParameterEditor.cs
index dd02f10245..2771b24bd6 100644
--- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/ContentTypeParameterEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/ContentTypeParameterEditor.cs
@@ -1,6 +1,7 @@
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors.ParameterEditors
{
@@ -17,8 +18,8 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors
///
/// Initializes a new instance of the class.
///
- public ContentTypeParameterEditor(ILogger logger)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService,Current.Services.TextService, Current.ShortStringHelper)
+ public ContentTypeParameterEditor(ILogger logger, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService,Current.Services.TextService, shortStringHelper)
{
// configure
DefaultConfiguration.Add("multiple", false);
diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentPickerParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentPickerParameterEditor.cs
index 0b85f99662..baa38b492e 100644
--- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentPickerParameterEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentPickerParameterEditor.cs
@@ -2,6 +2,7 @@
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors.ParameterEditors
{
@@ -18,8 +19,8 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors
///
/// Initializes a new instance of the class.
///
- public MultipleContentPickerParameterEditor(ILogger logger)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService,Current.ShortStringHelper)
+ public MultipleContentPickerParameterEditor(ILogger logger, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService, shortStringHelper)
{
// configure
DefaultConfiguration.Add("multiPicker", "1");
diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentTypeParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentTypeParameterEditor.cs
index c6b1c52449..7fa3679eb1 100644
--- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentTypeParameterEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentTypeParameterEditor.cs
@@ -1,6 +1,7 @@
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors.ParameterEditors
{
@@ -11,8 +12,8 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors
"entitypicker")]
public class MultipleContentTypeParameterEditor : DataEditor
{
- public MultipleContentTypeParameterEditor(ILogger logger)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService,Current.Services.TextService, Current.ShortStringHelper)
+ public MultipleContentTypeParameterEditor(ILogger logger, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService,Current.Services.TextService, shortStringHelper)
{
// configure
DefaultConfiguration.Add("multiple", true);
diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleMediaPickerParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleMediaPickerParameterEditor.cs
index f3d0231b13..22a3f9784f 100644
--- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleMediaPickerParameterEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleMediaPickerParameterEditor.cs
@@ -2,6 +2,7 @@
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors.ParameterEditors
{
@@ -19,8 +20,8 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors
///
/// Initializes a new instance of the class.
///
- public MultipleMediaPickerParameterEditor(ILogger logger)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService,Current.ShortStringHelper)
+ public MultipleMediaPickerParameterEditor(ILogger logger, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService, shortStringHelper)
{
DefaultConfiguration.Add("multiPicker", "1");
}
diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyGroupParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyGroupParameterEditor.cs
index 0329645ede..4db3226f39 100644
--- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyGroupParameterEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyGroupParameterEditor.cs
@@ -1,6 +1,7 @@
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors.ParameterEditors
{
@@ -11,8 +12,8 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors
"entitypicker")]
public class MultiplePropertyGroupParameterEditor : DataEditor
{
- public MultiplePropertyGroupParameterEditor(ILogger logger)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService,Current.ShortStringHelper)
+ public MultiplePropertyGroupParameterEditor(ILogger logger, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService, shortStringHelper)
{
// configure
DefaultConfiguration.Add("multiple", true);
diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyTypeParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyTypeParameterEditor.cs
index bce3af2273..9978513810 100644
--- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyTypeParameterEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyTypeParameterEditor.cs
@@ -1,6 +1,7 @@
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors.ParameterEditors
{
@@ -11,8 +12,8 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors
"entitypicker")]
public class MultiplePropertyTypeParameterEditor : DataEditor
{
- public MultiplePropertyTypeParameterEditor(ILogger logger)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService,Current.ShortStringHelper)
+ public MultiplePropertyTypeParameterEditor(ILogger logger, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService, shortStringHelper)
{
// configure
DefaultConfiguration.Add("multiple", "1");
diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyGroupParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyGroupParameterEditor.cs
index e047bab1f5..eff4546645 100644
--- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyGroupParameterEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyGroupParameterEditor.cs
@@ -1,6 +1,7 @@
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors.ParameterEditors
{
@@ -11,8 +12,8 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors
"entitypicker")]
public class PropertyGroupParameterEditor : DataEditor
{
- public PropertyGroupParameterEditor(ILogger logger)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService,Current.ShortStringHelper)
+ public PropertyGroupParameterEditor(ILogger logger, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService, shortStringHelper)
{
// configure
DefaultConfiguration.Add("multiple", "0");
diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyTypeParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyTypeParameterEditor.cs
index b91094a756..e9cf57b7b6 100644
--- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyTypeParameterEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyTypeParameterEditor.cs
@@ -1,6 +1,7 @@
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors.ParameterEditors
{
@@ -11,8 +12,8 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors
"entitypicker")]
public class PropertyTypeParameterEditor : DataEditor
{
- public PropertyTypeParameterEditor(ILogger logger)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService,Current.Services.TextService, Current.ShortStringHelper)
+ public PropertyTypeParameterEditor(ILogger logger, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService,Current.Services.TextService, shortStringHelper)
{
// configure
DefaultConfiguration.Add("multiple", "0");
diff --git a/src/Umbraco.Web/PropertyEditors/RadioButtonsPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RadioButtonsPropertyEditor.cs
index 384e1c0019..005a684c0d 100644
--- a/src/Umbraco.Web/PropertyEditors/RadioButtonsPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/RadioButtonsPropertyEditor.cs
@@ -4,6 +4,7 @@ using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
@@ -25,8 +26,8 @@ namespace Umbraco.Web.PropertyEditors
///
/// The constructor will setup the property editor based on the attribute if one is found
///
- public RadioButtonsPropertyEditor(ILogger logger, ILocalizedTextService textService, IIOHelper ioHelper)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService,Current.Services.TextService, Current.ShortStringHelper)
+ public RadioButtonsPropertyEditor(ILogger logger, ILocalizedTextService textService, IIOHelper ioHelper, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService,Current.Services.TextService, shortStringHelper)
{
_textService = textService;
_ioHelper = ioHelper;
diff --git a/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs
index dcc83f1a3c..f80ee2fa6f 100644
--- a/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs
@@ -29,16 +29,17 @@ namespace Umbraco.Web.PropertyEditors
Icon = "icon-browser-window")]
public class RichTextPropertyEditor : DataEditor
{
- private IUmbracoContextAccessor _umbracoContextAccessor;
+ private readonly IUmbracoContextAccessor _umbracoContextAccessor;
private readonly HtmlImageSourceParser _imageSourceParser;
private readonly HtmlLocalLinkParser _localLinkParser;
private readonly RichTextEditorPastedImages _pastedImages;
private readonly IDataTypeService _dataTypeService;
private readonly ILocalizationService _localizationService;
private readonly IIOHelper _ioHelper;
- private ILogger _logger;
+ private readonly ILogger _logger;
private readonly IMediaService _mediaService;
private readonly IContentTypeBaseServiceProvider _contentTypeBaseServiceProvider;
+ private readonly IShortStringHelper _shortStringHelper;
///
/// The constructor will setup the property editor based on the attribute if one is found
@@ -56,7 +57,7 @@ namespace Umbraco.Web.PropertyEditors
IShortStringHelper shortStringHelper,
IIOHelper ioHelper,
ILocalizedTextService localizedTextService)
- : base(logger, dataTypeService, localizationService, localizedTextService,shortStringHelper)
+ : base(logger, dataTypeService, localizationService, localizedTextService, shortStringHelper)
{
_umbracoContextAccessor = umbracoContextAccessor;
_imageSourceParser = imageSourceParser;
@@ -68,13 +69,14 @@ namespace Umbraco.Web.PropertyEditors
_logger = logger;
_mediaService = mediaService;
_contentTypeBaseServiceProvider = contentTypeBaseServiceProvider;
+ _shortStringHelper = shortStringHelper;
}
///
/// Create a custom value editor
///
///
- protected override IDataValueEditor CreateValueEditor() => new RichTextPropertyValueEditor(Attribute, _mediaService, _contentTypeBaseServiceProvider, _umbracoContextAccessor, _logger, _dataTypeService, _localizationService, _imageSourceParser, _localLinkParser, _pastedImages);
+ protected override IDataValueEditor CreateValueEditor() => new RichTextPropertyValueEditor(Attribute, _mediaService, _contentTypeBaseServiceProvider, _umbracoContextAccessor, _logger, _dataTypeService, _localizationService, _shortStringHelper, _imageSourceParser, _localLinkParser, _pastedImages);
protected override IConfigurationEditor CreateConfigurationEditor() => new RichTextConfigurationEditor(_ioHelper);
@@ -90,8 +92,8 @@ namespace Umbraco.Web.PropertyEditors
private readonly HtmlLocalLinkParser _localLinkParser;
private readonly RichTextEditorPastedImages _pastedImages;
- public RichTextPropertyValueEditor(DataEditorAttribute attribute, IMediaService mediaService, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, IUmbracoContextAccessor umbracoContextAccessor, ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, HtmlImageSourceParser imageSourceParser, HtmlLocalLinkParser localLinkParser, RichTextEditorPastedImages pastedImages)
- : base(dataTypeService, localizationService,Current.Services.TextService, Current.ShortStringHelper, attribute)
+ public RichTextPropertyValueEditor(DataEditorAttribute attribute, IMediaService mediaService, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, IUmbracoContextAccessor umbracoContextAccessor, ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper, HtmlImageSourceParser imageSourceParser, HtmlLocalLinkParser localLinkParser, RichTextEditorPastedImages pastedImages)
+ : base(dataTypeService, localizationService,Current.Services.TextService, shortStringHelper, attribute)
{
_umbracoContextAccessor = umbracoContextAccessor;
_imageSourceParser = imageSourceParser;
diff --git a/src/Umbraco.Web/PropertyEditors/SliderPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/SliderPropertyEditor.cs
index a9feae9a2e..f282b7b682 100644
--- a/src/Umbraco.Web/PropertyEditors/SliderPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/SliderPropertyEditor.cs
@@ -3,6 +3,7 @@ using Umbraco.Core.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
@@ -21,8 +22,8 @@ namespace Umbraco.Web.PropertyEditors
///
/// Initializes a new instance of the class.
///
- public SliderPropertyEditor(ILogger logger, IIOHelper ioHelper)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService,Current.ShortStringHelper)
+ public SliderPropertyEditor(ILogger logger, IIOHelper ioHelper, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService, shortStringHelper)
{
_ioHelper = ioHelper;
}
diff --git a/src/Umbraco.Web/PropertyEditors/TagsPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/TagsPropertyEditor.cs
index 58d738bb53..5682e512ca 100644
--- a/src/Umbraco.Web/PropertyEditors/TagsPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/TagsPropertyEditor.cs
@@ -7,10 +7,10 @@ using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
-using Umbraco.Core.Models;
using Umbraco.Core.Models.Editors;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
@@ -29,22 +29,22 @@ namespace Umbraco.Web.PropertyEditors
private readonly IIOHelper _ioHelper;
private readonly ILocalizedTextService _localizedTextService;
- public TagsPropertyEditor(ManifestValueValidatorCollection validators, ILogger logger, IIOHelper ioHelper, ILocalizedTextService localizedTextService)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService,Current.ShortStringHelper)
+ public TagsPropertyEditor(ManifestValueValidatorCollection validators, ILogger logger, IIOHelper ioHelper, ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService, shortStringHelper)
{
_validators = validators;
_ioHelper = ioHelper;
_localizedTextService = localizedTextService;
}
- protected override IDataValueEditor CreateValueEditor() => new TagPropertyValueEditor(Current.Services.DataTypeService, Current.Services.LocalizationService, Attribute);
+ protected override IDataValueEditor CreateValueEditor() => new TagPropertyValueEditor(Current.Services.DataTypeService, Current.Services.LocalizationService, ShortStringHelper, Attribute);
protected override IConfigurationEditor CreateConfigurationEditor() => new TagConfigurationEditor(_validators, _ioHelper, _localizedTextService);
internal class TagPropertyValueEditor : DataValueEditor
{
- public TagPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute)
- : base(dataTypeService, localizationService,Current.Services.TextService, Current.ShortStringHelper, attribute)
+ public TagPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper, DataEditorAttribute attribute)
+ : base(dataTypeService, localizationService,Current.Services.TextService, shortStringHelper, attribute)
{ }
///
diff --git a/src/Umbraco.Web/PropertyEditors/UserPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/UserPickerPropertyEditor.cs
index 56f2f35c8c..607042f143 100644
--- a/src/Umbraco.Web/PropertyEditors/UserPickerPropertyEditor.cs
+++ b/src/Umbraco.Web/PropertyEditors/UserPickerPropertyEditor.cs
@@ -1,9 +1,8 @@
-using System.ComponentModel;
-using System.Web.Mvc;
-using Umbraco.Core;
+using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
@@ -16,8 +15,8 @@ namespace Umbraco.Web.PropertyEditors
Icon = Constants.Icons.User)]
public class UserPickerPropertyEditor : DataEditor
{
- public UserPickerPropertyEditor(ILogger logger)
- : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService,Current.ShortStringHelper)
+ public UserPickerPropertyEditor(ILogger logger, IShortStringHelper shortStringHelper)
+ : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.Services.TextService, shortStringHelper)
{ }
protected override IConfigurationEditor CreateConfigurationEditor() => new UserPickerConfiguration();
diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs b/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs
index 596fc46874..5daa6de684 100755
--- a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs
+++ b/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
@@ -32,7 +31,6 @@ using File = System.IO.File;
namespace Umbraco.Web.PublishedCache.NuCache
{
-
internal class PublishedSnapshotService : PublishedSnapshotServiceBase
{
private readonly ServiceContext _serviceContext;
@@ -50,6 +48,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
private readonly UrlSegmentProviderCollection _urlSegmentProviders;
private readonly ITypeFinder _typeFinder;
private readonly IHostingEnvironment _hostingEnvironment;
+ private readonly IShortStringHelper _shortStringHelper;
// volatile because we read it with no lock
private volatile bool _isReady;
@@ -84,7 +83,8 @@ namespace Umbraco.Web.PublishedCache.NuCache
IPublishedModelFactory publishedModelFactory,
UrlSegmentProviderCollection urlSegmentProviders,
ITypeFinder typeFinder,
- IHostingEnvironment hostingEnvironment)
+ IHostingEnvironment hostingEnvironment,
+ IShortStringHelper shortStringHelper)
: base(publishedSnapshotAccessor, variationContextAccessor)
{
//if (Interlocked.Increment(ref _singletonCheck) > 1)
@@ -103,6 +103,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
_urlSegmentProviders = urlSegmentProviders;
_typeFinder = typeFinder;
_hostingEnvironment = hostingEnvironment;
+ _shortStringHelper = shortStringHelper;
// we need an Xml serializer here so that the member cache can support XPath,
// for members this is done by navigating the serialized-to-xml member
@@ -1406,7 +1407,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
cultureData[cultureInfo.Culture] = new CultureVariation
{
Name = cultureInfo.Name,
- UrlSegment = content.GetUrlSegment(Current.ShortStringHelper, _urlSegmentProviders, cultureInfo.Culture),
+ UrlSegment = content.GetUrlSegment(_shortStringHelper, _urlSegmentProviders, cultureInfo.Culture),
Date = content.GetUpdateDate(cultureInfo.Culture) ?? DateTime.MinValue,
IsDraft = cultureIsDraft
};
@@ -1418,7 +1419,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
{
PropertyData = propertyData,
CultureData = cultureData,
- UrlSegment = content.GetUrlSegment(Current.ShortStringHelper, _urlSegmentProviders)
+ UrlSegment = content.GetUrlSegment(_shortStringHelper, _urlSegmentProviders)
};
var dto = new ContentNuDto
diff --git a/src/Umbraco.Web/Runtime/WebInitialComponent.cs b/src/Umbraco.Web/Runtime/WebInitialComponent.cs
index 84315211b0..0cf509400c 100644
--- a/src/Umbraco.Web/Runtime/WebInitialComponent.cs
+++ b/src/Umbraco.Web/Runtime/WebInitialComponent.cs
@@ -15,6 +15,7 @@ using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Hosting;
+using Umbraco.Core.Strings;
using Umbraco.Core.IO;
using Umbraco.Core.Strings;
using Umbraco.Web.Install;
@@ -177,7 +178,7 @@ namespace Umbraco.Web.Runtime
umbracoPath + "/RenderMvc/{action}/{id}",
new { controller = "RenderMvc", action = "Index", id = UrlParameter.Optional }
);
- defaultRoute.RouteHandler = new RenderRouteHandler(umbracoContextAccessor, ControllerBuilder.Current.GetControllerFactory(),shortStringHelper);
+ defaultRoute.RouteHandler = new RenderRouteHandler(umbracoContextAccessor, ControllerBuilder.Current.GetControllerFactory(), shortStringHelper);
// register install routes
RouteTable.Routes.RegisterArea();
diff --git a/src/Umbraco.Web/Security/MembershipHelper.cs b/src/Umbraco.Web/Security/MembershipHelper.cs
index 1fcd2bad56..0fac301be7 100644
--- a/src/Umbraco.Web/Security/MembershipHelper.cs
+++ b/src/Umbraco.Web/Security/MembershipHelper.cs
@@ -14,6 +14,7 @@ using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Web.Editors;
using Umbraco.Web.Security.Providers;
using System.ComponentModel.DataAnnotations;
@@ -32,6 +33,7 @@ namespace Umbraco.Web.Security
private readonly IPublicAccessService _publicAccessService;
private readonly AppCaches _appCaches;
private readonly ILogger _logger;
+ private readonly IShortStringHelper _shortStringHelper;
#region Constructors
@@ -45,7 +47,8 @@ namespace Umbraco.Web.Security
IMemberTypeService memberTypeService,
IPublicAccessService publicAccessService,
AppCaches appCaches,
- ILogger logger
+ ILogger logger,
+ IShortStringHelper shortStringHelper
)
{
HttpContext = httpContext;
@@ -55,6 +58,7 @@ namespace Umbraco.Web.Security
_publicAccessService = publicAccessService;
_appCaches = appCaches;
_logger = logger;
+ _shortStringHelper = shortStringHelper;
_membershipProvider = membershipProvider ?? throw new ArgumentNullException(nameof(membershipProvider));
_roleProvider = roleProvider ?? throw new ArgumentNullException(nameof(roleProvider));
@@ -397,7 +401,7 @@ namespace Umbraco.Web.Security
var memberType = _memberTypeService.Get(member.ContentTypeId);
- var builtIns = ConventionsHelper.GetStandardPropertyTypeStubs(Current.ShortStringHelper).Select(x => x.Key).ToArray();
+ var builtIns = ConventionsHelper.GetStandardPropertyTypeStubs(_shortStringHelper).Select(x => x.Key).ToArray();
model.MemberProperties = GetMemberPropertiesViewModel(memberType, builtIns, member).ToList();
@@ -417,7 +421,7 @@ namespace Umbraco.Web.Security
if (memberType == null)
throw new InvalidOperationException("Could not find a member type with alias " + memberTypeAlias);
- var builtIns = ConventionsHelper.GetStandardPropertyTypeStubs(Current.ShortStringHelper).Select(x => x.Key).ToArray();
+ var builtIns = ConventionsHelper.GetStandardPropertyTypeStubs(_shortStringHelper).Select(x => x.Key).ToArray();
var model = RegisterModel.CreateModel();
model.MemberTypeAlias = memberTypeAlias;
model.MemberProperties = GetMemberPropertiesViewModel(memberType, builtIns).ToList();
diff --git a/src/Umbraco.Web/Templates/TemplateRenderer.cs b/src/Umbraco.Web/Templates/TemplateRenderer.cs
index ffcb466727..b13719f6e9 100644
--- a/src/Umbraco.Web/Templates/TemplateRenderer.cs
+++ b/src/Umbraco.Web/Templates/TemplateRenderer.cs
@@ -1,20 +1,16 @@
using System;
-using System.Collections;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Web.Mvc;
using System.Web.Routing;
-using Umbraco.Core;
-using Umbraco.Web.Models;
-using Umbraco.Web.Mvc;
-using Umbraco.Web.Routing;
-using Umbraco.Core.Composing;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
-using Umbraco.Web.Macros;
-using Current = Umbraco.Web.Composing.Current;
+using Umbraco.Web.Models;
+using Umbraco.Web.Mvc;
+using Umbraco.Web.Routing;
+using Umbraco.Core.Strings;
namespace Umbraco.Web.Templates
{
@@ -40,7 +36,7 @@ namespace Umbraco.Web.Templates
_fileService = fileService ?? throw new ArgumentNullException(nameof(fileService));
_languageService = textService ?? throw new ArgumentNullException(nameof(textService));
_webRoutingSection = webRoutingSection ?? throw new ArgumentNullException(nameof(webRoutingSection));
- _shortStringHelper = shortStringHelper;
+ _shortStringHelper = shortStringHelper ?? throw new ArgumentNullException(nameof(shortStringHelper));
}
public void Render(int pageId, int? altTemplateId, StringWriter writer)