From 94f42c32235482f848689b6b2ad2280035793b6f Mon Sep 17 00:00:00 2001 From: Benjamin Carleski Date: Fri, 17 Jan 2020 17:21:50 -0800 Subject: [PATCH 01/12] Update package references to fix compilation error --- src/Umbraco.Examine/Umbraco.Examine.csproj | 2 +- .../Umbraco.ModelsBuilder.Embedded.csproj | 2 +- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 2 +- src/Umbraco.Web/Umbraco.Web.csproj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Examine/Umbraco.Examine.csproj b/src/Umbraco.Examine/Umbraco.Examine.csproj index ea3ce83f5a..48beacdec4 100644 --- a/src/Umbraco.Examine/Umbraco.Examine.csproj +++ b/src/Umbraco.Examine/Umbraco.Examine.csproj @@ -51,7 +51,7 @@ - 1.0.0-beta2-19324-01 + 1.0.0-beta2-19554-01 runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Umbraco.ModelsBuilder.Embedded/Umbraco.ModelsBuilder.Embedded.csproj b/src/Umbraco.ModelsBuilder.Embedded/Umbraco.ModelsBuilder.Embedded.csproj index d1eab15350..073a6566d0 100644 --- a/src/Umbraco.ModelsBuilder.Embedded/Umbraco.ModelsBuilder.Embedded.csproj +++ b/src/Umbraco.ModelsBuilder.Embedded/Umbraco.ModelsBuilder.Embedded.csproj @@ -92,7 +92,7 @@ 2.10.0 - 1.0.0-beta2-19324-01 + 1.0.0-beta2-19554-01 runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index d1de4de358..396ec9b15e 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -98,7 +98,7 @@ - 1.0.0-beta2-19324-01 + 1.0.0-beta2-19554-01 runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 5941e8e986..a273805875 100755 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -81,7 +81,7 @@ - 1.0.0-beta2-19324-01 + 1.0.0-beta2-19554-01 runtime; build; native; contentfiles; analyzers; buildtransitive all From 3320e1a2f0e9a925a1d4274c787f14b3a2fe3b67 Mon Sep 17 00:00:00 2001 From: Benjamin Carleski Date: Fri, 17 Jan 2020 17:22:55 -0800 Subject: [PATCH 02/12] Remove unused obsoletes from Umbraco.Web --- .../Web/Mvc/HtmlStringUtilitiesTests.cs | 8 -- .../UserGroupPermissionsCacheRefresher.cs | 31 ------- .../Editors/EditorModelEventManager.cs | 7 +- src/Umbraco.Web/HtmlHelperRenderExtensions.cs | 9 +- src/Umbraco.Web/HtmlStringUtilities.cs | 13 --- .../Install/Models/InstallPackageModel.cs | 23 ----- ...mbracoAntiForgeryAdditionalDataProvider.cs | 91 ------------------- src/Umbraco.Web/Umbraco.Web.csproj | 3 - src/Umbraco.Web/UmbracoContext.cs | 36 -------- 9 files changed, 5 insertions(+), 216 deletions(-) delete mode 100644 src/Umbraco.Web/Cache/UserGroupPermissionsCacheRefresher.cs delete mode 100644 src/Umbraco.Web/Install/Models/InstallPackageModel.cs delete mode 100644 src/Umbraco.Web/Security/UmbracoAntiForgeryAdditionalDataProvider.cs diff --git a/src/Umbraco.Tests/Web/Mvc/HtmlStringUtilitiesTests.cs b/src/Umbraco.Tests/Web/Mvc/HtmlStringUtilitiesTests.cs index 04bd4f6e15..36ddecc676 100644 --- a/src/Umbraco.Tests/Web/Mvc/HtmlStringUtilitiesTests.cs +++ b/src/Umbraco.Tests/Web/Mvc/HtmlStringUtilitiesTests.cs @@ -15,14 +15,6 @@ namespace Umbraco.Tests.Web.Mvc _htmlStringUtilities = new HtmlStringUtilities(); } - [Test] - public void ReplaceLineBreaksWithHtmlBreak() - { - var output = _htmlStringUtilities.ReplaceLineBreaksForHtml("

hello world

hello world\r\nhello world\rhello world\nhello world

").ToString(); - var expected = "

hello world

hello world
hello world
hello world
hello world

"; - Assert.AreEqual(expected, output); - } - [Test] public void TruncateWithElipsis() { diff --git a/src/Umbraco.Web/Cache/UserGroupPermissionsCacheRefresher.cs b/src/Umbraco.Web/Cache/UserGroupPermissionsCacheRefresher.cs deleted file mode 100644 index 37e02a0149..0000000000 --- a/src/Umbraco.Web/Cache/UserGroupPermissionsCacheRefresher.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.ComponentModel; -using Umbraco.Core.Cache; - -namespace Umbraco.Web.Cache -{ - [Obsolete("This is no longer used and will be removed from the codebase in the future")] - [EditorBrowsable(EditorBrowsableState.Never)] - public sealed class UserGroupPermissionsCacheRefresher : CacheRefresherBase - { - public UserGroupPermissionsCacheRefresher(AppCaches appCaches) - : base(appCaches) - { } - - #region Define - - protected override UserGroupPermissionsCacheRefresher This => this; - - public static readonly Guid UniqueId = Guid.Parse("840AB9C5-5C0B-48DB-A77E-29FE4B80CD3A"); - - public override Guid RefresherUniqueId => UniqueId; - - public override string Name => "User Group Permissions Cache Refresher"; - - #endregion - - #region Refresher - - #endregion - } -} diff --git a/src/Umbraco.Web/Editors/EditorModelEventManager.cs b/src/Umbraco.Web/Editors/EditorModelEventManager.cs index 2b3eb278ee..df4c5e4b36 100644 --- a/src/Umbraco.Web/Editors/EditorModelEventManager.cs +++ b/src/Umbraco.Web/Editors/EditorModelEventManager.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; +using System.Collections.Generic; using System.Web.Http.Filters; using Umbraco.Core.Dashboards; using Umbraco.Core.Events; @@ -18,9 +16,6 @@ namespace Umbraco.Web.Editors public static event TypedEventHandler> SendingMemberModel; public static event TypedEventHandler> SendingUserModel; - [Obsolete("Please Use SendingDashboardSlimModel")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static event TypedEventHandler>>> SendingDashboardModel; public static event TypedEventHandler>>> SendingDashboardSlimModel; private static void OnSendingDashboardModel(HttpActionExecutedContext sender, EditorModelEventArgs>> e) diff --git a/src/Umbraco.Web/HtmlHelperRenderExtensions.cs b/src/Umbraco.Web/HtmlHelperRenderExtensions.cs index 4f4d61b4a8..d71f90aab5 100644 --- a/src/Umbraco.Web/HtmlHelperRenderExtensions.cs +++ b/src/Umbraco.Web/HtmlHelperRenderExtensions.cs @@ -8,7 +8,6 @@ using System.Web.Mvc; using System.Web.Mvc.Html; using System.Web.Routing; using Umbraco.Core; -using Umbraco.Core.IO; using Umbraco.Web.Mvc; using Umbraco.Web.Security; using Current = Umbraco.Web.Composing.Current; @@ -862,14 +861,14 @@ namespace Umbraco.Web private static readonly HtmlStringUtilities StringUtilities = new HtmlStringUtilities(); /// - /// Replaces text line breaks with HTML line breaks + /// HTML encodes the text and replaces text line breaks with HTML line breaks. /// /// /// The text. - /// The text with text line breaks replaced with HTML line breaks (
)
- public static IHtmlString ReplaceLineBreaksForHtml(this HtmlHelper helper, string text) + /// The HTML encoded text with text line breaks replaced with HTML line breaks (<br />). + public static IHtmlString ReplaceLineBreaks(this HtmlHelper helper, string text) { - return StringUtilities.ReplaceLineBreaksForHtml(text); + return StringUtilities.ReplaceLineBreaks(text); } /// diff --git a/src/Umbraco.Web/HtmlStringUtilities.cs b/src/Umbraco.Web/HtmlStringUtilities.cs index 4606a58a3a..8d5e8a9071 100644 --- a/src/Umbraco.Web/HtmlStringUtilities.cs +++ b/src/Umbraco.Web/HtmlStringUtilities.cs @@ -3,10 +3,8 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; -using System.Text.RegularExpressions; using System.Web; using HtmlAgilityPack; -using Umbraco.Web.WebApi.Filters; namespace Umbraco.Web { @@ -15,17 +13,6 @@ namespace Umbraco.Web /// public sealed class HtmlStringUtilities { - /// - /// Replaces text line breaks with HTML line breaks - /// - /// The text. - /// The text with text line breaks replaced with HTML line breaks (<br />). - [Obsolete("This method doesn't HTML encode the text. Use ReplaceLineBreaks instead.")] - public HtmlString ReplaceLineBreaksForHtml(string text) - { - return new HtmlString(text.Replace("\r\n", @"
").Replace("\n", @"
").Replace("\r", @"
")); - } - /// /// HTML encodes the text and replaces text line breaks with HTML line breaks. /// diff --git a/src/Umbraco.Web/Install/Models/InstallPackageModel.cs b/src/Umbraco.Web/Install/Models/InstallPackageModel.cs deleted file mode 100644 index 0c7d270033..0000000000 --- a/src/Umbraco.Web/Install/Models/InstallPackageModel.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.Serialization; -using System.Text; -using System.Threading.Tasks; - -namespace Umbraco.Web.Install.Models -{ - // TODO: do we need this? - [Obsolete("This is only used for the obsolete controller InstallPackageController")] - [DataContract(Name = "installPackage", Namespace = "")] - public class InstallPackageModel - { - [DataMember(Name = "kitGuid")] - public Guid KitGuid { get; set; } - [DataMember(Name = "packageId")] - public int PackageId { get; set; } - [DataMember(Name = "packageFile")] - public string PackageFile { get; set; } - - } -} diff --git a/src/Umbraco.Web/Security/UmbracoAntiForgeryAdditionalDataProvider.cs b/src/Umbraco.Web/Security/UmbracoAntiForgeryAdditionalDataProvider.cs deleted file mode 100644 index 12d7cce753..0000000000 --- a/src/Umbraco.Web/Security/UmbracoAntiForgeryAdditionalDataProvider.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using Umbraco.Web.Mvc; -using Umbraco.Core; -using System.Web.Helpers; -using System.Web; -using Newtonsoft.Json; -using System.ComponentModel; - -namespace Umbraco.Web.Security -{ - [Obsolete("This is no longer used and will be removed from the codebase in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - public class UmbracoAntiForgeryAdditionalDataProvider : IAntiForgeryAdditionalDataProvider - { - private readonly IAntiForgeryAdditionalDataProvider _defaultProvider; - - /// - /// Constructor, allows wrapping a default provider - /// - /// - public UmbracoAntiForgeryAdditionalDataProvider(IAntiForgeryAdditionalDataProvider defaultProvider) - { - _defaultProvider = defaultProvider; - } - - public string GetAdditionalData(HttpContextBase context) - { - return JsonConvert.SerializeObject(new AdditionalData - { - Stamp = DateTime.UtcNow.Ticks, - //this value will be here if this is a BeginUmbracoForms form - Ufprt = context.Items["ufprt"]?.ToString(), - //if there was a wrapped provider, add it's value to the json, else just a static value - WrappedValue = _defaultProvider?.GetAdditionalData(context) ?? "default" - }); - } - - public bool ValidateAdditionalData(HttpContextBase context, string additionalData) - { - if (!additionalData.DetectIsJson()) - return false; //must be json - - AdditionalData json; - try - { - json = JsonConvert.DeserializeObject(additionalData); - } - catch - { - return false; //couldn't parse - } - - if (json.Stamp == default) return false; - - //if there was a wrapped provider, validate it, else validate the static value - var validateWrapped = _defaultProvider?.ValidateAdditionalData(context, json.WrappedValue) ?? json.WrappedValue == "default"; - if (!validateWrapped) - return false; - - var ufprtRequest = context.Request["ufprt"]?.ToString(); - - //if the custom BeginUmbracoForms route value is not there, then it's nothing more to validate - if (ufprtRequest.IsNullOrWhiteSpace() && json.Ufprt.IsNullOrWhiteSpace()) - return true; - - //if one or the other is null then something is wrong - if (!ufprtRequest.IsNullOrWhiteSpace() && json.Ufprt.IsNullOrWhiteSpace()) return false; - if (ufprtRequest.IsNullOrWhiteSpace() && !json.Ufprt.IsNullOrWhiteSpace()) return false; - - if (!UmbracoHelper.DecryptAndValidateEncryptedRouteString(json.Ufprt, out var additionalDataParts)) - return false; - - if (!UmbracoHelper.DecryptAndValidateEncryptedRouteString(ufprtRequest, out var requestParts)) - return false; - - //ensure they all match - return additionalDataParts.Count == requestParts.Count - && additionalDataParts[RenderRouteHandler.ReservedAdditionalKeys.Controller] == requestParts[RenderRouteHandler.ReservedAdditionalKeys.Controller] - && additionalDataParts[RenderRouteHandler.ReservedAdditionalKeys.Action] == requestParts[RenderRouteHandler.ReservedAdditionalKeys.Action] - && additionalDataParts[RenderRouteHandler.ReservedAdditionalKeys.Area] == requestParts[RenderRouteHandler.ReservedAdditionalKeys.Area]; - } - - internal class AdditionalData - { - public string Ufprt { get; set; } - public long Stamp { get; set; } - public string WrappedValue { get; set; } - } - - } -} diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index a273805875..27875a1ab0 100755 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -140,7 +140,6 @@ - @@ -346,7 +345,6 @@ - @@ -722,7 +720,6 @@ - diff --git a/src/Umbraco.Web/UmbracoContext.cs b/src/Umbraco.Web/UmbracoContext.cs index ea8a6d5481..3b00c67b42 100644 --- a/src/Umbraco.Web/UmbracoContext.cs +++ b/src/Umbraco.Web/UmbracoContext.cs @@ -116,23 +116,11 @@ namespace Umbraco.Web /// public IPublishedSnapshot PublishedSnapshot => _publishedSnapshot.Value; - /// - /// Gets the published content cache. - /// - [Obsolete("Use the Content property.")] - public IPublishedContentCache ContentCache => PublishedSnapshot.Content; - /// /// Gets the published content cache. /// public IPublishedContentCache Content => PublishedSnapshot.Content; - /// - /// Gets the published media cache. - /// - [Obsolete("Use the Media property.")] - public IPublishedMediaCache MediaCache => PublishedSnapshot.Media; - /// /// Gets the published media cache. /// @@ -247,30 +235,6 @@ namespace Umbraco.Web return UrlProvider.GetUrl(contentId, mode, culture); } - /// - /// Gets the absolute url of a content identified by its identifier. - /// - /// The content identifier. - /// - /// The absolute url for the content. - [Obsolete("Use the Url() method with UrlMode.Absolute.")] - public string UrlAbsolute(int contentId, string culture = null) - { - return UrlProvider.GetUrl(contentId, UrlMode.Absolute, culture); - } - - /// - /// Gets the absolute url of a content identified by its identifier. - /// - /// The content identifier. - /// - /// The absolute url for the content. - [Obsolete("Use the Url() method with UrlMode.Absolute.")] - public string UrlAbsolute(Guid contentId, string culture = null) - { - return UrlProvider.GetUrl(contentId, UrlMode.Absolute, culture); - } - #endregion private string PreviewToken From 66e32148b2090b34651239c3b271bd4a3d36faaa Mon Sep 17 00:00:00 2001 From: Benjamin Carleski Date: Mon, 20 Jan 2020 10:44:04 -0800 Subject: [PATCH 03/12] Remove unused obsoletes from Umbraco.Abstractions --- .../Composing/Composers.cs | 22 -------- .../Constants-AppSettings.cs | 4 -- .../ArgumentNullOrEmptyException.cs | 55 ------------------- .../Exceptions/WontImplementException.cs | 52 ------------------ .../IO/FileSecurityException.cs | 46 ---------------- .../PublishedModelFactoryExtensions.cs | 19 ------- .../Services/IContentService.cs | 7 --- .../Services/IMediaService.cs | 7 --- src/Umbraco.Configuration/GlobalSettings.cs | 17 ------ .../Services/Implement/ContentService.cs | 7 --- .../Services/Implement/MediaService.cs | 7 --- 11 files changed, 243 deletions(-) delete mode 100644 src/Umbraco.Abstractions/Exceptions/ArgumentNullOrEmptyException.cs delete mode 100644 src/Umbraco.Abstractions/Exceptions/WontImplementException.cs delete mode 100644 src/Umbraco.Abstractions/IO/FileSecurityException.cs diff --git a/src/Umbraco.Abstractions/Composing/Composers.cs b/src/Umbraco.Abstractions/Composing/Composers.cs index b2e6c9d068..004c2527e6 100644 --- a/src/Umbraco.Abstractions/Composing/Composers.cs +++ b/src/Umbraco.Abstractions/Composing/Composers.cs @@ -22,28 +22,6 @@ namespace Umbraco.Core.Composing private const int LogThresholdMilliseconds = 100; - /// - /// Initializes a new instance of the class. - /// - /// The composition. - /// The types. - /// The profiling logger. - [Obsolete("This overload only gets the EnableComposer/DisableComposer attributes from the composerTypes assemblies.")] - public Composers(Composition composition, IEnumerable composerTypes, IProfilingLogger logger) - : this(composition, composerTypes, Enumerable.Empty(), logger) - { - var enableDisableAttributes = new List(); - - var assemblies = composerTypes.Select(t => t.Assembly).Distinct(); - foreach (var assembly in assemblies) - { - enableDisableAttributes.AddRange(assembly.GetCustomAttributes(typeof(EnableComposerAttribute))); - enableDisableAttributes.AddRange(assembly.GetCustomAttributes(typeof(DisableComposerAttribute))); - } - - _enableDisableAttributes = enableDisableAttributes; - } - /// /// Initializes a new instance of the class. /// diff --git a/src/Umbraco.Abstractions/Constants-AppSettings.cs b/src/Umbraco.Abstractions/Constants-AppSettings.cs index beaffef5b4..2217863122 100644 --- a/src/Umbraco.Abstractions/Constants-AppSettings.cs +++ b/src/Umbraco.Abstractions/Constants-AppSettings.cs @@ -9,10 +9,6 @@ namespace Umbraco.Core /// public static class AppSettings { - // TODO: Kill me - still used in Umbraco.Core.IO.SystemFiles:27 - [Obsolete("We need to kill this appsetting as we do not use XML content cache umbraco.config anymore due to NuCache")] - public const string ContentXML = "Umbraco.Core.ContentXML"; //umbracoContentXML - /// /// TODO: FILL ME IN /// diff --git a/src/Umbraco.Abstractions/Exceptions/ArgumentNullOrEmptyException.cs b/src/Umbraco.Abstractions/Exceptions/ArgumentNullOrEmptyException.cs deleted file mode 100644 index 037d35d0ee..0000000000 --- a/src/Umbraco.Abstractions/Exceptions/ArgumentNullOrEmptyException.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace Umbraco.Core.Exceptions -{ - /// - /// The exception that is thrown when a null reference, or an empty argument, is passed to a method that does not accept it as a valid argument. - /// - /// - [Obsolete("Throw an ArgumentNullException when the parameter is null or an ArgumentException when its empty instead.")] - [Serializable] - public class ArgumentNullOrEmptyException : ArgumentNullException - { - /// - /// Initializes a new instance of the class. - /// - public ArgumentNullOrEmptyException() - { } - - /// - /// Initializes a new instance of the class with the name of the parameter that caused this exception. - /// - /// The named of the parameter that caused the exception. - public ArgumentNullOrEmptyException(string paramName) - : base(paramName) - { } - - /// - /// Initializes a new instance of the class with a specified error message and the name of the parameter that caused this exception. - /// - /// The named of the parameter that caused the exception. - /// A message that describes the error. - public ArgumentNullOrEmptyException(string paramName, string message) - : base(paramName, message) - { } - - /// - /// Initializes a new instance of the class. - /// - /// The error message that explains the reason for this exception. - /// The exception that is the cause of the current exception, or a null reference ( in Visual Basic) if no inner exception is specified. - public ArgumentNullOrEmptyException(string message, Exception innerException) - : base(message, innerException) - { } - - /// - /// Initializes a new instance of the class. - /// - /// The object that holds the serialized object data. - /// An object that describes the source or destination of the serialized data. - protected ArgumentNullOrEmptyException(SerializationInfo info, StreamingContext context) - : base(info, context) - { } - } -} diff --git a/src/Umbraco.Abstractions/Exceptions/WontImplementException.cs b/src/Umbraco.Abstractions/Exceptions/WontImplementException.cs deleted file mode 100644 index e354bc4c3d..0000000000 --- a/src/Umbraco.Abstractions/Exceptions/WontImplementException.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace Umbraco.Core.Exceptions -{ - /// - /// The exception that is thrown when a requested method or operation is not, and will not be, implemented. - /// - /// - /// The is to be used when some code is not implemented, - /// but should eventually be implemented (i.e. work in progress) and is reported by tools such as ReSharper. - /// This exception is to be used when some code is not implemented, and is not meant to be, for whatever - /// reason. - /// - /// - [Serializable] - [Obsolete("If a method or operation is not, and will not be, implemented, it is invalid or not supported, so we should throw either an InvalidOperationException or NotSupportedException instead.")] - public class WontImplementException : NotImplementedException - { - /// - /// Initializes a new instance of the class. - /// - public WontImplementException() - { } - - /// - /// Initializes a new instance of the class with a specified reason message. - /// - /// The error message that explains the reason for the exception. - public WontImplementException(string message) - : base(message) - { } - - /// - /// Initializes a new instance of the class. - /// - /// The error message that explains the reason for the exception. - /// The exception that is the cause of the current exception. If the parameter is not , the current exception is raised in a block that handles the inner exception. - public WontImplementException(string message, Exception inner) - : base(message, inner) - { } - - /// - /// Initializes a new instance of the class. - /// - /// The that holds the serialized object data about the exception being thrown. - /// The that contains contextual information about the source or destination. - protected WontImplementException(SerializationInfo info, StreamingContext context) - : base(info, context) - { } - } -} diff --git a/src/Umbraco.Abstractions/IO/FileSecurityException.cs b/src/Umbraco.Abstractions/IO/FileSecurityException.cs deleted file mode 100644 index 8ce9ab34a5..0000000000 --- a/src/Umbraco.Abstractions/IO/FileSecurityException.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace Umbraco.Core.IO -{ - /// - /// The exception that is thrown when the caller does not have the required permission to access a file. - /// - /// - [Obsolete("Throw an UnauthorizedAccessException instead.")] - [Serializable] - public class FileSecurityException : Exception - { - /// - /// Initializes a new instance of the class. - /// - public FileSecurityException() - { } - - /// - /// Initializes a new instance of the class. - /// - /// The message that describes the error. - public FileSecurityException(string message) - : base(message) - { } - - /// - /// Initializes a new instance of the class. - /// - /// The error message that explains the reason for the exception. - /// The exception that is the cause of the current exception, or a null reference ( in Visual Basic) if no inner exception is specified. - public FileSecurityException(string message, Exception innerException) - : base(message, innerException) - { } - - /// - /// Initializes a new instance of the class. - /// - /// The that holds the serialized object data about the exception being thrown. - /// The that contains contextual information about the source or destination. - protected FileSecurityException(SerializationInfo info, StreamingContext context) - : base(info, context) - { } - } -} diff --git a/src/Umbraco.Abstractions/PublishedModelFactoryExtensions.cs b/src/Umbraco.Abstractions/PublishedModelFactoryExtensions.cs index ac8c9f1be7..29ffee8ed4 100644 --- a/src/Umbraco.Abstractions/PublishedModelFactoryExtensions.cs +++ b/src/Umbraco.Abstractions/PublishedModelFactoryExtensions.cs @@ -17,25 +17,6 @@ namespace Umbraco.Core /// public static bool IsLiveFactory(this IPublishedModelFactory factory) => factory is ILivePublishedModelFactory; - [Obsolete("This method is no longer used or necessary and will be removed from future")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static void WithSafeLiveFactory(this IPublishedModelFactory factory, Action action) - { - if (factory is ILivePublishedModelFactory liveFactory) - { - lock (liveFactory.SyncRoot) - { - //Call refresh on the live factory to re-compile the models - liveFactory.Refresh(); - action(); - } - } - else - { - action(); - } - } - /// /// Sets a flag to reset the ModelsBuilder models if the is /// diff --git a/src/Umbraco.Abstractions/Services/IContentService.cs b/src/Umbraco.Abstractions/Services/IContentService.cs index 2a34fcb898..25428f420b 100644 --- a/src/Umbraco.Abstractions/Services/IContentService.cs +++ b/src/Umbraco.Abstractions/Services/IContentService.cs @@ -312,13 +312,6 @@ namespace Umbraco.Core.Services /// OperationResult MoveToRecycleBin(IContent content, int userId = Constants.Security.SuperUserId); - /// - /// Empties the recycle bin. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Use EmptyRecycleBin with explicit indication of user ID instead")] - OperationResult EmptyRecycleBin(); - /// /// Empties the Recycle Bin by deleting all that resides in the bin /// diff --git a/src/Umbraco.Abstractions/Services/IMediaService.cs b/src/Umbraco.Abstractions/Services/IMediaService.cs index 6de2765644..c1537adbc8 100644 --- a/src/Umbraco.Abstractions/Services/IMediaService.cs +++ b/src/Umbraco.Abstractions/Services/IMediaService.cs @@ -156,13 +156,6 @@ namespace Umbraco.Core.Services /// Id of the User deleting the Media Attempt MoveToRecycleBin(IMedia media, int userId = Constants.Security.SuperUserId); - /// - /// Empties the Recycle Bin by deleting all that resides in the bin - /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Use EmptyRecycleBin with explicit indication of user ID instead")] - OperationResult EmptyRecycleBin(); - /// /// Empties the Recycle Bin by deleting all that resides in the bin /// diff --git a/src/Umbraco.Configuration/GlobalSettings.cs b/src/Umbraco.Configuration/GlobalSettings.cs index 499ff787a8..8376082c2a 100644 --- a/src/Umbraco.Configuration/GlobalSettings.cs +++ b/src/Umbraco.Configuration/GlobalSettings.cs @@ -185,23 +185,6 @@ namespace Umbraco.Core.Configuration } } - /// - /// Gets the name of the content XML file. - /// - /// The content XML. - /// - /// Defaults to ~/App_Data/umbraco.config - /// - public string ContentXmlFile - { - get - { - return ConfigurationManager.AppSettings.ContainsKey(Constants.AppSettings.ContentXML) - ? ConfigurationManager.AppSettings[Constants.AppSettings.ContentXML] - : "~/App_Data/umbraco.config"; - } - } - /// /// Gets the path to umbraco's root directory (/umbraco by default). /// diff --git a/src/Umbraco.Infrastructure/Services/Implement/ContentService.cs b/src/Umbraco.Infrastructure/Services/Implement/ContentService.cs index f386f22f39..d02f84d294 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/ContentService.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/ContentService.cs @@ -2030,13 +2030,6 @@ namespace Umbraco.Core.Services.Implement _documentRepository.Save(content); } - /// - /// Empties the Recycle Bin by deleting all that resides in the bin - /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Use EmptyRecycleBin with explicit indication of user ID instead")] - public OperationResult EmptyRecycleBin() => EmptyRecycleBin(Constants.Security.SuperUserId); - /// /// Empties the Recycle Bin by deleting all that resides in the bin /// diff --git a/src/Umbraco.Infrastructure/Services/Implement/MediaService.cs b/src/Umbraco.Infrastructure/Services/Implement/MediaService.cs index 27e428d1d6..14bebc4eb8 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/MediaService.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/MediaService.cs @@ -1029,13 +1029,6 @@ namespace Umbraco.Core.Services.Implement _mediaRepository.Save(media); } - /// - /// Empties the Recycle Bin by deleting all that resides in the bin - /// - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Use EmptyRecycleBin with explicit indication of user ID instead")] - public OperationResult EmptyRecycleBin() => EmptyRecycleBin(Constants.Security.SuperUserId); - /// /// Empties the Recycle Bin by deleting all that resides in the bin /// From 0c1d54ba4d882d041ca7bb0f3acad376d0c40956 Mon Sep 17 00:00:00 2001 From: Benjamin Carleski Date: Mon, 20 Jan 2020 11:07:13 -0800 Subject: [PATCH 04/12] Remove unused obsoletes from Umbraco.Web.UI.Client --- .../Services/ContentServiceTests.cs | 2 - .../TestHelpers/Entities/MockedContent.cs | 2 - .../src/common/resources/log.resource.js | 63 ------------------- .../folderbrowser/folderbrowser.controller.js | 29 --------- .../folderbrowser/folderbrowser.html | 3 - 5 files changed, 99 deletions(-) delete mode 100644 src/Umbraco.Web.UI.Client/src/views/propertyeditors/folderbrowser/folderbrowser.controller.js delete mode 100644 src/Umbraco.Web.UI.Client/src/views/propertyeditors/folderbrowser/folderbrowser.html diff --git a/src/Umbraco.Tests/Services/ContentServiceTests.cs b/src/Umbraco.Tests/Services/ContentServiceTests.cs index e51d8e7a7a..fa47f085c9 100644 --- a/src/Umbraco.Tests/Services/ContentServiceTests.cs +++ b/src/Umbraco.Tests/Services/ContentServiceTests.cs @@ -2372,8 +2372,6 @@ namespace Umbraco.Tests.Services //MCH: I'm guessing this is an issue because of the format the date is actually stored as, right? Cause we don't do any formatting when saving or loading Assert.That(sut.GetValue("dateTime").ToString("G"), Is.EqualTo(content.GetValue("dateTime").ToString("G"))); Assert.That(sut.GetValue("colorPicker"), Is.EqualTo("black")); - //that one is gone in 7.4 - //Assert.That(sut.GetValue("folderBrowser"), Is.Null); Assert.That(sut.GetValue("ddlMultiple"), Is.EqualTo("1234,1235")); Assert.That(sut.GetValue("rbList"), Is.EqualTo("random")); Assert.That(sut.GetValue("date").ToString("G"), Is.EqualTo(content.GetValue("date").ToString("G"))); diff --git a/src/Umbraco.Tests/TestHelpers/Entities/MockedContent.cs b/src/Umbraco.Tests/TestHelpers/Entities/MockedContent.cs index 19a57d7775..dfb7834aff 100644 --- a/src/Umbraco.Tests/TestHelpers/Entities/MockedContent.cs +++ b/src/Umbraco.Tests/TestHelpers/Entities/MockedContent.cs @@ -122,8 +122,6 @@ namespace Umbraco.Tests.TestHelpers.Entities content.SetValue("label", "Non-editable label"); content.SetValue("dateTime", DateTime.Now.AddDays(-20)); content.SetValue("colorPicker", "black"); - //that one is gone in 7.4 - //content.SetValue("folderBrowser", ""); content.SetValue("ddlMultiple", "1234,1235"); content.SetValue("rbList", "random"); content.SetValue("date", DateTime.Now.AddDays(-10)); diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/log.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/log.resource.js index bcdaddd22f..84c0f60e59 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/log.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/log.resource.js @@ -164,69 +164,6 @@ function logResource($q, $http, umbRequestHelper) { 'Failed to retrieve log data for id'); }, - /** - * @ngdoc method - * @name umbraco.resources.logResource#getEntityLog - * @methodOf umbraco.resources.logResource - * - * @description - * [OBSOLETE] use getPagedEntityLog instead
- * Gets the log history for a give entity id - * - * ##usage - *
-         * logResource.getEntityLog(1234)
-         *    .then(function(log) {
-         *        alert('its here!');
-         *    });
-         * 
- * - * @param {Int} id id of entity to return log history - * @returns {Promise} resourcePromise object containing the log. - * - */ - getEntityLog: function(id) { - return umbRequestHelper.resourcePromise( - $http.get( - umbRequestHelper.getApiUrl( - "logApiBaseUrl", - "GetEntityLog", - [{ id: id }])), - 'Failed to retrieve user data for id ' + id); - }, - - /** - * @ngdoc method - * @name umbraco.resources.logResource#getUserLog - * @methodOf umbraco.resources.logResource - * - * @description - * [OBSOLETE] use getPagedUserLog instead
- * Gets the current user's log history for a given type of log entry - * - * ##usage - *
-         * logResource.getUserLog("save", new Date())
-         *    .then(function(log) {
-         *        alert('its here!');
-         *    });
-         * 
- * - * @param {String} type logtype to query for - * @param {DateTime} since query the log back to this date, by defalt 7 days ago - * @returns {Promise} resourcePromise object containing the log. - * - */ - getUserLog: function(type, since) { - return umbRequestHelper.resourcePromise( - $http.get( - umbRequestHelper.getApiUrl( - "logApiBaseUrl", - "GetCurrentUserLog", - [{ logtype: type }, { sinceDate: dateToValidIsoString(since) }])), - 'Failed to retrieve log data for current user of type ' + type + ' since ' + since); - }, - /** * @ngdoc method * @name umbraco.resources.logResource#getLog diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/folderbrowser/folderbrowser.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/folderbrowser/folderbrowser.controller.js deleted file mode 100644 index 5e0cc40db9..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/folderbrowser/folderbrowser.controller.js +++ /dev/null @@ -1,29 +0,0 @@ -angular.module("umbraco") - -//this controller is obsolete and should not be used anymore -//it proxies everything to the system media list view which has overtaken -//all the work this property editor used to perform -.controller("Umbraco.PropertyEditors.FolderBrowserController", - function ($rootScope, $scope, contentTypeResource) { - //get the system media listview - contentTypeResource.getPropertyTypeScaffold(-96) - .then(function(dt) { - - $scope.fakeProperty = { - alias: "contents", - config: dt.config, - description: "", - editor: dt.editor, - hideLabel: true, - id: 1, - label: "Contents:", - validation: { - mandatory: false, - pattern: null - }, - value: "", - view: dt.view - }; - - }); -}); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/folderbrowser/folderbrowser.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/folderbrowser/folderbrowser.html deleted file mode 100644 index 8cf5229750..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/folderbrowser/folderbrowser.html +++ /dev/null @@ -1,3 +0,0 @@ -
- -
From 628373f7a43d0853a4e2bc3524afe8889a5ece7e Mon Sep 17 00:00:00 2001 From: Benjamin Carleski Date: Mon, 20 Jan 2020 11:26:01 -0800 Subject: [PATCH 05/12] Remove obsoletes Umbraco.Infrastructure --- .../Delete/Index/DeleteIndexBuilder.cs | 22 +--- .../Index/IDeleteIndexForTableBuilder.cs | 6 +- .../Index/IDeleteIndexOnColumnBuilder.cs | 23 ---- .../Persistence/EntityNotFoundException.cs | 106 ------------------ 4 files changed, 6 insertions(+), 151 deletions(-) delete mode 100644 src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/IDeleteIndexOnColumnBuilder.cs delete mode 100644 src/Umbraco.Infrastructure/Persistence/EntityNotFoundException.cs diff --git a/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/DeleteIndexBuilder.cs b/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/DeleteIndexBuilder.cs index b3cacb2f95..4aced4378c 100644 --- a/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/DeleteIndexBuilder.cs +++ b/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/DeleteIndexBuilder.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Persistence.DatabaseModelDefinitions; namespace Umbraco.Core.Migrations.Expressions.Delete.Index { public class DeleteIndexBuilder : ExpressionBuilderBase, - IDeleteIndexForTableBuilder, IDeleteIndexOnColumnBuilder + IDeleteIndexForTableBuilder, IExecutableBuilder { public DeleteIndexBuilder(DeleteIndexExpression expression) : base(expression) @@ -14,28 +14,10 @@ namespace Umbraco.Core.Migrations.Expressions.Delete.Index /// public void Do() => Expression.Execute(); - public IndexColumnDefinition CurrentColumn { get; set; } - - public IDeleteIndexOnColumnBuilder OnTable(string tableName) + public IExecutableBuilder OnTable(string tableName) { Expression.Index.TableName = tableName; return this; } - - /// - public IExecutableBuilder OnColumn(string columnName) - { - var column = new IndexColumnDefinition { Name = columnName }; - Expression.Index.Columns.Add(column); - return new ExecutableBuilder(Expression); - } - - /// - public IExecutableBuilder OnColumns(params string[] columnNames) - { - foreach (string columnName in columnNames) - Expression.Index.Columns.Add(new IndexColumnDefinition { Name = columnName }); - return new ExecutableBuilder(Expression); - } } } diff --git a/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/IDeleteIndexForTableBuilder.cs b/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/IDeleteIndexForTableBuilder.cs index 8501c6b02f..8251107cbb 100644 --- a/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/IDeleteIndexForTableBuilder.cs +++ b/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/IDeleteIndexForTableBuilder.cs @@ -1,4 +1,6 @@ -namespace Umbraco.Core.Migrations.Expressions.Delete.Index +using Umbraco.Core.Migrations.Expressions.Common; + +namespace Umbraco.Core.Migrations.Expressions.Delete.Index { /// /// Builds a Delete expression. @@ -8,6 +10,6 @@ /// /// Specifies the table of the index to delete. /// - IDeleteIndexOnColumnBuilder OnTable(string tableName); + IExecutableBuilder OnTable(string tableName); } } diff --git a/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/IDeleteIndexOnColumnBuilder.cs b/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/IDeleteIndexOnColumnBuilder.cs deleted file mode 100644 index 3aa877bf8e..0000000000 --- a/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/Index/IDeleteIndexOnColumnBuilder.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using Umbraco.Core.Migrations.Expressions.Common; - -namespace Umbraco.Core.Migrations.Expressions.Delete.Index -{ - /// - /// Builds a Delete expression. - /// - public interface IDeleteIndexOnColumnBuilder : IFluentBuilder, IExecutableBuilder - { - /// - /// Specifies the column of the index. - /// - [Obsolete("I don't think this would ever be used when dropping an index, see DeleteIndexExpression.ToString")] - IExecutableBuilder OnColumn(string columnName); - - /// - /// Specifies the column of the index. - /// - [Obsolete("I don't think this would ever be used when dropping an index, see DeleteIndexExpression.ToString")] - IExecutableBuilder OnColumns(params string[] columnNames); - } -} diff --git a/src/Umbraco.Infrastructure/Persistence/EntityNotFoundException.cs b/src/Umbraco.Infrastructure/Persistence/EntityNotFoundException.cs deleted file mode 100644 index ea6d5142f0..0000000000 --- a/src/Umbraco.Infrastructure/Persistence/EntityNotFoundException.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace Umbraco.Core.Persistence -{ - /// - /// An exception used to indicate that an Umbraco entity could not be found. - /// - /// - [Obsolete("Instead of throwing an exception, return null or an HTTP 404 status code instead.")] - [Serializable] - public class EntityNotFoundException : Exception - { - /// - /// Gets the identifier. - /// - /// - /// The identifier. - /// - /// - /// This object should be serializable to prevent a to be thrown. - /// - public object Id { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - public EntityNotFoundException() - { } - - /// - /// Initializes a new instance of the class. - /// - /// The identifier. - /// The message. - public EntityNotFoundException(object id, string message) - : base(message) - { - Id = id; - } - - /// - /// Initializes a new instance of the class. - /// - /// The message that describes the error. - public EntityNotFoundException(string message) - : base(message) - { } - - /// - /// Initializes a new instance of the class. - /// - /// The error message that explains the reason for the exception. - /// The exception that is the cause of the current exception, or a null reference ( in Visual Basic) if no inner exception is specified. - public EntityNotFoundException(string message, Exception innerException) - : base(message, innerException) - { } - - /// - /// Initializes a new instance of the class. - /// - /// The that holds the serialized object data about the exception being thrown. - /// The that contains contextual information about the source or destination. - protected EntityNotFoundException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - Id = info.GetValue(nameof(Id), typeof(object)); - } - - /// - /// When overridden in a derived class, sets the with information about the exception. - /// - /// The that holds the serialized object data about the exception being thrown. - /// The that contains contextual information about the source or destination. - /// info - public override void GetObjectData(SerializationInfo info, StreamingContext context) - { - if (info == null) - { - throw new ArgumentNullException(nameof(info)); - } - - info.AddValue(nameof(Id), Id); - - base.GetObjectData(info, context); - } - - /// - /// Returns a that represents this instance. - /// - /// - /// A that represents this instance. - /// - public override string ToString() - { - var result = base.ToString(); - - if (Id != null) - { - return "Umbraco entity (id: " + Id + ") not found. " + result; - } - - return result; - } - } -} From f463fae0473ea3b46132a18558242cbe93f1a3ef Mon Sep 17 00:00:00 2001 From: Benjamin Carleski Date: Mon, 20 Jan 2020 11:26:18 -0800 Subject: [PATCH 06/12] Fix BuilderTests reference --- src/Umbraco.Tests/ModelsBuilder/BuilderTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Tests/ModelsBuilder/BuilderTests.cs b/src/Umbraco.Tests/ModelsBuilder/BuilderTests.cs index e1c3ecc891..56d9d46e7d 100644 --- a/src/Umbraco.Tests/ModelsBuilder/BuilderTests.cs +++ b/src/Umbraco.Tests/ModelsBuilder/BuilderTests.cs @@ -251,7 +251,7 @@ namespace Umbraco.Web.PublishedModels { Alias = "prop3", ClrName = "Prop3", - ModelClrType = typeof(global::Umbraco.Core.IO.FileSecurityException), + ModelClrType = typeof(global::Umbraco.Core.Exceptions.BootFailedException), }); var types = new[] { type1 }; @@ -272,7 +272,7 @@ namespace Umbraco.Web.PublishedModels Assert.IsTrue(gen.Contains(" global::Umbraco.Core.Models.PublishedContent.IPublishedContent Prop1")); Assert.IsTrue(gen.Contains(" global::System.Text.StringBuilder Prop2")); - Assert.IsTrue(gen.Contains(" global::Umbraco.Core.IO.FileSecurityException Prop3")); + Assert.IsTrue(gen.Contains(" global::Umbraco.Core.Exceptions.BootFailedException Prop3")); } [TestCase("int", typeof(int))] From cd4f646ed03df8c6aa9da305e79e33ee1c9042ea Mon Sep 17 00:00:00 2001 From: Benjamin Carleski Date: Mon, 20 Jan 2020 11:45:44 -0800 Subject: [PATCH 07/12] Remove obsolete PublishedContentQuery constructor --- .../PublishedContent/PublishedContentMoreTests.cs | 5 ++++- src/Umbraco.Web/PublishedContentQuery.cs | 6 ------ src/Umbraco.Web/Routing/ContentFinderByConfigured404.cs | 7 +++++-- src/Umbraco.Web/Runtime/WebInitialComposer.cs | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs index a87e3cff8f..db5e59c9c0 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs @@ -7,6 +7,8 @@ using Umbraco.Web; using Umbraco.Core; using Umbraco.Tests.Testing; using Umbraco.Web.Composing; +using Moq; +using Examine; namespace Umbraco.Tests.PublishedContent { @@ -201,7 +203,8 @@ namespace Umbraco.Tests.PublishedContent [Test] public void PublishedContentQueryTypedContentList() { - var query = new PublishedContentQuery(Current.UmbracoContext.PublishedSnapshot, Current.UmbracoContext.VariationContextAccessor); + var examineManager = new Mock(); + var query = new PublishedContentQuery(Current.UmbracoContext.PublishedSnapshot, Current.UmbracoContext.VariationContextAccessor, examineManager.Object); var result = query.Content(new[] { 1, 2, 4 }).ToArray(); Assert.AreEqual(2, result.Length); Assert.AreEqual(1, result[0].Id); diff --git a/src/Umbraco.Web/PublishedContentQuery.cs b/src/Umbraco.Web/PublishedContentQuery.cs index 2dbe4de4c5..1574ac499e 100644 --- a/src/Umbraco.Web/PublishedContentQuery.cs +++ b/src/Umbraco.Web/PublishedContentQuery.cs @@ -22,12 +22,6 @@ namespace Umbraco.Web private readonly IVariationContextAccessor _variationContextAccessor; private readonly IExamineManager _examineManager; - [Obsolete("Use the constructor with all parameters instead")] - public PublishedContentQuery(IPublishedSnapshot publishedSnapshot, IVariationContextAccessor variationContextAccessor) - : this (publishedSnapshot, variationContextAccessor, ExamineManager.Instance) - { - } - /// /// Initializes a new instance of the class. /// diff --git a/src/Umbraco.Web/Routing/ContentFinderByConfigured404.cs b/src/Umbraco.Web/Routing/ContentFinderByConfigured404.cs index eae198bb59..7dc8203d40 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByConfigured404.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByConfigured404.cs @@ -1,3 +1,4 @@ +using Examine; using System.Globalization; using System.Linq; using Umbraco.Core; @@ -16,12 +17,14 @@ namespace Umbraco.Web.Routing private readonly ILogger _logger; private readonly IEntityService _entityService; private readonly IContentSection _contentConfigSection; + private readonly IExamineManager _examineManager; - public ContentFinderByConfigured404(ILogger logger, IEntityService entityService, IContentSection contentConfigSection) + public ContentFinderByConfigured404(ILogger logger, IEntityService entityService, IContentSection contentConfigSection, IExamineManager examineManager) { _logger = logger; _entityService = entityService; _contentConfigSection = contentConfigSection; + _examineManager = examineManager; } /// @@ -62,7 +65,7 @@ namespace Umbraco.Web.Routing var error404 = NotFoundHandlerHelper.GetCurrentNotFoundPageId( _contentConfigSection.Error404Collection.ToArray(), _entityService, - new PublishedContentQuery(frequest.UmbracoContext.PublishedSnapshot, frequest.UmbracoContext.VariationContextAccessor), + new PublishedContentQuery(frequest.UmbracoContext.PublishedSnapshot, frequest.UmbracoContext.VariationContextAccessor, _examineManager), errorCulture); IPublishedContent content = null; diff --git a/src/Umbraco.Web/Runtime/WebInitialComposer.cs b/src/Umbraco.Web/Runtime/WebInitialComposer.cs index 0c87ac78cb..e2d2e59157 100644 --- a/src/Umbraco.Web/Runtime/WebInitialComposer.cs +++ b/src/Umbraco.Web/Runtime/WebInitialComposer.cs @@ -106,7 +106,7 @@ namespace Umbraco.Web.Runtime composition.Register(factory => { var umbCtx = factory.GetInstance(); - return new PublishedContentQuery(umbCtx.UmbracoContext.PublishedSnapshot, factory.GetInstance()); + return new PublishedContentQuery(umbCtx.UmbracoContext.PublishedSnapshot, factory.GetInstance(), factory.GetInstance()); }, Lifetime.Request); composition.Register(Lifetime.Request); From d35b3468e272aa00678033601f615878dcc9a314 Mon Sep 17 00:00:00 2001 From: Benjamin Carleski Date: Mon, 20 Jan 2020 11:46:03 -0800 Subject: [PATCH 08/12] Remove obsolete RebuildIndexes method --- src/Umbraco.Web/Search/ExamineComponent.cs | 4 ---- src/Umbraco.Web/Suspendable.cs | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web/Search/ExamineComponent.cs b/src/Umbraco.Web/Search/ExamineComponent.cs index ab5aa364a3..416513d512 100644 --- a/src/Umbraco.Web/Search/ExamineComponent.cs +++ b/src/Umbraco.Web/Search/ExamineComponent.cs @@ -118,10 +118,6 @@ namespace Umbraco.Web.Search public void Terminate() { } - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method should not be used and will be removed in future versions, rebuilding indexes can be done with the IndexRebuilder or the BackgroundIndexRebuilder")] - public static void RebuildIndexes(IndexRebuilder indexRebuilder, ILogger logger, bool onlyEmptyIndexes, int waitMilliseconds = 0) => Current.Factory.GetInstance().RebuildIndexes(onlyEmptyIndexes, waitMilliseconds); - #region Cache refresher updated event handlers /// diff --git a/src/Umbraco.Web/Suspendable.cs b/src/Umbraco.Web/Suspendable.cs index 619f6d7eda..a1d79d3619 100644 --- a/src/Umbraco.Web/Suspendable.cs +++ b/src/Umbraco.Web/Suspendable.cs @@ -1,4 +1,5 @@ -using Umbraco.Core.Logging; +using Umbraco.Core; +using Umbraco.Core.Logging; using Umbraco.Web.Composing; using Umbraco.Examine; using Umbraco.Web.Cache; @@ -78,8 +79,7 @@ namespace Umbraco.Web if (_tried == false) return; _tried = false; - // TODO: when resuming do we always want a full rebuild of all indexes? - ExamineComponent.RebuildIndexes(indexRebuilder, logger, false); + Current.Factory.GetInstance().RebuildIndexes(false); } } From 421ed582dab40fab22146f7454ce5c74b3bbb287 Mon Sep 17 00:00:00 2001 From: Benjamin Carleski Date: Mon, 20 Jan 2020 11:50:08 -0800 Subject: [PATCH 09/12] Remove obsolete UmbracoIndexesCreator methods --- .../Search/UmbracoIndexesCreator.cs | 28 ++----------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/src/Umbraco.Web/Search/UmbracoIndexesCreator.cs b/src/Umbraco.Web/Search/UmbracoIndexesCreator.cs index aad8303f40..71b5bee108 100644 --- a/src/Umbraco.Web/Search/UmbracoIndexesCreator.cs +++ b/src/Umbraco.Web/Search/UmbracoIndexesCreator.cs @@ -72,7 +72,7 @@ namespace Umbraco.Web.Search IOHelper, RuntimeState, LanguageService, - GetContentValueSetValidator() + UmbracoIndexConfig.GetContentValueSetValidator() ); return index; } @@ -88,7 +88,7 @@ namespace Umbraco.Web.Search IOHelper, RuntimeState, LanguageService, - GetPublishedContentValueSetValidator()); + UmbracoIndexConfig.GetPublishedContentValueSetValidator()); return index; } @@ -102,31 +102,9 @@ namespace Umbraco.Web.Search ProfilingLogger, IOHelper, RuntimeState, - GetMemberValueSetValidator() + UmbracoIndexConfig.GetMemberValueSetValidator() ); return index; } - [Obsolete("This method should not be used and will be removed in future versions. GetContentValueSetValidator was moved to IUmbracoIndexConfig")] - public virtual IContentValueSetValidator GetContentValueSetValidator() - { - return UmbracoIndexConfig.GetContentValueSetValidator(); - } - [Obsolete("This method should not be used and will be removed in future versions. GetPublishedContentValueSetValidator was moved to IUmbracoIndexConfig")] - public virtual IContentValueSetValidator GetPublishedContentValueSetValidator() - { - return UmbracoIndexConfig.GetPublishedContentValueSetValidator(); - } - - /// - /// Returns the for the member indexer - /// - /// - [Obsolete("This method should not be used and will be removed in future versions. GetMemberValueSetValidator was moved to IUmbracoIndexConfig")] - public virtual IValueSetValidator GetMemberValueSetValidator() - { - return UmbracoIndexConfig.GetMemberValueSetValidator(); - } - - } } From 7284ab0400c41a87fbaa1d359e6c7b9572e05fd2 Mon Sep 17 00:00:00 2001 From: Benjamin Carleski Date: Mon, 20 Jan 2020 11:55:04 -0800 Subject: [PATCH 10/12] Remove obsolete UmbracoApiControllerBase constructor --- .../Testing/TestingTests/MockTests.cs | 1 - src/Umbraco.Web/Editors/DashboardController.cs | 6 ++++-- src/Umbraco.Web/WebApi/UmbracoApiController.cs | 6 ------ .../WebApi/UmbracoApiControllerBase.cs | 16 ---------------- .../WebApi/UmbracoAuthorizedApiController.cs | 5 +++-- 5 files changed, 7 insertions(+), 27 deletions(-) diff --git a/src/Umbraco.Tests/Testing/TestingTests/MockTests.cs b/src/Umbraco.Tests/Testing/TestingTests/MockTests.cs index 52e86b36db..121748884a 100644 --- a/src/Umbraco.Tests/Testing/TestingTests/MockTests.cs +++ b/src/Umbraco.Tests/Testing/TestingTests/MockTests.cs @@ -115,7 +115,6 @@ namespace Umbraco.Tests.Testing.TestingTests internal class FakeUmbracoApiController : UmbracoApiController { - public FakeUmbracoApiController(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 FakeUmbracoApiController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, UmbracoMapper umbracoMapper) : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, umbracoMapper) { } } } diff --git a/src/Umbraco.Web/Editors/DashboardController.cs b/src/Umbraco.Web/Editors/DashboardController.cs index 80d4172473..158b0b40e7 100644 --- a/src/Umbraco.Web/Editors/DashboardController.cs +++ b/src/Umbraco.Web/Editors/DashboardController.cs @@ -20,6 +20,7 @@ using Umbraco.Core.Strings; using Umbraco.Core.Dashboards; using Umbraco.Core.Strings; using Umbraco.Web.Services; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Editors { @@ -50,8 +51,9 @@ namespace Umbraco.Web.Editors IDashboardService dashboardService, UmbracoHelper umbracoHelper, IUmbracoVersion umbracoVersion, - IShortStringHelper shortStringHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper) + IShortStringHelper shortStringHelper, + UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, umbracoMapper) { _dashboardService = dashboardService; _umbracoVersion = umbracoVersion; diff --git a/src/Umbraco.Web/WebApi/UmbracoApiController.cs b/src/Umbraco.Web/WebApi/UmbracoApiController.cs index 4600c02ac1..37ccbaec28 100644 --- a/src/Umbraco.Web/WebApi/UmbracoApiController.cs +++ b/src/Umbraco.Web/WebApi/UmbracoApiController.cs @@ -19,12 +19,6 @@ namespace Umbraco.Web.WebApi { } - [Obsolete("This constructor is obsolete since it doesn't inject the UmbracoMapper. The UmbracoMapper will be resolved from the service locator Current.Mapper, which is not good for testability. Inject the UmbracoMapper using full constructor injection instead.")] - protected UmbracoApiController(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 UmbracoApiController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, UmbracoMapper umbracoMapper) : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, umbracoMapper) { diff --git a/src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs b/src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs index cebb5306c9..f019ffe2df 100644 --- a/src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs +++ b/src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs @@ -61,22 +61,6 @@ namespace Umbraco.Web.WebApi Mapper = umbracoMapper; } - [Obsolete("This constructor is obsolete since it doesn't inject the UmbracoMapper. The UmbracoMapper will be resolved from the service locator Current.Mapper, which is not good for testability. Inject the UmbracoMapper using full constructor injection instead.")] - protected UmbracoApiControllerBase(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper) - { - UmbracoContextAccessor = umbracoContextAccessor; - GlobalSettings = globalSettings; - SqlContext = sqlContext; - Services = services; - AppCaches = appCaches; - Logger = logger; - RuntimeState = runtimeState; - Umbraco = umbracoHelper; - - // not good for testability, hence the obsolete. - Mapper = Current.Mapper; - } - /// /// Gets a unique instance identifier. /// diff --git a/src/Umbraco.Web/WebApi/UmbracoAuthorizedApiController.cs b/src/Umbraco.Web/WebApi/UmbracoAuthorizedApiController.cs index cf9707d40b..f41b4cd01a 100644 --- a/src/Umbraco.Web/WebApi/UmbracoAuthorizedApiController.cs +++ b/src/Umbraco.Web/WebApi/UmbracoAuthorizedApiController.cs @@ -8,6 +8,7 @@ using Umbraco.Core.Persistence; using Umbraco.Core.Services; using Umbraco.Web.Models.Identity; using Umbraco.Web.Security; +using Umbraco.Core.Mapping; namespace Umbraco.Web.WebApi { @@ -35,8 +36,8 @@ namespace Umbraco.Web.WebApi { } - protected UmbracoAuthorizedApiController(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 UmbracoAuthorizedApiController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, umbracoMapper) { } From fceac19f044aa75d8df767f53af88a8c92c6f517 Mon Sep 17 00:00:00 2001 From: Benjamin Carleski Date: Mon, 20 Jan 2020 14:15:54 -0800 Subject: [PATCH 11/12] Update controllers to include UmbracoMapper --- .../Web/Controllers/ContentControllerTests.cs | 19 +++++++++++++------ .../Web/Controllers/UsersControllerTests.cs | 13 +++++++++---- .../BackOfficeNotificationsController.cs | 5 +++-- src/Umbraco.Web/Editors/CodeFileController.cs | 7 ++++--- src/Umbraco.Web/Editors/ContentController.cs | 5 +++-- .../Editors/ContentControllerBase.cs | 6 ++++-- .../Editors/ContentTypeController.cs | 5 +++-- .../Editors/ContentTypeControllerBase.cs | 5 +++-- .../Editors/CurrentUserController.cs | 7 ++++--- src/Umbraco.Web/Editors/DataTypeController.cs | 5 +++-- .../Editors/DictionaryController.cs | 5 +++-- src/Umbraco.Web/Editors/EntityController.cs | 7 ++++--- src/Umbraco.Web/Editors/LogController.cs | 6 ++++-- src/Umbraco.Web/Editors/MacrosController.cs | 5 +++-- src/Umbraco.Web/Editors/MediaController.cs | 6 ++++-- .../Editors/MediaTypeController.cs | 5 +++-- src/Umbraco.Web/Editors/MemberController.cs | 6 ++++-- .../Editors/MemberTypeController.cs | 5 +++-- .../Editors/PackageInstallController.cs | 5 +++-- .../Editors/RelationTypeController.cs | 6 ++++-- src/Umbraco.Web/Editors/SectionController.cs | 7 ++++--- src/Umbraco.Web/Editors/TemplateController.cs | 5 +++-- .../Editors/TemplateQueryController.cs | 6 ++++-- .../UmbracoAuthorizedJsonController.cs | 5 +++-- src/Umbraco.Web/Editors/UsersController.cs | 6 ++++-- .../Profiling/WebProfilingController.cs | 5 +++-- .../RichTextPreValueController.cs | 5 +++-- .../Trees/ApplicationTreeController.cs | 5 +++-- .../Trees/ContentTreeController.cs | 3 ++- .../Trees/ContentTreeControllerBase.cs | 3 ++- .../Trees/ContentTypeTreeController.cs | 3 ++- .../Trees/DataTypeTreeController.cs | 3 ++- src/Umbraco.Web/Trees/MediaTreeController.cs | 3 ++- .../Trees/MediaTypeTreeController.cs | 3 ++- .../Trees/TemplatesTreeController.cs | 3 ++- src/Umbraco.Web/Trees/TreeController.cs | 5 +++-- src/Umbraco.Web/Trees/TreeControllerBase.cs | 5 +++-- 37 files changed, 131 insertions(+), 77 deletions(-) diff --git a/src/Umbraco.Tests/Web/Controllers/ContentControllerTests.cs b/src/Umbraco.Tests/Web/Controllers/ContentControllerTests.cs index d514f27345..75960a93cf 100644 --- a/src/Umbraco.Tests/Web/Controllers/ContentControllerTests.cs +++ b/src/Umbraco.Tests/Web/Controllers/ContentControllerTests.cs @@ -34,6 +34,7 @@ using Umbraco.Web.Trees; using Umbraco.Web.WebApi; using Umbraco.Web.Composing; using Task = System.Threading.Tasks.Task; +using Umbraco.Core.Mapping; namespace Umbraco.Tests.Web.Controllers { @@ -268,7 +269,8 @@ namespace Umbraco.Tests.Web.Controllers Factory.GetInstance(), Factory.GetInstance(), helper, - ShortStringHelper); + ShortStringHelper, + Factory.GetInstance()); return controller; } @@ -303,7 +305,8 @@ namespace Umbraco.Tests.Web.Controllers Factory.GetInstance(), Factory.GetInstance(), helper, - ShortStringHelper); + ShortStringHelper, + Factory.GetInstance()); return controller; } @@ -346,7 +349,8 @@ namespace Umbraco.Tests.Web.Controllers Factory.GetInstance(), Factory.GetInstance(), helper, - ShortStringHelper); + ShortStringHelper, + Factory.GetInstance()); return controller; } @@ -394,7 +398,8 @@ namespace Umbraco.Tests.Web.Controllers Factory.GetInstance(), Factory.GetInstance(), helper, - ShortStringHelper); + ShortStringHelper, + Factory.GetInstance()); return controller; } @@ -434,7 +439,8 @@ namespace Umbraco.Tests.Web.Controllers Factory.GetInstance(), Factory.GetInstance(), helper, - ShortStringHelper); + ShortStringHelper, + Factory.GetInstance()); return controller; } @@ -480,7 +486,8 @@ namespace Umbraco.Tests.Web.Controllers Factory.GetInstance(), Factory.GetInstance(), helper, - ShortStringHelper); + ShortStringHelper, + Factory.GetInstance()); return controller; } diff --git a/src/Umbraco.Tests/Web/Controllers/UsersControllerTests.cs b/src/Umbraco.Tests/Web/Controllers/UsersControllerTests.cs index 25cb767eaf..ccd9ff2063 100644 --- a/src/Umbraco.Tests/Web/Controllers/UsersControllerTests.cs +++ b/src/Umbraco.Tests/Web/Controllers/UsersControllerTests.cs @@ -34,6 +34,7 @@ using Umbraco.Web.Editors; using Umbraco.Web.Features; using Umbraco.Web.Models.ContentEditing; using IUser = Umbraco.Core.Models.Membership.IUser; +using Umbraco.Core.Mapping; namespace Umbraco.Tests.Web.Controllers { @@ -88,7 +89,8 @@ namespace Umbraco.Tests.Web.Controllers Factory.GetInstance(), helper, Factory.GetInstance(), - ShortStringHelper); + ShortStringHelper, + Factory.GetInstance()); return usersController; } @@ -154,7 +156,8 @@ namespace Umbraco.Tests.Web.Controllers Factory.GetInstance(), helper, Factory.GetInstance(), - ShortStringHelper); + ShortStringHelper, + Factory.GetInstance()); return usersController; } @@ -191,7 +194,8 @@ namespace Umbraco.Tests.Web.Controllers Factory.GetInstance(), helper, Factory.GetInstance(), - ShortStringHelper); + ShortStringHelper, + Factory.GetInstance()); return usersController; } @@ -263,7 +267,8 @@ namespace Umbraco.Tests.Web.Controllers Factory.GetInstance(), helper, Factory.GetInstance(), - ShortStringHelper); + ShortStringHelper, + Factory.GetInstance()); return usersController; } diff --git a/src/Umbraco.Web/Editors/BackOfficeNotificationsController.cs b/src/Umbraco.Web/Editors/BackOfficeNotificationsController.cs index 24548a8089..883af8e351 100644 --- a/src/Umbraco.Web/Editors/BackOfficeNotificationsController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeNotificationsController.cs @@ -2,6 +2,7 @@ using Umbraco.Core.Cache; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; +using Umbraco.Core.Mapping; using Umbraco.Core.Persistence; using Umbraco.Core.Services; using Umbraco.Core.Strings; @@ -19,8 +20,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, IShortStringHelper shortStringHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + protected BackOfficeNotificationsController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper, UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { } } diff --git a/src/Umbraco.Web/Editors/CodeFileController.cs b/src/Umbraco.Web/Editors/CodeFileController.cs index 96a99830d6..4966c85749 100644 --- a/src/Umbraco.Web/Editors/CodeFileController.cs +++ b/src/Umbraco.Web/Editors/CodeFileController.cs @@ -24,6 +24,7 @@ using Umbraco.Web.WebApi.Filters; using Umbraco.Web.Trees; using Stylesheet = Umbraco.Core.Models.Stylesheet; using StylesheetRule = Umbraco.Web.Models.ContentEditing.StylesheetRule; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Editors { @@ -43,9 +44,9 @@ namespace Umbraco.Web.Editors IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, - IShortStringHelper shortStringHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) - + IShortStringHelper shortStringHelper, + UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { } diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs index 952a924adb..b02e7664a4 100644 --- a/src/Umbraco.Web/Editors/ContentController.cs +++ b/src/Umbraco.Web/Editors/ContentController.cs @@ -38,6 +38,7 @@ using Umbraco.Web.WebApi; using Umbraco.Web.WebApi.Filters; using Constants = Umbraco.Core.Constants; using Umbraco.Core.Strings; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Editors { @@ -69,8 +70,8 @@ namespace Umbraco.Web.Editors IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, - IShortStringHelper shortStringHelper) - : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + IShortStringHelper shortStringHelper, UmbracoMapper umbracoMapper) + : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { _propertyEditors = propertyEditors ?? throw new ArgumentNullException(nameof(propertyEditors)); _allLangs = new Lazy>(() => Services.LocalizationService.GetAllLanguages().ToDictionary(x => x.IsoCode, x => x, StringComparer.InvariantCultureIgnoreCase)); diff --git a/src/Umbraco.Web/Editors/ContentControllerBase.cs b/src/Umbraco.Web/Editors/ContentControllerBase.cs index 4f9e41eeb0..147d28f00b 100644 --- a/src/Umbraco.Web/Editors/ContentControllerBase.cs +++ b/src/Umbraco.Web/Editors/ContentControllerBase.cs @@ -8,6 +8,7 @@ using Umbraco.Core.Cache; using Umbraco.Core.Configuration; using Umbraco.Core.Dictionary; using Umbraco.Core.Logging; +using Umbraco.Core.Mapping; using Umbraco.Core.Models; using Umbraco.Core.Models.Editors; using Umbraco.Core.Persistence; @@ -39,8 +40,9 @@ namespace Umbraco.Web.Editors IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, - IShortStringHelper shortStringHelper) - :base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + IShortStringHelper shortStringHelper, + UmbracoMapper umbracoMapper) + :base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { CultureDictionary = cultureDictionary; } diff --git a/src/Umbraco.Web/Editors/ContentTypeController.cs b/src/Umbraco.Web/Editors/ContentTypeController.cs index b9bde906ea..119c84a927 100644 --- a/src/Umbraco.Web/Editors/ContentTypeController.cs +++ b/src/Umbraco.Web/Editors/ContentTypeController.cs @@ -30,6 +30,7 @@ using Umbraco.Web.WebApi; using Umbraco.Web.WebApi.Filters; using Constants = Umbraco.Core.Constants; using Notification = Umbraco.Web.Models.ContentEditing.Notification; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Editors { @@ -59,8 +60,8 @@ namespace Umbraco.Web.Editors ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IScopeProvider scopeProvider, - IShortStringHelper shortStringHelper) - : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + IShortStringHelper shortStringHelper, UmbracoMapper umbracoMapper) + : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { _serializer = serializer; _globalSettings = globalSettings; diff --git a/src/Umbraco.Web/Editors/ContentTypeControllerBase.cs b/src/Umbraco.Web/Editors/ContentTypeControllerBase.cs index 1e4500ddac..5213953fee 100644 --- a/src/Umbraco.Web/Editors/ContentTypeControllerBase.cs +++ b/src/Umbraco.Web/Editors/ContentTypeControllerBase.cs @@ -11,6 +11,7 @@ using Umbraco.Core.Configuration; using Umbraco.Core.Dictionary; using Umbraco.Core.Exceptions; using Umbraco.Core.Logging; +using Umbraco.Core.Mapping; using Umbraco.Core.Models; using Umbraco.Core.Persistence; using Umbraco.Core.Services; @@ -29,8 +30,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, IShortStringHelper shortStringHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + protected ContentTypeControllerBase(ICultureDictionary cultureDictionary, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper, UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { CultureDictionary = cultureDictionary; } diff --git a/src/Umbraco.Web/Editors/CurrentUserController.cs b/src/Umbraco.Web/Editors/CurrentUserController.cs index b235aabf6a..ffe5858130 100644 --- a/src/Umbraco.Web/Editors/CurrentUserController.cs +++ b/src/Umbraco.Web/Editors/CurrentUserController.cs @@ -20,7 +20,7 @@ using Umbraco.Core.Persistence; using Umbraco.Core.Strings; using Umbraco.Web.Security; using Umbraco.Web.WebApi.Filters; - +using Umbraco.Core.Mapping; namespace Umbraco.Web.Editors { @@ -42,8 +42,9 @@ namespace Umbraco.Web.Editors IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IMediaFileSystem mediaFileSystem, - IShortStringHelper shortStringHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + IShortStringHelper shortStringHelper, + UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { _mediaFileSystem = mediaFileSystem; } diff --git a/src/Umbraco.Web/Editors/DataTypeController.cs b/src/Umbraco.Web/Editors/DataTypeController.cs index 670c574d87..e74d35e013 100644 --- a/src/Umbraco.Web/Editors/DataTypeController.cs +++ b/src/Umbraco.Web/Editors/DataTypeController.cs @@ -21,6 +21,7 @@ using Umbraco.Core.Configuration; using Umbraco.Core.Logging; using Umbraco.Core.Persistence; using Constants = Umbraco.Core.Constants; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Editors { @@ -39,8 +40,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, IShortStringHelper shortStringHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + public DataTypeController(PropertyEditorCollection propertyEditors, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper, UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { _propertyEditors = propertyEditors; } diff --git a/src/Umbraco.Web/Editors/DictionaryController.cs b/src/Umbraco.Web/Editors/DictionaryController.cs index ce808bab1e..394323427b 100644 --- a/src/Umbraco.Web/Editors/DictionaryController.cs +++ b/src/Umbraco.Web/Editors/DictionaryController.cs @@ -8,6 +8,7 @@ using Umbraco.Core; using Umbraco.Core.Cache; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; +using Umbraco.Core.Mapping; using Umbraco.Core.Models; using Umbraco.Core.Persistence; using Umbraco.Core.Services; @@ -34,8 +35,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, IShortStringHelper shortStringHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + public DictionaryController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper, UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { } diff --git a/src/Umbraco.Web/Editors/EntityController.cs b/src/Umbraco.Web/Editors/EntityController.cs index c0a5212535..a9da1bd467 100644 --- a/src/Umbraco.Web/Editors/EntityController.cs +++ b/src/Umbraco.Web/Editors/EntityController.cs @@ -30,6 +30,7 @@ using Umbraco.Web.Trees; using Umbraco.Web.WebApi; using Umbraco.Web.WebApi.Filters; using Constants = Umbraco.Core.Constants; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Editors { @@ -64,9 +65,9 @@ namespace Umbraco.Web.Editors UmbracoHelper umbracoHelper, SearchableTreeCollection searchableTreeCollection, UmbracoTreeSearcher treeSearcher, - IShortStringHelper shortStringHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) - + IShortStringHelper shortStringHelper, + UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { _treeService = treeService; _searchableTreeCollection = searchableTreeCollection; diff --git a/src/Umbraco.Web/Editors/LogController.cs b/src/Umbraco.Web/Editors/LogController.cs index f02a79b574..9493c9eaa1 100644 --- a/src/Umbraco.Web/Editors/LogController.cs +++ b/src/Umbraco.Web/Editors/LogController.cs @@ -6,6 +6,7 @@ using Umbraco.Core.Cache; using Umbraco.Core.Configuration; using Umbraco.Core.IO; using Umbraco.Core.Logging; +using Umbraco.Core.Mapping; using Umbraco.Core.Models; using Umbraco.Core.Persistence; using Umbraco.Core.Services; @@ -34,8 +35,9 @@ namespace Umbraco.Web.Editors IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IMediaFileSystem mediaFileSystem, - IShortStringHelper shortStringHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + IShortStringHelper shortStringHelper, + UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { _mediaFileSystem = mediaFileSystem; } diff --git a/src/Umbraco.Web/Editors/MacrosController.cs b/src/Umbraco.Web/Editors/MacrosController.cs index 12f0933500..6068bf9499 100644 --- a/src/Umbraco.Web/Editors/MacrosController.cs +++ b/src/Umbraco.Web/Editors/MacrosController.cs @@ -19,6 +19,7 @@ using Umbraco.Web.Mvc; using Umbraco.Web.WebApi; using Umbraco.Web.WebApi.Filters; using Constants = Umbraco.Core.Constants; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Editors { @@ -32,8 +33,8 @@ 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, shortStringHelper) + public MacrosController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper, UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { _macroService = Services.MacroService; } diff --git a/src/Umbraco.Web/Editors/MediaController.cs b/src/Umbraco.Web/Editors/MediaController.cs index fee7128f69..7b10957e81 100644 --- a/src/Umbraco.Web/Editors/MediaController.cs +++ b/src/Umbraco.Web/Editors/MediaController.cs @@ -49,6 +49,7 @@ using Umbraco.Web.WebApi.Filters; using Constants = Umbraco.Core.Constants; using Notification = Umbraco.Web.Models.ContentEditing.Notification; using Umbraco.Core.Strings; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Editors { @@ -73,8 +74,9 @@ namespace Umbraco.Web.Editors IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IMediaFileSystem mediaFileSystem, - IShortStringHelper shortStringHelper) - : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + IShortStringHelper shortStringHelper, + UmbracoMapper umbracoMapper) + : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { _propertyEditors = propertyEditors ?? throw new ArgumentNullException(nameof(propertyEditors)); _mediaFileSystem = mediaFileSystem; diff --git a/src/Umbraco.Web/Editors/MediaTypeController.cs b/src/Umbraco.Web/Editors/MediaTypeController.cs index b0f21e26e0..bbfef7414f 100644 --- a/src/Umbraco.Web/Editors/MediaTypeController.cs +++ b/src/Umbraco.Web/Editors/MediaTypeController.cs @@ -21,6 +21,7 @@ using Umbraco.Core.Strings; using Umbraco.Web.Composing; using Constants = Umbraco.Core.Constants; using IMediaType = Umbraco.Core.Models.IMediaType; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Editors { @@ -39,8 +40,8 @@ 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, shortStringHelper) + public MediaTypeController(ICultureDictionary cultureDictionary, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper, UmbracoMapper umbracoMapper) + : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { _shortStringHelper = shortStringHelper; } diff --git a/src/Umbraco.Web/Editors/MemberController.cs b/src/Umbraco.Web/Editors/MemberController.cs index 4c395a56f9..526924933a 100644 --- a/src/Umbraco.Web/Editors/MemberController.cs +++ b/src/Umbraco.Web/Editors/MemberController.cs @@ -32,6 +32,7 @@ using Umbraco.Web.WebApi; using Umbraco.Web.WebApi.Filters; using Constants = Umbraco.Core.Constants; using Umbraco.Core.Strings; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Editors { @@ -56,8 +57,9 @@ namespace Umbraco.Web.Editors IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, - IShortStringHelper shortStringHelper) - : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + IShortStringHelper shortStringHelper, + UmbracoMapper umbracoMapper) + : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { _passwordConfig = passwordConfig ?? throw new ArgumentNullException(nameof(passwordConfig)); _propertyEditors = propertyEditors ?? throw new ArgumentNullException(nameof(propertyEditors)); diff --git a/src/Umbraco.Web/Editors/MemberTypeController.cs b/src/Umbraco.Web/Editors/MemberTypeController.cs index 8f425323d7..1270e5fc0a 100644 --- a/src/Umbraco.Web/Editors/MemberTypeController.cs +++ b/src/Umbraco.Web/Editors/MemberTypeController.cs @@ -18,6 +18,7 @@ using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Mvc; using Umbraco.Web.WebApi.Filters; using Constants = Umbraco.Core.Constants; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Editors { @@ -28,8 +29,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, IShortStringHelper shortStringHelper) - : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + public MemberTypeController(ICultureDictionary cultureDictionary, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper, UmbracoMapper umbracoMapper) + : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { } diff --git a/src/Umbraco.Web/Editors/PackageInstallController.cs b/src/Umbraco.Web/Editors/PackageInstallController.cs index 5851d64eba..744733d1f2 100644 --- a/src/Umbraco.Web/Editors/PackageInstallController.cs +++ b/src/Umbraco.Web/Editors/PackageInstallController.cs @@ -25,6 +25,7 @@ using Umbraco.Web.WebApi; using Umbraco.Web.WebApi.Filters; using File = System.IO.File; using Notification = Umbraco.Web.Models.ContentEditing.Notification; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Editors { @@ -39,8 +40,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, IShortStringHelper shortStringHelper, IUmbracoVersion umbracoVersion) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper, IUmbracoVersion umbracoVersion, UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { _umbracoVersion = umbracoVersion; diff --git a/src/Umbraco.Web/Editors/RelationTypeController.cs b/src/Umbraco.Web/Editors/RelationTypeController.cs index 55b3ced23a..73a659bde5 100644 --- a/src/Umbraco.Web/Editors/RelationTypeController.cs +++ b/src/Umbraco.Web/Editors/RelationTypeController.cs @@ -17,6 +17,7 @@ using Umbraco.Web.Mvc; using Umbraco.Web.WebApi; using Umbraco.Web.WebApi.Filters; using Constants = Umbraco.Core.Constants; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Editors { @@ -37,8 +38,9 @@ namespace Umbraco.Web.Editors IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, - IShortStringHelper shortStringHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + IShortStringHelper shortStringHelper, + UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { } diff --git a/src/Umbraco.Web/Editors/SectionController.cs b/src/Umbraco.Web/Editors/SectionController.cs index 102f962ecb..a4d41fcb35 100644 --- a/src/Umbraco.Web/Editors/SectionController.cs +++ b/src/Umbraco.Web/Editors/SectionController.cs @@ -13,6 +13,7 @@ using Umbraco.Web.Trees; using Section = Umbraco.Web.Models.ContentEditing.Section; using Umbraco.Web.Models.Trees; using Umbraco.Web.Services; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Editors { @@ -27,8 +28,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, IShortStringHelper shortStringHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + IDashboardService dashboardService, ISectionService sectionService, ITreeService treeService, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper, UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { _dashboardService = dashboardService; _sectionService = sectionService; @@ -43,7 +44,7 @@ namespace Umbraco.Web.Editors // this is a bit nasty since we'll be proxying via the app tree controller but we sort of have to do that // since tree's by nature are controllers and require request contextual data - var appTreeController = new ApplicationTreeController(GlobalSettings, UmbracoContextAccessor, SqlContext, Services, AppCaches, Logger, RuntimeState, _treeService, _sectionService, Umbraco) + var appTreeController = new ApplicationTreeController(GlobalSettings, UmbracoContextAccessor, SqlContext, Services, AppCaches, Logger, RuntimeState, _treeService, _sectionService, Umbraco, Mapper) { ControllerContext = ControllerContext }; diff --git a/src/Umbraco.Web/Editors/TemplateController.cs b/src/Umbraco.Web/Editors/TemplateController.cs index 524ecea1eb..92c4b53227 100644 --- a/src/Umbraco.Web/Editors/TemplateController.cs +++ b/src/Umbraco.Web/Editors/TemplateController.cs @@ -9,6 +9,7 @@ using Umbraco.Core.Cache; using Umbraco.Core.Configuration; using Umbraco.Core.IO; using Umbraco.Core.Logging; +using Umbraco.Core.Mapping; using Umbraco.Core.Models; using Umbraco.Core.Persistence; using Umbraco.Core.Services; @@ -24,8 +25,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, IShortStringHelper shortStringHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + public TemplateController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper, UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { } diff --git a/src/Umbraco.Web/Editors/TemplateQueryController.cs b/src/Umbraco.Web/Editors/TemplateQueryController.cs index 09bf8e23d4..193c8391c8 100644 --- a/src/Umbraco.Web/Editors/TemplateQueryController.cs +++ b/src/Umbraco.Web/Editors/TemplateQueryController.cs @@ -7,6 +7,7 @@ using Umbraco.Core; using Umbraco.Core.Cache; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; +using Umbraco.Core.Mapping; using Umbraco.Core.Models.PublishedContent; using Umbraco.Core.Persistence; using Umbraco.Core.Services; @@ -36,8 +37,9 @@ namespace Umbraco.Web.Editors IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IVariationContextAccessor variationContextAccessor, - IShortStringHelper shortStringHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + IShortStringHelper shortStringHelper, + UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { _variationContextAccessor = variationContextAccessor; } diff --git a/src/Umbraco.Web/Editors/UmbracoAuthorizedJsonController.cs b/src/Umbraco.Web/Editors/UmbracoAuthorizedJsonController.cs index 4f8876738b..1a432981c8 100644 --- a/src/Umbraco.Web/Editors/UmbracoAuthorizedJsonController.cs +++ b/src/Umbraco.Web/Editors/UmbracoAuthorizedJsonController.cs @@ -3,6 +3,7 @@ using Umbraco.Core; using Umbraco.Core.Cache; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; +using Umbraco.Core.Mapping; using Umbraco.Core.Persistence; using Umbraco.Core.Services; using Umbraco.Core.Strings; @@ -26,8 +27,8 @@ namespace Umbraco.Web.Editors { } - 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) + protected UmbracoAuthorizedJsonController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper, UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, umbracoMapper) { ShortStringHelper = shortStringHelper ?? throw new ArgumentNullException(nameof(shortStringHelper)); } diff --git a/src/Umbraco.Web/Editors/UsersController.cs b/src/Umbraco.Web/Editors/UsersController.cs index 2fc79baa44..8eafcd1fda 100644 --- a/src/Umbraco.Web/Editors/UsersController.cs +++ b/src/Umbraco.Web/Editors/UsersController.cs @@ -34,6 +34,7 @@ using Umbraco.Web.WebApi.Filters; using Constants = Umbraco.Core.Constants; using IUser = Umbraco.Core.Models.Membership.IUser; using Task = System.Threading.Tasks.Task; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Editors { @@ -55,8 +56,9 @@ namespace Umbraco.Web.Editors IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IMediaFileSystem mediaFileSystem, - IShortStringHelper shortStringHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + IShortStringHelper shortStringHelper, + UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { _mediaFileSystem = mediaFileSystem; } diff --git a/src/Umbraco.Web/Profiling/WebProfilingController.cs b/src/Umbraco.Web/Profiling/WebProfilingController.cs index 218ecd0669..fefe52391c 100644 --- a/src/Umbraco.Web/Profiling/WebProfilingController.cs +++ b/src/Umbraco.Web/Profiling/WebProfilingController.cs @@ -2,6 +2,7 @@ using Umbraco.Core.Cache; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; +using Umbraco.Core.Mapping; using Umbraco.Core.Persistence; using Umbraco.Core.Services; using Umbraco.Core.Strings; @@ -18,8 +19,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, IShortStringHelper shortStringHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + public WebProfilingController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper, UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { _runtimeState = runtimeState; } diff --git a/src/Umbraco.Web/PropertyEditors/RichTextPreValueController.cs b/src/Umbraco.Web/PropertyEditors/RichTextPreValueController.cs index 698b3f46b3..1c41479dcd 100644 --- a/src/Umbraco.Web/PropertyEditors/RichTextPreValueController.cs +++ b/src/Umbraco.Web/PropertyEditors/RichTextPreValueController.cs @@ -12,6 +12,7 @@ using Umbraco.Core.Strings; using Umbraco.Web.Editors; using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Mvc; +using Umbraco.Core.Mapping; namespace Umbraco.Web.PropertyEditors { @@ -23,8 +24,8 @@ namespace Umbraco.Web.PropertyEditors { private readonly IIOHelper _ioHelper; - public RichTextPreValueController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper, IIOHelper ioHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper) + public RichTextPreValueController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper, IIOHelper ioHelper, UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper, umbracoMapper) { _ioHelper = ioHelper; } diff --git a/src/Umbraco.Web/Trees/ApplicationTreeController.cs b/src/Umbraco.Web/Trees/ApplicationTreeController.cs index f0a860496e..dea6642376 100644 --- a/src/Umbraco.Web/Trees/ApplicationTreeController.cs +++ b/src/Umbraco.Web/Trees/ApplicationTreeController.cs @@ -13,6 +13,7 @@ using Umbraco.Core; using Umbraco.Core.Cache; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; +using Umbraco.Core.Mapping; using Umbraco.Core.Persistence; using Umbraco.Core.Services; using Umbraco.Web.Models.Trees; @@ -36,8 +37,8 @@ namespace Umbraco.Web.Trees public ApplicationTreeController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, - IRuntimeState runtimeState, ITreeService treeService, ISectionService sectionService, UmbracoHelper umbracoHelper) - : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper) + IRuntimeState runtimeState, ITreeService treeService, ISectionService sectionService, UmbracoHelper umbracoHelper, UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, umbracoMapper) { _treeService = treeService; _sectionService = sectionService; diff --git a/src/Umbraco.Web/Trees/ContentTreeController.cs b/src/Umbraco.Web/Trees/ContentTreeController.cs index 1a56642a74..14612de02d 100644 --- a/src/Umbraco.Web/Trees/ContentTreeController.cs +++ b/src/Umbraco.Web/Trees/ContentTreeController.cs @@ -19,6 +19,7 @@ using Umbraco.Core.Configuration; using Umbraco.Core.Logging; using Umbraco.Core.Persistence; using Constants = Umbraco.Core.Constants; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Trees { @@ -50,7 +51,7 @@ namespace Umbraco.Web.Trees protected override int[] UserStartNodes => _userStartNodes ?? (_userStartNodes = Security.CurrentUser.CalculateContentStartNodeIds(Services.EntityService)); - public ContentTreeController(UmbracoTreeSearcher treeSearcher, ActionCollection actions, 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 ContentTreeController(UmbracoTreeSearcher treeSearcher, ActionCollection actions, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, UmbracoMapper umbracoMapper) : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, umbracoMapper) { _treeSearcher = treeSearcher; _actions = actions; diff --git a/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs b/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs index 9b43f54130..2c6370e1e2 100644 --- a/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs +++ b/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs @@ -21,13 +21,14 @@ using Umbraco.Core.Security; using Umbraco.Core.Cache; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Trees { public abstract class ContentTreeControllerBase : TreeController { - protected ContentTreeControllerBase(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 ContentTreeControllerBase(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, UmbracoMapper umbracoMapper) : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, umbracoMapper) { } diff --git a/src/Umbraco.Web/Trees/ContentTypeTreeController.cs b/src/Umbraco.Web/Trees/ContentTypeTreeController.cs index e8f8fb9f75..a932fbc594 100644 --- a/src/Umbraco.Web/Trees/ContentTypeTreeController.cs +++ b/src/Umbraco.Web/Trees/ContentTypeTreeController.cs @@ -6,6 +6,7 @@ using Umbraco.Core; using Umbraco.Core.Cache; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; +using Umbraco.Core.Mapping; using Umbraco.Core.Models; using Umbraco.Core.Models.Entities; using Umbraco.Core.Persistence; @@ -26,7 +27,7 @@ namespace Umbraco.Web.Trees { private readonly UmbracoTreeSearcher _treeSearcher; - public ContentTypeTreeController(UmbracoTreeSearcher treeSearcher, 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 ContentTypeTreeController(UmbracoTreeSearcher treeSearcher, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, UmbracoMapper umbracoMapper) : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, umbracoMapper) { _treeSearcher = treeSearcher; } diff --git a/src/Umbraco.Web/Trees/DataTypeTreeController.cs b/src/Umbraco.Web/Trees/DataTypeTreeController.cs index b39feeae6c..3a2f3157a7 100644 --- a/src/Umbraco.Web/Trees/DataTypeTreeController.cs +++ b/src/Umbraco.Web/Trees/DataTypeTreeController.cs @@ -17,6 +17,7 @@ using Umbraco.Core.Logging; using Umbraco.Core.Persistence; using Umbraco.Web.Search; using Constants = Umbraco.Core.Constants; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Trees { @@ -28,7 +29,7 @@ namespace Umbraco.Web.Trees { private readonly UmbracoTreeSearcher _treeSearcher; - public DataTypeTreeController(UmbracoTreeSearcher treeSearcher, 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 DataTypeTreeController(UmbracoTreeSearcher treeSearcher, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, UmbracoMapper umbracoMapper) : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, umbracoMapper) { _treeSearcher = treeSearcher; } diff --git a/src/Umbraco.Web/Trees/MediaTreeController.cs b/src/Umbraco.Web/Trees/MediaTreeController.cs index d3ca44a0ac..dfe1b5cb5a 100644 --- a/src/Umbraco.Web/Trees/MediaTreeController.cs +++ b/src/Umbraco.Web/Trees/MediaTreeController.cs @@ -20,6 +20,7 @@ using Umbraco.Core.Configuration; using Umbraco.Core.Logging; using Umbraco.Core.Persistence; using Constants = Umbraco.Core.Constants; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Trees { @@ -39,7 +40,7 @@ namespace Umbraco.Web.Trees { private readonly UmbracoTreeSearcher _treeSearcher; - public MediaTreeController(UmbracoTreeSearcher treeSearcher, 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 MediaTreeController(UmbracoTreeSearcher treeSearcher, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, UmbracoMapper umbracoMapper) : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, umbracoMapper) { _treeSearcher = treeSearcher; } diff --git a/src/Umbraco.Web/Trees/MediaTypeTreeController.cs b/src/Umbraco.Web/Trees/MediaTypeTreeController.cs index f85aefcace..db659d7939 100644 --- a/src/Umbraco.Web/Trees/MediaTypeTreeController.cs +++ b/src/Umbraco.Web/Trees/MediaTypeTreeController.cs @@ -15,6 +15,7 @@ using Umbraco.Core.Configuration; using Umbraco.Core.Logging; using Umbraco.Core.Persistence; using Umbraco.Web.Search; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Trees { @@ -26,7 +27,7 @@ namespace Umbraco.Web.Trees { private readonly UmbracoTreeSearcher _treeSearcher; - public MediaTypeTreeController(UmbracoTreeSearcher treeSearcher, 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 MediaTypeTreeController(UmbracoTreeSearcher treeSearcher, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, UmbracoMapper umbracoMapper) : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, umbracoMapper) { _treeSearcher = treeSearcher; } diff --git a/src/Umbraco.Web/Trees/TemplatesTreeController.cs b/src/Umbraco.Web/Trees/TemplatesTreeController.cs index d0ca8d1b2e..d7247208c7 100644 --- a/src/Umbraco.Web/Trees/TemplatesTreeController.cs +++ b/src/Umbraco.Web/Trees/TemplatesTreeController.cs @@ -6,6 +6,7 @@ using Umbraco.Core; using Umbraco.Core.Cache; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; +using Umbraco.Core.Mapping; using Umbraco.Core.Models; using Umbraco.Core.Models.Entities; using Umbraco.Core.Persistence; @@ -28,7 +29,7 @@ namespace Umbraco.Web.Trees { private readonly UmbracoTreeSearcher _treeSearcher; - public TemplatesTreeController(UmbracoTreeSearcher treeSearcher, 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 TemplatesTreeController(UmbracoTreeSearcher treeSearcher, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, UmbracoMapper umbracoMapper) : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, umbracoMapper) { _treeSearcher = treeSearcher; } diff --git a/src/Umbraco.Web/Trees/TreeController.cs b/src/Umbraco.Web/Trees/TreeController.cs index be862a8390..b580ebdb34 100644 --- a/src/Umbraco.Web/Trees/TreeController.cs +++ b/src/Umbraco.Web/Trees/TreeController.cs @@ -4,6 +4,7 @@ using Umbraco.Core; using Umbraco.Core.Cache; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; +using Umbraco.Core.Mapping; using Umbraco.Core.Persistence; using Umbraco.Core.Services; @@ -18,8 +19,8 @@ namespace Umbraco.Web.Trees private readonly TreeAttribute _treeAttribute; - protected TreeController(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 TreeController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, umbracoMapper) { _treeAttribute = GetTreeAttribute(); } diff --git a/src/Umbraco.Web/Trees/TreeControllerBase.cs b/src/Umbraco.Web/Trees/TreeControllerBase.cs index 77e5ebef62..a0a736f68a 100644 --- a/src/Umbraco.Web/Trees/TreeControllerBase.cs +++ b/src/Umbraco.Web/Trees/TreeControllerBase.cs @@ -16,6 +16,7 @@ using Umbraco.Web.Models.Trees; using Umbraco.Web.WebApi; using Umbraco.Web.WebApi.Filters; using Umbraco.Core.Services; +using Umbraco.Core.Mapping; namespace Umbraco.Web.Trees { @@ -32,8 +33,8 @@ namespace Umbraco.Web.Trees { } - protected TreeControllerBase(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 TreeControllerBase(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, UmbracoMapper umbracoMapper) + : base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, umbracoMapper) { } From 1ee09af4f3a893182d6994d3fdc4ea1fc0affb8c Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Tue, 21 Jan 2020 09:01:11 +0100 Subject: [PATCH 12/12] 7368 - Updated view to use the new name of ReplaceLineBreaksForHtml --- .../Views/Partials/Grid/Editors/TextString.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/TextString.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/TextString.cshtml index 1001d10ec6..0e47b5bd78 100644 --- a/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/TextString.cshtml +++ b/src/Umbraco.Web.UI/Views/Partials/Grid/Editors/TextString.cshtml @@ -5,7 +5,7 @@ @if (Model.editor.config.markup != null) { string markup = Model.editor.config.markup.ToString(); - markup = markup.Replace("#value#", Html.ReplaceLineBreaksForHtml(HttpUtility.HtmlEncode((string)Model.value.ToString())).ToString()); + markup = markup.Replace("#value#", Html.ReplaceLineBreaks(HttpUtility.HtmlEncode((string)Model.value.ToString())).ToString()); if (Model.editor.config.style != null) {