diff --git a/src/Umbraco.Core/Composing/ComponentCollection.cs b/src/Umbraco.Core/Composing/ComponentCollection.cs index 62b240f10f..6501a3a28c 100644 --- a/src/Umbraco.Core/Composing/ComponentCollection.cs +++ b/src/Umbraco.Core/Composing/ComponentCollection.cs @@ -51,7 +51,7 @@ namespace Umbraco.Core.Composing } catch (Exception ex) { - _logger.Error(ex, "Error while terminating component {ComponentType}.", componentType.FullName); + _logger.Error(ex, "Error while terminating component {ComponentType}.", componentType.FullName); } } } diff --git a/src/Umbraco.Core/Composing/Composers.cs b/src/Umbraco.Core/Composing/Composers.cs index b2e6c9d068..1528c6760d 100644 --- a/src/Umbraco.Core/Composing/Composers.cs +++ b/src/Umbraco.Core/Composing/Composers.cs @@ -114,7 +114,7 @@ namespace Umbraco.Core.Composing // bit verbose but should help for troubleshooting //var text = "Ordered Composers: " + Environment.NewLine + string.Join(Environment.NewLine, sortedComposerTypes) + Environment.NewLine; - _logger.Debug("Ordered Composers: {SortedComposerTypes}", sortedComposerTypes); + _logger.Debug>("Ordered Composers: {SortedComposerTypes}", sortedComposerTypes); return sortedComposerTypes; } @@ -205,7 +205,7 @@ namespace Umbraco.Core.Composing catch (Exception e) { // in case of an error, force-dump everything to log - _logger.Info("Composer Report:\r\n{ComposerReport}", GetComposersReport(requirements)); + _logger.Info("Composer Report:\r\n{ComposerReport}", GetComposersReport(requirements)); _logger.Error(e, "Failed to sort composers."); throw; } diff --git a/src/Umbraco.Core/Composing/TypeFinder.cs b/src/Umbraco.Core/Composing/TypeFinder.cs index 394d9480ae..5bf9eb89a9 100644 --- a/src/Umbraco.Core/Composing/TypeFinder.cs +++ b/src/Umbraco.Core/Composing/TypeFinder.cs @@ -11,7 +11,7 @@ using System.Web.Compilation; using System.Web.Hosting; using Umbraco.Core.Composing; using Umbraco.Core.IO; - +using Umbraco.Core.Logging; namespace Umbraco.Core.Composing { /// @@ -441,7 +441,7 @@ namespace Umbraco.Core.Composing } catch (TypeLoadException ex) { - Current.Logger.Error(typeof(TypeFinder), ex, "Could not query types on {Assembly} assembly, this is most likely due to this assembly not being compatible with the current Umbraco version", assembly); + Current.Logger.Error(typeof(TypeFinder), ex, "Could not query types on {Assembly} assembly, this is most likely due to this assembly not being compatible with the current Umbraco version", assembly); continue; } @@ -507,7 +507,7 @@ namespace Umbraco.Core.Composing } catch (TypeLoadException ex) { - Current.Logger.Error(typeof(TypeFinder), ex, "Could not query types on {Assembly} assembly, this is most likely due to this assembly not being compatible with the current Umbraco version", assembly); + Current.Logger.Error(typeof(TypeFinder), ex, "Could not query types on {Assembly} assembly, this is most likely due to this assembly not being compatible with the current Umbraco version", assembly); continue; } diff --git a/src/Umbraco.Core/Composing/TypeLoader.cs b/src/Umbraco.Core/Composing/TypeLoader.cs index 6d0b1a0514..f5c75ff607 100644 --- a/src/Umbraco.Core/Composing/TypeLoader.cs +++ b/src/Umbraco.Core/Composing/TypeLoader.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; +using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Text; using System.Threading; @@ -477,7 +478,7 @@ namespace Umbraco.Core.Composing if (--attempts == 0) throw; - _logger.Debug("Attempted to get filestream for file {Path} failed, {NumberOfAttempts} attempts left, pausing for {PauseMilliseconds} milliseconds", path, attempts, pauseMilliseconds); + _logger.Debug("Attempted to get filestream for file {Path} failed, {NumberOfAttempts} attempts left, pausing for {PauseMilliseconds} milliseconds", path, attempts, pauseMilliseconds); Thread.Sleep(pauseMilliseconds); } } @@ -498,7 +499,7 @@ namespace Umbraco.Core.Composing if (--attempts == 0) throw; - _logger.Debug("Attempted to delete file {Path} failed, {NumberOfAttempts} attempts left, pausing for {PauseMilliseconds} milliseconds", path, attempts, pauseMilliseconds); + _logger.Debug("Attempted to delete file {Path} failed, {NumberOfAttempts} attempts left, pausing for {PauseMilliseconds} milliseconds", path, attempts, pauseMilliseconds); Thread.Sleep(pauseMilliseconds); } } @@ -571,7 +572,7 @@ namespace Umbraco.Core.Composing if (!typeof(IDiscoverable).IsAssignableFrom(typeof(T))) { // warn - _logger.Debug("Running a full, " + (cache ? "" : "non-") + "cached, scan for non-discoverable type {TypeName} (slow).", typeof(T).FullName); + _logger.Debug("Running a full, " + (cache ? "" : "non-") + "cached, scan for non-discoverable type {TypeName} (slow).", typeof(T).FullName); return GetTypesInternal( typeof(T), null, @@ -589,7 +590,7 @@ namespace Umbraco.Core.Composing // warn if (!cache) - _logger.Debug("Running a non-cached, filter for discoverable type {TypeName} (slowish).", typeof(T).FullName); + _logger.Debug("Running a non-cached, filter for discoverable type {TypeName} (slowish).", typeof(T).FullName); // filter the cached discovered types (and maybe cache the result) return GetTypesInternal( @@ -621,7 +622,7 @@ namespace Umbraco.Core.Composing // if not IDiscoverable, directly get types if (!typeof(IDiscoverable).IsAssignableFrom(typeof(T))) { - _logger.Debug("Running a full, " + (cache ? "" : "non-") + "cached, scan for non-discoverable type {TypeName} / attribute {AttributeName} (slow).", typeof(T).FullName, typeof(TAttribute).FullName); + _logger.Debug("Running a full, " + (cache ? "" : "non-") + "cached, scan for non-discoverable type {TypeName} / attribute {AttributeName} (slow).", typeof(T).FullName, typeof(TAttribute).FullName); return GetTypesInternal( typeof(T), typeof(TAttribute), @@ -639,7 +640,7 @@ namespace Umbraco.Core.Composing // warn if (!cache) - _logger.Debug("Running a non-cached, filter for discoverable type {TypeName} / attribute {AttributeName} (slowish).", typeof(T).FullName, typeof(TAttribute).FullName); + _logger.Debug("Running a non-cached, filter for discoverable type {TypeName} / attribute {AttributeName} (slowish).", typeof(T).FullName, typeof(TAttribute).FullName); // filter the cached discovered types (and maybe cache the result) return GetTypesInternal( @@ -669,7 +670,7 @@ namespace Umbraco.Core.Composing cache &= specificAssemblies == null; if (!cache) - _logger.Debug("Running a full, non-cached, scan for types / attribute {AttributeName} (slow).", typeof(TAttribute).FullName); + _logger.Debug("Running a full, non-cached, scan for types / attribute {AttributeName} (slow).", typeof(TAttribute).FullName); return GetTypesInternal( typeof (object), typeof (TAttribute), @@ -725,7 +726,7 @@ namespace Umbraco.Core.Composing if (typeList != null) { // need to put some logging here to try to figure out why this is happening: http://issues.umbraco.org/issue/U4-3505 - _logger.Debug("Getting {TypeName}: found a cached type list.", GetName(baseType, attributeType)); + _logger.Debug("Getting {TypeName}: found a cached type list.", GetName(baseType, attributeType)); return typeList.Types; } @@ -756,7 +757,7 @@ namespace Umbraco.Core.Composing // so in this instance there will never be a result. if (cacheResult.Exception is CachedTypeNotFoundInFileException || cacheResult.Success == false) { - _logger.Debug("Getting {TypeName}: failed to load from cache file, must scan assemblies.", GetName(baseType, attributeType)); + _logger.Debug("Getting {TypeName}: failed to load from cache file, must scan assemblies.", GetName(baseType, attributeType)); scan = true; } else @@ -775,7 +776,7 @@ namespace Umbraco.Core.Composing catch (Exception ex) { // in case of any exception, we have to exit, and revert to scanning - _logger.Error(ex, "Getting {TypeName}: failed to load cache file type {CacheType}, reverting to scanning assemblies.", GetName(baseType, attributeType), type); + _logger.Error(ex, "Getting {TypeName}: failed to load cache file type {CacheType}, reverting to scanning assemblies.", GetName(baseType, attributeType), type); scan = true; break; } @@ -783,7 +784,7 @@ namespace Umbraco.Core.Composing if (scan == false) { - _logger.Debug("Getting {TypeName}: loaded types from cache file.", GetName(baseType, attributeType)); + _logger.Debug("Getting {TypeName}: loaded types from cache file.", GetName(baseType, attributeType)); } } } @@ -791,7 +792,7 @@ namespace Umbraco.Core.Composing if (scan) { // either we had to scan, or we could not get the types from the cache file - scan now - _logger.Debug("Getting {TypeName}: " + action + ".", GetName(baseType, attributeType)); + _logger.Debug("Getting {TypeName}: " + action + ".", GetName(baseType, attributeType)); foreach (var t in finder()) typeList.Add(t); @@ -809,11 +810,11 @@ namespace Umbraco.Core.Composing UpdateCache(); } - _logger.Debug("Got {TypeName}, caching ({CacheType}).", GetName(baseType, attributeType), added.ToString().ToLowerInvariant()); + _logger.Debug("Got {TypeName}, caching ({CacheType}).", GetName(baseType, attributeType), added.ToString().ToLowerInvariant()); } else { - _logger.Debug("Got {TypeName}.", GetName(baseType, attributeType)); + _logger.Debug("Got {TypeName}.", GetName(baseType, attributeType)); } return typeList.Types; diff --git a/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs b/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs index d434da8c70..82f9bd2afe 100644 --- a/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs +++ b/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs @@ -43,7 +43,7 @@ namespace Umbraco.Core.Configuration.Grid } catch (Exception ex) { - _logger.Error(ex, "Could not parse the contents of grid.editors.config.js into a JSON array '{Json}", sourceString); + _logger.Error(ex, "Could not parse the contents of grid.editors.config.js into a JSON array '{Json}", sourceString); } } diff --git a/src/Umbraco.Core/Constants-PropertyEditors.cs b/src/Umbraco.Core/Constants-PropertyEditors.cs index 90f5fbd0d0..87739469d1 100644 --- a/src/Umbraco.Core/Constants-PropertyEditors.cs +++ b/src/Umbraco.Core/Constants-PropertyEditors.cs @@ -51,6 +51,11 @@ namespace Umbraco.Core /// public const string ColorPicker = "Umbraco.ColorPicker"; + /// + /// EyeDropper Color Picker. + /// + public const string ColorPickerEyeDropper = "Umbraco.ColorPicker.EyeDropper"; + /// /// Content Picker. /// diff --git a/src/Umbraco.Core/IO/FileSystemWrapper.cs b/src/Umbraco.Core/IO/FileSystemWrapper.cs index 14d028c16d..3091a645d5 100644 --- a/src/Umbraco.Core/IO/FileSystemWrapper.cs +++ b/src/Umbraco.Core/IO/FileSystemWrapper.cs @@ -23,94 +23,94 @@ namespace Umbraco.Core.IO internal IFileSystem InnerFileSystem { get; set; } - public IEnumerable GetDirectories(string path) + public virtual IEnumerable GetDirectories(string path) { return InnerFileSystem.GetDirectories(path); } - public void DeleteDirectory(string path) + public virtual void DeleteDirectory(string path) { InnerFileSystem.DeleteDirectory(path); } - public void DeleteDirectory(string path, bool recursive) + public virtual void DeleteDirectory(string path, bool recursive) { InnerFileSystem.DeleteDirectory(path, recursive); } - public bool DirectoryExists(string path) + public virtual bool DirectoryExists(string path) { return InnerFileSystem.DirectoryExists(path); } - public void AddFile(string path, Stream stream) + public virtual void AddFile(string path, Stream stream) { InnerFileSystem.AddFile(path, stream); } - public void AddFile(string path, Stream stream, bool overrideExisting) + public virtual void AddFile(string path, Stream stream, bool overrideExisting) { InnerFileSystem.AddFile(path, stream, overrideExisting); } - public IEnumerable GetFiles(string path) + public virtual IEnumerable GetFiles(string path) { return InnerFileSystem.GetFiles(path); } - public IEnumerable GetFiles(string path, string filter) + public virtual IEnumerable GetFiles(string path, string filter) { return InnerFileSystem.GetFiles(path, filter); } - public Stream OpenFile(string path) + public virtual Stream OpenFile(string path) { return InnerFileSystem.OpenFile(path); } - public void DeleteFile(string path) + public virtual void DeleteFile(string path) { InnerFileSystem.DeleteFile(path); } - public bool FileExists(string path) + public virtual bool FileExists(string path) { return InnerFileSystem.FileExists(path); } - public string GetRelativePath(string fullPathOrUrl) + public virtual string GetRelativePath(string fullPathOrUrl) { return InnerFileSystem.GetRelativePath(fullPathOrUrl); } - public string GetFullPath(string path) + public virtual string GetFullPath(string path) { return InnerFileSystem.GetFullPath(path); } - public string GetUrl(string path) + public virtual string GetUrl(string path) { return InnerFileSystem.GetUrl(path); } - public DateTimeOffset GetLastModified(string path) + public virtual DateTimeOffset GetLastModified(string path) { return InnerFileSystem.GetLastModified(path); } - public DateTimeOffset GetCreated(string path) + public virtual DateTimeOffset GetCreated(string path) { return InnerFileSystem.GetCreated(path); } - public long GetSize(string path) + public virtual long GetSize(string path) { return InnerFileSystem.GetSize(path); } - public bool CanAddPhysical => InnerFileSystem.CanAddPhysical; + public virtual bool CanAddPhysical => InnerFileSystem.CanAddPhysical; - public void AddFile(string path, string physicalPath, bool overrideIfExists = true, bool copy = false) + public virtual void AddFile(string path, string physicalPath, bool overrideIfExists = true, bool copy = false) { InnerFileSystem.AddFile(path, physicalPath, overrideIfExists, copy); } diff --git a/src/Umbraco.Core/IO/FileSystems.cs b/src/Umbraco.Core/IO/FileSystems.cs index 8906752dd1..3b05adb20f 100644 --- a/src/Umbraco.Core/IO/FileSystems.cs +++ b/src/Umbraco.Core/IO/FileSystems.cs @@ -225,7 +225,7 @@ namespace Umbraco.Core.IO _shadowCurrentId = id; - _logger.Debug("Shadow '{ShadowId}'", _shadowCurrentId); + _logger.Debug("Shadow '{ShadowId}'", _shadowCurrentId); foreach (var wrapper in _shadowWrappers) wrapper.Shadow(_shadowCurrentId); @@ -242,7 +242,7 @@ namespace Umbraco.Core.IO if (id != _shadowCurrentId) throw new InvalidOperationException("Not the current shadow."); - _logger.Debug("UnShadow '{ShadowId}' {Status}", id, completed ? "complete" : "abort"); + _logger.Debug("UnShadow '{ShadowId}' {Status}", id, completed ? "complete" : "abort"); var exceptions = new List(); foreach (var wrapper in _shadowWrappers) diff --git a/src/Umbraco.Core/IO/MediaFileSystem.cs b/src/Umbraco.Core/IO/MediaFileSystem.cs index 05c02171ba..6743275be0 100644 --- a/src/Umbraco.Core/IO/MediaFileSystem.cs +++ b/src/Umbraco.Core/IO/MediaFileSystem.cs @@ -51,7 +51,7 @@ namespace Umbraco.Core.IO } catch (Exception e) { - _logger.Error(e, "Failed to delete media file '{File}'.", file); + _logger.Error(e, "Failed to delete media file '{File}'.", file); } }); } diff --git a/src/Umbraco.Core/IO/PhysicalFileSystem.cs b/src/Umbraco.Core/IO/PhysicalFileSystem.cs index a833ba43af..5ebe6817e5 100644 --- a/src/Umbraco.Core/IO/PhysicalFileSystem.cs +++ b/src/Umbraco.Core/IO/PhysicalFileSystem.cs @@ -74,11 +74,11 @@ namespace Umbraco.Core.IO } catch (UnauthorizedAccessException ex) { - Current.Logger.Error(ex, "Not authorized to get directories for '{Path}'", fullPath); + Current.Logger.Error(ex, "Not authorized to get directories for '{Path}'", fullPath); } catch (DirectoryNotFoundException ex) { - Current.Logger.Error(ex, "Directory not found for '{Path}'", fullPath); + Current.Logger.Error(ex, "Directory not found for '{Path}'", fullPath); } return Enumerable.Empty(); @@ -110,7 +110,7 @@ namespace Umbraco.Core.IO } catch (DirectoryNotFoundException ex) { - Current.Logger.Error(ex, "Directory not found for '{Path}'", fullPath); + Current.Logger.Error(ex, "Directory not found for '{Path}'", fullPath); } } @@ -190,11 +190,11 @@ namespace Umbraco.Core.IO } catch (UnauthorizedAccessException ex) { - Current.Logger.Error(ex, "Not authorized to get directories for '{Path}'", fullPath); + Current.Logger.Error(ex, "Not authorized to get directories for '{Path}'", fullPath); } catch (DirectoryNotFoundException ex) { - Current.Logger.Error(ex, "Directory not found for '{FullPath}'", fullPath); + Current.Logger.Error(ex, "Directory not found for '{FullPath}'", fullPath); } return Enumerable.Empty(); @@ -227,7 +227,7 @@ namespace Umbraco.Core.IO } catch (FileNotFoundException ex) { - Current.Logger.Error(ex.InnerException, "DeleteFile failed with FileNotFoundException for '{Path}'", fullPath); + Current.Logger.Error(ex.InnerException, "DeleteFile failed with FileNotFoundException for '{Path}'", fullPath); } } diff --git a/src/Umbraco.Core/IO/SystemDirectories.cs b/src/Umbraco.Core/IO/SystemDirectories.cs index 485fd7f965..9d09bf2f0d 100644 --- a/src/Umbraco.Core/IO/SystemDirectories.cs +++ b/src/Umbraco.Core/IO/SystemDirectories.cs @@ -25,6 +25,8 @@ namespace Umbraco.Core.IO public static string AppPlugins => "~/App_Plugins"; + public static string AppPluginIcons => "/Backoffice/Icons"; + public static string MvcViews => "~/Views"; public static string PartialViews => MvcViews + "/Partials/"; diff --git a/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs b/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs index d1bde55306..8f26f7e75c 100644 --- a/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs +++ b/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs @@ -129,5 +129,65 @@ namespace Umbraco.Core.Logging { System.Diagnostics.Debug.WriteLine(MessageTemplates.Render(messageTemplate, propertyValues), reporting.FullName); } + /// + public void Fatal(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, + T1 propertyValue1, T2 propertyValue2) + => Fatal(reporting, exception, messageTemplate, new object[] { propertyValue0, propertyValue1, propertyValue2 }); + /// + public void Fatal(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Fatal(reporting, exception, messageTemplate, new object[] { propertyValue0, propertyValue1 }); + /// + public void Fatal(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0) + => Fatal(reporting, exception, messageTemplate, new object[] { propertyValue0 }); + /// + public void Error(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, + T1 propertyValue1, T2 propertyValue2) + => Error(reporting, exception, messageTemplate, new object[] { propertyValue0, propertyValue1, propertyValue2 }); + /// + public void Error(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Error(reporting, exception, messageTemplate, new object[] { propertyValue0, propertyValue1 }); + /// + public void Error(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0) + => Error(reporting, exception, messageTemplate, new object[] { propertyValue0 }); + /// + public void Warn(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, + T1 propertyValue1, T2 propertyValue2) + => Warn(reporting, exception, messageTemplate, new object[] { propertyValue0, propertyValue1,propertyValue2 }); + /// + public void Warn(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Warn(reporting, exception, messageTemplate, new object[] { propertyValue0, propertyValue1 }); + + public void Warn(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0) + => Warn(reporting, exception, messageTemplate, new object[] { propertyValue0 }); + + public void Warn(Type reporting, string message, T0 propertyValue0) + => Warn(reporting, message, new object[] { propertyValue0 }); + + public void Info(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + => Info(reporting, messageTemplate, new object[] { propertyValue0, propertyValue1, propertyValue2 }); + + public void Info(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Info(reporting, messageTemplate, new object[] { propertyValue0, propertyValue1 }); + + public void Info(Type reporting, string messageTemplate, T0 propertyValue0) + => Info(reporting, messageTemplate, new object[] { propertyValue0 }); + + public void Debug(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + => Debug(reporting, messageTemplate, new object[] { propertyValue0, propertyValue1, propertyValue2 }); + + public void Debug(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Debug(reporting, messageTemplate, new object[] { propertyValue0, propertyValue1 }); + + public void Debug(Type reporting, string messageTemplate, T0 propertyValue0) + => Debug(reporting, messageTemplate, new object[] { propertyValue0 }); + + public void Verbose(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + => Verbose(reporting, messageTemplate, new object[] { propertyValue0, propertyValue1,propertyValue2 }); + + public void Verbose(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Verbose(reporting, messageTemplate, new object[] { propertyValue0, propertyValue1 }); + + public void Verbose(Type reporting, string messageTemplate, T0 propertyValue0) + => Verbose(reporting, messageTemplate, new object[] { propertyValue0 }); } } diff --git a/src/Umbraco.Core/Logging/DisposableTimer.cs b/src/Umbraco.Core/Logging/DisposableTimer.cs index ed98e5cfab..63ae3c2792 100644 --- a/src/Umbraco.Core/Logging/DisposableTimer.cs +++ b/src/Umbraco.Core/Logging/DisposableTimer.cs @@ -37,10 +37,10 @@ namespace Umbraco.Core.Logging switch (_level) { case LogLevel.Debug: - logger.Debug(loggerType, "{StartMessage} [Timing {TimingId}]", startMessage, _timingId); + logger.Debug(loggerType, "{StartMessage} [Timing {TimingId}]", startMessage, _timingId); break; case LogLevel.Information: - logger.Info(loggerType, "{StartMessage} [Timing {TimingId}]", startMessage, _timingId); + logger.Info(loggerType, "{StartMessage} [Timing {TimingId}]", startMessage, _timingId); break; default: throw new ArgumentOutOfRangeException(nameof(level)); @@ -84,15 +84,15 @@ namespace Umbraco.Core.Logging { if (_failed) { - _logger.Error(_loggerType, _failException, "{FailMessage} ({Duration}ms) [Timing {TimingId}]", _failMessage, Stopwatch.ElapsedMilliseconds, _timingId); + _logger.Error(_loggerType, _failException, "{FailMessage} ({Duration}ms) [Timing {TimingId}]", _failMessage, Stopwatch.ElapsedMilliseconds, _timingId); } else switch (_level) { case LogLevel.Debug: - _logger.Debug(_loggerType, "{EndMessage} ({Duration}ms) [Timing {TimingId}]", _endMessage, Stopwatch.ElapsedMilliseconds, _timingId); + _logger.Debug(_loggerType, "{EndMessage} ({Duration}ms) [Timing {TimingId}]", _endMessage, Stopwatch.ElapsedMilliseconds, _timingId); break; case LogLevel.Information: - _logger.Info(_loggerType, "{EndMessage} ({Duration}ms) [Timing {TimingId}]", _endMessage, Stopwatch.ElapsedMilliseconds, _timingId); + _logger.Info(_loggerType, "{EndMessage} ({Duration}ms) [Timing {TimingId}]", _endMessage, Stopwatch.ElapsedMilliseconds, _timingId); break; // filtered in the ctor //default: diff --git a/src/Umbraco.Core/Logging/ILogger.cs b/src/Umbraco.Core/Logging/ILogger.cs index 4f49d0b3b4..d8272b6aa0 100644 --- a/src/Umbraco.Core/Logging/ILogger.cs +++ b/src/Umbraco.Core/Logging/ILogger.cs @@ -52,7 +52,7 @@ namespace Umbraco.Core.Logging /// A message template. /// Property values. void Fatal(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues); - + /// /// Logs a fatal message. /// @@ -92,7 +92,7 @@ namespace Umbraco.Core.Logging /// A message template. /// Property values. void Error(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues); - + /// /// Logs an error message. /// @@ -132,6 +132,7 @@ namespace Umbraco.Core.Logging /// A message template. /// Property values. void Warn(Type reporting, Exception exception, string messageTemplate, params object[] propertyValues); + /// /// Logs an information message. @@ -147,6 +148,7 @@ namespace Umbraco.Core.Logging /// A message template. /// Property values. void Info(Type reporting, string messageTemplate, params object[] propertyValues); + /// /// Logs a debugging message. @@ -177,5 +179,6 @@ namespace Umbraco.Core.Logging /// A message template. /// Property values. void Verbose(Type reporting, string messageTemplate, params object[] propertyValues); + } } diff --git a/src/Umbraco.Core/Logging/ILogger2.cs b/src/Umbraco.Core/Logging/ILogger2.cs new file mode 100644 index 0000000000..0db8021f58 --- /dev/null +++ b/src/Umbraco.Core/Logging/ILogger2.cs @@ -0,0 +1,240 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Umbraco.Core.Logging +{ + public interface ILogger2 : ILogger + { + /// + /// Logs a fatal message with an exception. + /// + /// The reporting type. + /// An exception. + /// A message template. + /// Property value 0 + /// Property value 1 + /// Property value 2 + void Fatal(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2); + /// + /// Logs a fatal message with an exception. + /// + /// The reporting type. + /// An exception. + /// A message template. + /// Property value 0 + /// Property value 1 + void Fatal(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1); + /// + /// Logs a fatal message with an exception. + /// + /// The reporting type. + /// An exception. + /// A message template. + /// Property value 0 + void Fatal(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0); + + /// + /// Logs an error message with an exception. + /// + /// The reporting type. + /// An exception. + /// A message template. + /// Property value 0 + /// Property value 1 + /// Property value 2 + void Error(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2); + /// + /// Logs an error message with an exception. + /// + /// The reporting type. + /// An exception. + /// A message template. + /// Property value 0 + /// Property value 1 + void Error(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1); + /// + /// Logs an error message with an exception. + /// + /// The reporting type. + /// An exception. + /// A message template. + /// Property value 0 + void Error(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0); + + /// + /// Logs a warning message with an exception. + /// + /// The reporting type. + /// An exception. + /// A message template. + /// Property value 0 + /// Property value 1 + /// Property value 2 + void Warn(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2); + /// + /// Logs a warning message with an exception. + /// + /// The reporting type. + /// An exception. + /// A message template. + /// Property value 0 + /// Property value 1 + void Warn(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1); + /// + /// Logs a warning message with an exception. + /// + /// The reporting type. + /// An exception. + /// A message template. + /// Property value 0 + void Warn(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0); + /// + /// Logs a warning message with an exception. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + void Warn(Type reporting, string message, T0 propertyValue0); + + /// + /// Logs a info message. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + /// Property value 1 + /// Property value 2 + void Info(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2); + /// + /// Logs a info message. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + /// Property value 1 + void Info(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1); + /// + /// Logs a info message. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + void Info(Type reporting, string messageTemplate, T0 propertyValue0); + + /// + /// Logs a debug message. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + /// Property value 1 + /// Property value 2 + void Debug(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2); + /// + /// Logs a debug message. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + /// Property value 1 + void Debug(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1); + /// + /// Logs a debug message. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + void Debug(Type reporting, string messageTemplate, T0 propertyValue0); + + /// + /// Logs a verbose message. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + /// Property value 1 + /// Property value 2 + void Verbose(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2); + /// + /// Logs a verbose message. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + /// Property value 1 + void Verbose(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1); + /// + /// Logs a verbose message. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + void Verbose(Type reporting, string messageTemplate, T0 propertyValue0); + + + /// + /// Logs a error message. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + void Error(Type reporting, string messageTemplate, T0 propertyValue0); + + /// + /// Logs a error message. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + /// Property value 1 + void Error(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1); + + /// + /// Logs a error message. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + /// Property value 1 + /// Property value 2 + void Error(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2); + + /// + /// Logs a warning message. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + /// Property value 1 + /// Property value 2 + void Warn(string messageTemplate, T0 propertyValue0, T1 propertyValue1); + /// + /// Logs a warning message. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + /// Property value 1 + void Warn(string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2); + /// + /// Logs a warning message with an exception. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + /// Property value 1 + /// Property value 2 + void Warn(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2); + /// + /// Logs a warning message with an exception. + /// + /// The reporting type. + /// A message template. + /// Property value 0 + /// Property value 1 + void Warn(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1); + } +} diff --git a/src/Umbraco.Core/Logging/LogProfiler.cs b/src/Umbraco.Core/Logging/LogProfiler.cs index 74dae545b4..c0f8d1b525 100644 --- a/src/Umbraco.Core/Logging/LogProfiler.cs +++ b/src/Umbraco.Core/Logging/LogProfiler.cs @@ -24,8 +24,8 @@ namespace Umbraco.Core.Logging /// public IDisposable Step(string name) { - _logger.Debug("Begin: {ProfileName}", name); - return new LightDisposableTimer(duration => _logger.Info("End {ProfileName} ({ProfileDuration}ms)", name, duration)); + _logger.Debug("Begin: {ProfileName}", name); + return new LightDisposableTimer(duration => _logger.Info("End {ProfileName} ({ProfileDuration}ms)", name, duration)); } /// diff --git a/src/Umbraco.Core/Logging/Logger2Extensions.cs b/src/Umbraco.Core/Logging/Logger2Extensions.cs new file mode 100644 index 0000000000..c6c1352055 --- /dev/null +++ b/src/Umbraco.Core/Logging/Logger2Extensions.cs @@ -0,0 +1,442 @@ +using System; + +namespace Umbraco.Core.Logging +{ + public static class Logger2Extensions + { + public static void Debug(this ILogger logger, Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + if (logger is ILogger2 logger2) + { + logger2.Debug(reporting, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + else + { + logger.Debug(reporting, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + } + + public static void Debug(this ILogger logger, Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + if (logger is ILogger2 logger2) + { + logger2.Debug(reporting, messageTemplate, propertyValue0, propertyValue1); + } + else + { + logger.Debug(reporting, messageTemplate, propertyValue0, propertyValue1); + } + } + + public static void Debug(this ILogger logger, Type reporting, string messageTemplate, T0 propertyValue0) + { + if (logger is ILogger2 logger2) + { + logger2.Debug(reporting, messageTemplate, propertyValue0); + } + else + { + logger.Debug(reporting, messageTemplate, propertyValue0); + } + } + + public static void Error(this ILogger logger, Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + if (logger is ILogger2 logger2) + { + logger2.Error(reporting, exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + else + { + logger.Error(reporting, exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + } + + public static void Error(this ILogger logger, Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + if (logger is ILogger2 logger2) + { + logger2.Error(reporting, exception, messageTemplate, propertyValue0, propertyValue1); + } + else + { + logger.Error(reporting, exception, messageTemplate, propertyValue0, propertyValue1); + } + } + + public static void Error(this ILogger logger, Type reporting, Exception exception, string messageTemplate, T0 propertyValue0) + { + if (logger is ILogger2 logger2) + { + logger2.Error(reporting, exception, messageTemplate, propertyValue0); + } + else + { + logger.Error(reporting, exception, messageTemplate, propertyValue0); + } + } + + public static void Fatal(this ILogger logger, Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + if (logger is ILogger2 logger2) + { + logger2.Fatal(reporting, exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + else + { + logger.Fatal(reporting, exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + } + + public static void Fatal(this ILogger logger, Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + if (logger is ILogger2 logger2) + { + logger2.Fatal(reporting, exception, messageTemplate, propertyValue0, propertyValue1); + } + else + { + logger.Fatal(reporting, exception, messageTemplate, propertyValue0, propertyValue1); + } + } + + public static void Fatal(this ILogger logger, Type reporting, Exception exception, string messageTemplate, T0 propertyValue0) + { + if (logger is ILogger2 logger2) + { + logger2.Fatal(reporting, exception, messageTemplate, propertyValue0); + } + else + { + logger.Fatal(reporting, exception, messageTemplate, propertyValue0); + } + } + + public static void Info(this ILogger logger, Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + if (logger is ILogger2 logger2) + { + logger2.Info(reporting, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + else + { + logger.Info(reporting, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + } + + public static void Info(this ILogger logger, Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + if (logger is ILogger2 logger2) + { + logger2.Info(reporting, messageTemplate, propertyValue0, propertyValue1); + } + else + { + logger.Info(reporting, messageTemplate, propertyValue0, propertyValue1); + } + } + + public static void Info(this ILogger logger, Type reporting, string messageTemplate, T0 propertyValue0) + { + if (logger is ILogger2 logger2) + { + logger2.Info(reporting, messageTemplate, propertyValue0); + } + else + { + logger.Info(reporting, messageTemplate, propertyValue0); + } + } + + public static void Verbose(this ILogger logger, Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + if (logger is ILogger2 logger2) + { + logger2.Verbose(reporting, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + else + { + logger.Verbose(reporting, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + } + + public static void Verbose(this ILogger logger, Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + if (logger is ILogger2 logger2) + { + logger2.Verbose(reporting, messageTemplate, propertyValue0, propertyValue1); + } + else + { + logger.Verbose(reporting, messageTemplate, propertyValue0, propertyValue1); + } + } + + public static void Verbose(this ILogger logger, Type reporting, string messageTemplate, T0 propertyValue0) + { + if (logger is ILogger2 logger2) + { + logger2.Verbose(reporting, messageTemplate, propertyValue0); + } + else + { + logger.Verbose(reporting, messageTemplate, propertyValue0); + } + } + + public static void Warn(this ILogger logger, Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + if (logger is ILogger2 logger2) + { + logger2.Warn(reporting, messageTemplate, exception, propertyValue0, propertyValue1, propertyValue2); + } + else + { + logger.Warn(reporting, messageTemplate, exception, propertyValue0, propertyValue1, propertyValue2); + } + } + + public static void Warn(this ILogger logger, Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + if (logger is ILogger2 logger2) + { + logger2.Warn(reporting, messageTemplate, exception, propertyValue0, propertyValue1); + } + else + { + logger.Warn(reporting, messageTemplate, exception, propertyValue0, propertyValue1); + } + } + + public static void Warn(this ILogger logger, Type reporting, Exception exception, string messageTemplate, T0 propertyValue0) + { + if (logger is ILogger2 logger2) + { + logger2.Warn(reporting, messageTemplate, exception, propertyValue0); + } + else + { + logger.Warn(reporting, messageTemplate, exception, propertyValue0); + } + } + + public static void Warn(this ILogger logger, Type reporting, string message, T0 propertyValue0) + { + if (logger is ILogger2 logger2) + { + logger2.Warn(reporting, message, propertyValue0); + } + else + { + logger.Warn(reporting, message, propertyValue0); + } + } + + // + public static void Error(this ILogger logger, Exception exception, string messageTemplate, T0 propertyValue0) + { + if (logger is ILogger2 logger2) + { + logger2.Error(typeof(T), exception, messageTemplate, propertyValue0); + } + else + { + logger.Error(typeof(T), exception, messageTemplate, propertyValue0); + } + } + + public static void Error(this ILogger logger, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + if (logger is ILogger2 logger2) + { + logger2.Error(typeof(T), exception, messageTemplate, propertyValue0, propertyValue1); + } + else + { + logger.Error(typeof(T), exception, messageTemplate, propertyValue0, propertyValue1); + } + } + + public static void Error(this ILogger logger, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + if (logger is ILogger2 logger2) + { + logger2.Error(typeof(T), exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + else + { + logger.Error(typeof(T), exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + } + public static void Error(this ILogger logger, string messageTemplate, T0 propertyValue0) + { + if (logger is ILogger2 logger2) + { + logger2.Error(typeof(T), messageTemplate, propertyValue0); + } + else + { + logger.Error(typeof(T), messageTemplate, propertyValue0); + } + } + public static void Error(this ILogger logger, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + if (logger is ILogger2 logger2) + { + logger2.Error(typeof(T), messageTemplate, propertyValue0, propertyValue1); + } + else + { + logger.Error(typeof(T), messageTemplate, propertyValue0, propertyValue1); + } + } + public static void Error(this ILogger logger, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + if (logger is ILogger2 logger2) + { + logger2.Error(typeof(T), messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + else + { + logger.Error(typeof(T), messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + } + public static void Warn(this ILogger logger, Exception exception, string messageTemplate, T0 propertyValue0) + { + if (logger is ILogger2 logger2) + { + logger2.Warn(typeof(T), exception, messageTemplate, propertyValue0); + } + else + { + logger.Warn(typeof(T), exception, messageTemplate, propertyValue0); + } + } + + public static void Warn(this ILogger logger, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + if (logger is ILogger2 logger2) + { + logger2.Warn(typeof(T), exception, messageTemplate, propertyValue0, propertyValue1); + } + else + { + logger.Warn(typeof(T), exception, messageTemplate, propertyValue0, propertyValue1); + } + } + + public static void Warn(this ILogger logger, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + if (logger is ILogger2 logger2) + { + logger2.Warn(typeof(T), exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + else + { + logger.Warn(typeof(T), exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + } + + public static void Warn(this ILogger logger, string messageTemplate, T0 propertyValue0) + { + if (logger is ILogger2 logger2) + { + logger2.Warn(typeof(T), messageTemplate, propertyValue0); + } + else + { + logger.Warn(typeof(T), messageTemplate, propertyValue0); + } + } + public static void Warn(this ILogger logger, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + if (logger is ILogger2 logger2) + { + logger2.Warn(typeof(T), messageTemplate, propertyValue0, propertyValue1); + } + else + { + logger.Warn(typeof(T), messageTemplate, propertyValue0, propertyValue1); + } + } + public static void Warn(this ILogger logger, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + if (logger is ILogger2 logger2) + { + logger2.Warn(typeof(T), messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + else + { + logger.Warn(typeof(T), messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + } + + + public static void Info(this ILogger logger, string messageTemplate, T0 propertyValue0) + { + if (logger is ILogger2 logger2) + { + logger2.Info(typeof(T), messageTemplate, propertyValue0); + } + else + { + logger.Info(typeof(T), messageTemplate, propertyValue0); + } + } + public static void Info(this ILogger logger, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + if (logger is ILogger2 logger2) + { + logger2.Info(typeof(T), messageTemplate, propertyValue0, propertyValue1); + } + else + { + logger.Info(typeof(T), messageTemplate, propertyValue0, propertyValue1); + } + } + public static void Info(this ILogger logger, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + if (logger is ILogger2 logger2) + { + logger2.Info(typeof(T), messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + else + { + logger.Info(typeof(T), messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + } + public static void Debug(this ILogger logger, string messageTemplate, T0 propertyValue0) + { + if (logger is ILogger2 logger2) + { + logger2.Debug(typeof(T), messageTemplate, propertyValue0); + } + else + { + logger.Debug(typeof(T), messageTemplate, propertyValue0); + } + } + public static void Debug(this ILogger logger, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + if (logger is ILogger2 logger2) + { + logger2.Debug(typeof(T), messageTemplate, propertyValue0, propertyValue1); + } + else + { + logger.Debug(typeof(T), messageTemplate, propertyValue0, propertyValue1); + } + } + public static void Debug(this ILogger logger, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + if (logger is ILogger2 logger2) + { + logger2.Debug(typeof(T), messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + else + { + logger.Debug(typeof(T), messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + } + } +} diff --git a/src/Umbraco.Core/Logging/OwinLogger.cs b/src/Umbraco.Core/Logging/OwinLogger.cs index 5601cb53f2..7fc36e748c 100644 --- a/src/Umbraco.Core/Logging/OwinLogger.cs +++ b/src/Umbraco.Core/Logging/OwinLogger.cs @@ -26,34 +26,34 @@ namespace Umbraco.Core.Logging switch (eventType) { case TraceEventType.Critical: - _logger.Fatal(_type.Value, exception, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); + _logger.Fatal(_type.Value, exception, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); return true; case TraceEventType.Error: - _logger.Error(_type.Value, exception, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); + _logger.Error(_type.Value, exception, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); return true; case TraceEventType.Warning: _logger.Warn(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); return true; case TraceEventType.Information: - _logger.Info(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); + _logger.Info(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); return true; case TraceEventType.Verbose: - _logger.Debug(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); + _logger.Debug(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); return true; case TraceEventType.Start: - _logger.Debug(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); + _logger.Debug(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); return true; case TraceEventType.Stop: - _logger.Debug(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); + _logger.Debug(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); return true; case TraceEventType.Suspend: - _logger.Debug(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); + _logger.Debug(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); return true; case TraceEventType.Resume: - _logger.Debug(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); + _logger.Debug(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); return true; case TraceEventType.Transfer: - _logger.Debug(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); + _logger.Debug(_type.Value, "[{EventType}] Event Id: {EventId}, State: {State}", eventType, eventId, state); return true; default: throw new ArgumentOutOfRangeException("eventType"); diff --git a/src/Umbraco.Core/Logging/ProfilingLogger.cs b/src/Umbraco.Core/Logging/ProfilingLogger.cs index d642926147..e49aaa26c6 100644 --- a/src/Umbraco.Core/Logging/ProfilingLogger.cs +++ b/src/Umbraco.Core/Logging/ProfilingLogger.cs @@ -127,6 +127,64 @@ namespace Umbraco.Core.Logging public void Verbose(Type reporting, string messageTemplate, params object[] propertyValues) => Logger.Verbose(reporting, messageTemplate, propertyValues); + public void Fatal(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, + T1 propertyValue1, T2 propertyValue2) + => Logger.Fatal(reporting, exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + + public void Fatal(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Logger.Fatal(reporting, exception, messageTemplate, propertyValue0, propertyValue1); + + public void Fatal(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0) + => Logger.Fatal(reporting, exception, messageTemplate, propertyValue0); + + public void Error(Type reporting, Exception exception, string messageTemplate, + T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + => Logger.Error(reporting, exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + + public void Error(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Logger.Error(reporting, exception, messageTemplate, propertyValue0, propertyValue1); + + public void Error(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0) + => Logger.Error(reporting, exception, messageTemplate, propertyValue0); + + public void Warn(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + => Logger.Warn(reporting, exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + + public void Warn(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Logger.Warn(reporting, exception, messageTemplate, propertyValue0, propertyValue1); + + public void Warn(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0) + => Logger.Warn(reporting, exception, messageTemplate, propertyValue0); + + public void Warn(Type reporting, string message, T0 propertyValue0) => Logger.Warn(reporting, message, propertyValue0); + + public void Info(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + => Logger.Info(reporting, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + + public void Info(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Logger.Info(reporting, messageTemplate, propertyValue0, propertyValue1); + + public void Info(Type reporting, string messageTemplate, T0 propertyValue0) + => Logger.Info(reporting, messageTemplate, propertyValue0); + + public void Debug(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + => Logger.Debug(reporting, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + + public void Debug(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Logger.Debug(reporting, messageTemplate, propertyValue0, propertyValue1); + + public void Debug(Type reporting, string messageTemplate, T0 propertyValue0) + => Logger.Debug(reporting, messageTemplate, propertyValue0); + + public void Verbose(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + => Logger.Verbose(reporting, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + + public void Verbose(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Logger.Verbose(reporting, messageTemplate, propertyValue0, propertyValue1); + + public void Verbose(Type reporting, string messageTemplate, T0 propertyValue0) + => Logger.Verbose(reporting, messageTemplate, propertyValue0); + #endregion } } diff --git a/src/Umbraco.Core/Logging/Serilog/SerilogLogger.cs b/src/Umbraco.Core/Logging/Serilog/SerilogLogger.cs index a51628030e..0f6121c1ee 100644 --- a/src/Umbraco.Core/Logging/Serilog/SerilogLogger.cs +++ b/src/Umbraco.Core/Logging/Serilog/SerilogLogger.cs @@ -118,6 +118,30 @@ namespace Umbraco.Core.Logging.Serilog logger.Fatal(exception, messageTemplate, propertyValues); } + /// + public void Fatal(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0) + { + var logger = LoggerFor(reporting); + DumpThreadAborts(logger, LogEventLevel.Fatal, exception, ref messageTemplate); + logger.Fatal(exception, messageTemplate, propertyValue0); + } + + /// + public void Fatal(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + var logger = LoggerFor(reporting); + DumpThreadAborts(logger, LogEventLevel.Fatal, exception, ref messageTemplate); + logger.Fatal(exception, messageTemplate, propertyValue0, propertyValue1); + } + + /// + public void Fatal(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + var logger = LoggerFor(reporting); + DumpThreadAborts(logger, LogEventLevel.Fatal, exception, ref messageTemplate); + logger.Fatal(exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + /// public void Error(Type reporting, Exception exception, string message) { @@ -154,6 +178,29 @@ namespace Umbraco.Core.Logging.Serilog DumpThreadAborts(logger, LogEventLevel.Error, exception, ref messageTemplate); logger.Error(exception, messageTemplate, propertyValues); } + /// + public void Error(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0) + { + var logger = LoggerFor(reporting); + DumpThreadAborts(logger, LogEventLevel.Error, exception, ref messageTemplate); + logger.Error(exception, messageTemplate, propertyValue0); + } + + /// + public void Error(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + var logger = LoggerFor(reporting); + DumpThreadAborts(logger, LogEventLevel.Error, exception, ref messageTemplate); + logger.Error(exception, messageTemplate, propertyValue0, propertyValue1); + } + + /// + public void Error(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + var logger = LoggerFor(reporting); + DumpThreadAborts(logger, LogEventLevel.Error, exception, ref messageTemplate); + logger.Error(exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } private static void DumpThreadAborts(global::Serilog.ILogger logger, LogEventLevel level, Exception exception, ref string messageTemplate) { @@ -224,6 +271,12 @@ namespace Umbraco.Core.Logging.Serilog LoggerFor(reporting).Warning(message, propertyValues); } + /// + public void Warn(Type reporting, string message, T0 propertyValue0) + { + LoggerFor(reporting).Warning(message, propertyValue0); + } + /// public void Warn(Type reporting, Exception exception, string message) { @@ -235,6 +288,29 @@ namespace Umbraco.Core.Logging.Serilog { LoggerFor(reporting).Warning(exception, messageTemplate, propertyValues); } + /// + public void Warn(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0) + { + var logger = LoggerFor(reporting); + DumpThreadAborts(logger, LogEventLevel.Warning, exception, ref messageTemplate); + logger.Warning(exception, messageTemplate, propertyValue0); + } + + /// + public void Warn(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + var logger = LoggerFor(reporting); + DumpThreadAborts(logger, LogEventLevel.Warning, exception, ref messageTemplate); + logger.Warning(exception, messageTemplate, propertyValue0, propertyValue1); + } + + /// + public void Warn(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + var logger = LoggerFor(reporting); + DumpThreadAborts(logger, LogEventLevel.Warning, exception, ref messageTemplate); + logger.Warning(exception, messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } /// public void Info(Type reporting, string message) @@ -248,6 +324,23 @@ namespace Umbraco.Core.Logging.Serilog LoggerFor(reporting).Information(messageTemplate, propertyValues); } + + /// + public void Info(Type reporting, string messageTemplate, T0 propertyValue0) + { + LoggerFor(reporting).Information(messageTemplate, propertyValue0); + } + /// + public void Info(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + LoggerFor(reporting).Information(messageTemplate, propertyValue0, propertyValue1); + } + /// + public void Info(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + LoggerFor(reporting).Information(messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + /// public void Debug(Type reporting, string message) { @@ -259,6 +352,21 @@ namespace Umbraco.Core.Logging.Serilog { LoggerFor(reporting).Debug(messageTemplate, propertyValues); } + /// + public void Debug(Type reporting, string messageTemplate, T0 propertyValue0) + { + LoggerFor(reporting).Debug(messageTemplate, propertyValue0); + } + /// + public void Debug(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + LoggerFor(reporting).Debug(messageTemplate, propertyValue0, propertyValue1); + } + /// + public void Debug(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + LoggerFor(reporting).Debug(messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } /// public void Verbose(Type reporting, string message) @@ -272,6 +380,22 @@ namespace Umbraco.Core.Logging.Serilog LoggerFor(reporting).Verbose(messageTemplate, propertyValues); } + /// + public void Verbose(Type reporting, string messageTemplate, T0 propertyValue0) + { + LoggerFor(reporting).Verbose(messageTemplate, propertyValue0); + } + /// + public void Verbose(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + { + LoggerFor(reporting).Verbose(messageTemplate, propertyValue0, propertyValue1); + } + /// + public void Verbose(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + { + LoggerFor(reporting).Verbose(messageTemplate, propertyValue0, propertyValue1, propertyValue2); + } + public void Dispose() { Log.CloseAndFlush(); diff --git a/src/Umbraco.Core/Manifest/DataEditorConverter.cs b/src/Umbraco.Core/Manifest/DataEditorConverter.cs index 86982e17f2..efa9347edb 100644 --- a/src/Umbraco.Core/Manifest/DataEditorConverter.cs +++ b/src/Umbraco.Core/Manifest/DataEditorConverter.cs @@ -62,7 +62,7 @@ namespace Umbraco.Core.Manifest PrepareForPropertyEditor(jobject, dataEditor); else PrepareForParameterEditor(jobject, dataEditor); - + base.Deserialize(jobject, target, serializer); } @@ -86,26 +86,33 @@ namespace Umbraco.Core.Manifest if (jobject["editor"]["validation"] is JObject validation) jobject["editor"]["validation"] = RewriteValidators(validation); - if (jobject["prevalues"] is JObject config) + var prevalues = jobject["prevalues"] as JObject; + var defaultConfig = jobject["defaultConfig"] as JObject; + if (prevalues != null || defaultConfig != null) { // explicitly assign a configuration editor of type ConfigurationEditor // (else the deserializer will try to read it before setting it) // (and besides it's an interface) target.ExplicitConfigurationEditor = new ConfigurationEditor(); - // see note about validators, above - same applies to field validators - if (config["fields"] is JArray jarray) + var config = new JObject(); + if (prevalues != null) { - foreach (var field in jarray) + config = prevalues; + // see note about validators, above - same applies to field validators + if (config["fields"] is JArray jarray) { - if (field["validation"] is JObject fvalidation) - field["validation"] = RewriteValidators(fvalidation); + foreach (var field in jarray) + { + if (field["validation"] is JObject fvalidation) + field["validation"] = RewriteValidators(fvalidation); + } } } // in the manifest, default configuration is at editor level // move it down to configuration editor level so it can be deserialized properly - if (jobject["defaultConfig"] is JObject defaultConfig) + if (defaultConfig != null) { config["defaultConfig"] = defaultConfig; jobject.Remove("defaultConfig"); diff --git a/src/Umbraco.Core/Manifest/ManifestParser.cs b/src/Umbraco.Core/Manifest/ManifestParser.cs index 1ecc738b95..9bbb0875d8 100644 --- a/src/Umbraco.Core/Manifest/ManifestParser.cs +++ b/src/Umbraco.Core/Manifest/ManifestParser.cs @@ -85,7 +85,7 @@ namespace Umbraco.Core.Manifest } catch (Exception e) { - _logger.Error(e, "Failed to parse manifest at '{Path}', ignoring.", path); + _logger.Error(e, "Failed to parse manifest at '{Path}', ignoring.", path); } } diff --git a/src/Umbraco.Core/Manifest/ManifestWatcher.cs b/src/Umbraco.Core/Manifest/ManifestWatcher.cs index 4c0ddbf822..6c195edb45 100644 --- a/src/Umbraco.Core/Manifest/ManifestWatcher.cs +++ b/src/Umbraco.Core/Manifest/ManifestWatcher.cs @@ -54,7 +54,7 @@ namespace Umbraco.Core.Manifest if (_isRestarting) return; _isRestarting = true; - _logger.Info("Manifest has changed, app pool is restarting ({Path})", e.FullPath); + _logger.Info("Manifest has changed, app pool is restarting ({Path})", e.FullPath); HttpRuntime.UnloadAppDomain(); Dispose(); // uh? if the app restarts then this should be disposed anyways? } diff --git a/src/Umbraco.Core/Migrations/Install/DatabaseBuilder.cs b/src/Umbraco.Core/Migrations/Install/DatabaseBuilder.cs index fb9b8af46d..7106ef188e 100644 --- a/src/Umbraco.Core/Migrations/Install/DatabaseBuilder.cs +++ b/src/Umbraco.Core/Migrations/Install/DatabaseBuilder.cs @@ -332,9 +332,9 @@ namespace Umbraco.Core.Migrations.Install } // save - logger.Info("Saving connection string to {ConfigFile}.", fileSource); + logger.Info("Saving connection string to {ConfigFile}.", fileSource); xml.Save(fileName, SaveOptions.DisableFormatting); - logger.Info("Saved connection string to {ConfigFile}.", fileSource); + logger.Info("Saved connection string to {ConfigFile}.", fileSource); } private static void AddOrUpdateAttribute(XElement element, string name, string value) @@ -459,7 +459,7 @@ namespace Umbraco.Core.Migrations.Install message = message + "

Installation completed!

"; //now that everything is done, we need to determine the version of SQL server that is executing - _logger.Info("Database configuration status: {DbConfigStatus}", message); + _logger.Info("Database configuration status: {DbConfigStatus}", message); return new Result { Message = message, Success = true, Percentage = "100" }; } @@ -508,7 +508,7 @@ namespace Umbraco.Core.Migrations.Install //now that everything is done, we need to determine the version of SQL server that is executing - _logger.Info("Database configuration status: {DbConfigStatus}", message); + _logger.Info("Database configuration status: {DbConfigStatus}", message); return new Result { Message = message, Success = true, Percentage = "100" }; } @@ -539,7 +539,7 @@ namespace Umbraco.Core.Migrations.Install if (_databaseSchemaValidationResult != null) { - _logger.Info("The database schema validation produced the following summary: {DbSchemaSummary}", _databaseSchemaValidationResult.GetSummary()); + _logger.Info("The database schema validation produced the following summary: {DbSchemaSummary}", _databaseSchemaValidationResult.GetSummary()); } return new Result diff --git a/src/Umbraco.Core/Migrations/Install/DatabaseDataCreator.cs b/src/Umbraco.Core/Migrations/Install/DatabaseDataCreator.cs index 9bd26749ad..44de611348 100644 --- a/src/Umbraco.Core/Migrations/Install/DatabaseDataCreator.cs +++ b/src/Umbraco.Core/Migrations/Install/DatabaseDataCreator.cs @@ -29,7 +29,7 @@ namespace Umbraco.Core.Migrations.Install /// Name of the table to create base data for public void InitializeBaseData(string tableName) { - _logger.Info("Creating data in {TableName}", tableName); + _logger.Info("Creating data in {TableName}", tableName); if (tableName.Equals(Constants.DatabaseSchema.Tables.Node)) CreateNodeData(); @@ -73,7 +73,7 @@ namespace Umbraco.Core.Migrations.Install if (tableName.Equals(Constants.DatabaseSchema.Tables.KeyValue)) CreateKeyValueData(); - _logger.Info("Done creating table {TableName} data.", tableName); + _logger.Info("Done creating table {TableName} data.", tableName); } private void CreateNodeData() diff --git a/src/Umbraco.Core/Migrations/Install/DatabaseSchemaCreator.cs b/src/Umbraco.Core/Migrations/Install/DatabaseSchemaCreator.cs index e9580da74a..c3756cfaad 100644 --- a/src/Umbraco.Core/Migrations/Install/DatabaseSchemaCreator.cs +++ b/src/Umbraco.Core/Migrations/Install/DatabaseSchemaCreator.cs @@ -100,7 +100,7 @@ namespace Umbraco.Core.Migrations.Install var tableNameAttribute = table.FirstAttribute(); var tableName = tableNameAttribute == null ? table.Name : tableNameAttribute.Value; - _logger.Info("Uninstall {TableName}", tableName); + _logger.Info("Uninstall {TableName}", tableName); try { @@ -111,7 +111,7 @@ namespace Umbraco.Core.Migrations.Install { //swallow this for now, not sure how best to handle this with diff databases... though this is internal // and only used for unit tests. If this fails its because the table doesn't exist... generally! - _logger.Error(ex, "Could not drop table {TableName}", tableName); + _logger.Error(ex, "Could not drop table {TableName}", tableName); } } } @@ -436,7 +436,7 @@ namespace Umbraco.Core.Migrations.Install var tableExist = TableExists(tableName); if (overwrite && tableExist) { - _logger.Info("Table {TableName} already exists, but will be recreated", tableName); + _logger.Info("Table {TableName} already exists, but will be recreated", tableName); DropTable(tableName); tableExist = false; @@ -445,19 +445,19 @@ namespace Umbraco.Core.Migrations.Install if (tableExist) { // The table exists and was not recreated/overwritten. - _logger.Info("Table {TableName} already exists - no changes were made", tableName); + _logger.Info("Table {TableName} already exists - no changes were made", tableName); return; } //Execute the Create Table sql _database.Execute(new Sql(createSql)); - _logger.Info("Create Table {TableName}: \n {Sql}", tableName, createSql); + _logger.Info("Create Table {TableName}: \n {Sql}", tableName, createSql); //If any statements exists for the primary key execute them here if (string.IsNullOrEmpty(createPrimaryKeySql) == false) { _database.Execute(new Sql(createPrimaryKeySql)); - _logger.Info("Create Primary Key:\n {Sql}", createPrimaryKeySql); + _logger.Info("Create Primary Key:\n {Sql}", createPrimaryKeySql); } if (SqlSyntax.SupportsIdentityInsert() && tableDefinition.Columns.Any(x => x.IsIdentity)) @@ -475,23 +475,23 @@ namespace Umbraco.Core.Migrations.Install foreach (var sql in indexSql) { _database.Execute(new Sql(sql)); - _logger.Info("Create Index:\n {Sql}", sql); + _logger.Info("Create Index:\n {Sql}", sql); } //Loop through foreignkey statements and execute sql foreach (var sql in foreignSql) { _database.Execute(new Sql(sql)); - _logger.Info("Create Foreign Key:\n {Sql}", sql); + _logger.Info("Create Foreign Key:\n {Sql}", sql); } if (overwrite) { - _logger.Info("Table {TableName} was recreated", tableName); + _logger.Info("Table {TableName} was recreated", tableName); } else { - _logger.Info("New table {TableName} was created", tableName); + _logger.Info("New table {TableName} was created", tableName); } } diff --git a/src/Umbraco.Core/Migrations/MigrationPlan.cs b/src/Umbraco.Core/Migrations/MigrationPlan.cs index 89c3c809e8..088d990221 100644 --- a/src/Umbraco.Core/Migrations/MigrationPlan.cs +++ b/src/Umbraco.Core/Migrations/MigrationPlan.cs @@ -294,11 +294,11 @@ namespace Umbraco.Core.Migrations if (migrationBuilder == null) throw new ArgumentNullException(nameof(migrationBuilder)); if (logger == null) throw new ArgumentNullException(nameof(logger)); - logger.Info("Starting '{MigrationName}'...", Name); + logger.Info("Starting '{MigrationName}'...", Name); var origState = fromState ?? string.Empty; - logger.Info("At {OrigState}", string.IsNullOrWhiteSpace(origState) ? "origin": origState); + logger.Info("At {OrigState}", string.IsNullOrWhiteSpace(origState) ? "origin": origState); if (!_transitions.TryGetValue(origState, out var transition)) ThrowOnUnknownInitialState(origState); @@ -308,7 +308,7 @@ namespace Umbraco.Core.Migrations while (transition != null) { - logger.Info("Execute {MigrationType}", transition.MigrationType.Name); + logger.Info("Execute {MigrationType}", transition.MigrationType.Name); var migration = migrationBuilder.Build(transition.MigrationType, context); migration.Migrate(); @@ -316,7 +316,7 @@ namespace Umbraco.Core.Migrations var nextState = transition.TargetState; origState = nextState; - logger.Info("At {OrigState}", origState); + logger.Info("At {OrigState}", origState); // throw a raw exception here: this should never happen as the plan has // been validated - this is just a paranoid safety test diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs index 95b272dcb4..b69158e433 100644 --- a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs +++ b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DataTypeMigration.cs @@ -94,7 +94,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 { if (!LegacyAliases.Contains(dataType.EditorAlias)) { - _logger.Warn( + _logger.Warn( "Skipping validation of configuration for data type {NodeId} : {EditorAlias}." + " Please ensure that the configuration is valid. The site may fail to start and / or load data types and run.", dataType.NodeId, dataType.EditorAlias); @@ -104,7 +104,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 { if (!LegacyAliases.Contains(newAlias)) { - _logger.Warn("Skipping validation of configuration for data type {NodeId} : {NewEditorAlias} (was: {EditorAlias})" + _logger.Warn("Skipping validation of configuration for data type {NodeId} : {NewEditorAlias} (was: {EditorAlias})" + " because no property editor with that alias was found." + " Please ensure that the configuration is valid. The site may fail to start and / or load data types and run.", dataType.NodeId, newAlias, dataType.EditorAlias); @@ -119,7 +119,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 } catch (Exception e) { - _logger.Warn(e, "Failed to validate configuration for data type {NodeId} : {NewEditorAlias} (was: {EditorAlias})." + _logger.Warn(e, "Failed to validate configuration for data type {NodeId} : {NewEditorAlias} (was: {EditorAlias})." + " Please fix the configuration and ensure it is valid. The site may fail to start and / or load data types and run.", dataType.NodeId, newAlias, dataType.EditorAlias); } diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DataTypes/PreValueMigratorCollection.cs b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DataTypes/PreValueMigratorCollection.cs index 06f5d45deb..2eadb6c045 100644 --- a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DataTypes/PreValueMigratorCollection.cs +++ b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DataTypes/PreValueMigratorCollection.cs @@ -19,7 +19,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0.DataTypes public IPreValueMigrator GetMigrator(string editorAlias) { var migrator = this.FirstOrDefault(x => x.CanMigrate(editorAlias)); - _logger.Debug(GetType(), "Getting migrator for \"{EditorAlias}\" = {MigratorType}", editorAlias, migrator == null ? "" : migrator.GetType().Name); + _logger.Debug(GetType(), "Getting migrator for \"{EditorAlias}\" = {MigratorType}", editorAlias, migrator == null ? "" : migrator.GetType().Name); return migrator; } } diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs index d30719231a..ed2681e6f1 100644 --- a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs +++ b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/DropDownPropertyEditorsMigration.cs @@ -46,7 +46,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 } catch (Exception ex) { - Logger.Error( + Logger.Error( ex, "Invalid configuration: \"{Configuration}\", cannot convert editor.", dataType.Configuration); diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/MergeDateAndDateTimePropertyEditor.cs b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/MergeDateAndDateTimePropertyEditor.cs index 37a83bdd67..d4f483c46e 100644 --- a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/MergeDateAndDateTimePropertyEditor.cs +++ b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/MergeDateAndDateTimePropertyEditor.cs @@ -36,7 +36,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 } catch (Exception ex) { - Logger.Error( + Logger.Error( ex, "Invalid property editor configuration detected: \"{Configuration}\", cannot convert editor, values will be cleared", dataType.Configuration); diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/RadioAndCheckboxPropertyEditorsMigration.cs b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/RadioAndCheckboxPropertyEditorsMigration.cs index e96fa1f7e9..fadc3579f2 100644 --- a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/RadioAndCheckboxPropertyEditorsMigration.cs +++ b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/RadioAndCheckboxPropertyEditorsMigration.cs @@ -50,7 +50,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0 } catch (Exception ex) { - Logger.Error( + Logger.Error( ex, "Invalid configuration: \"{Configuration}\", cannot convert editor.", dataType.Configuration); diff --git a/src/Umbraco.Core/Models/Member.cs b/src/Umbraco.Core/Models/Member.cs index 49e07a486d..07f43074a7 100644 --- a/src/Umbraco.Core/Models/Member.cs +++ b/src/Umbraco.Core/Models/Member.cs @@ -501,7 +501,7 @@ namespace Umbraco.Core.Models { void DoLog(string logPropertyAlias, string logPropertyName) { - Current.Logger.Warn("Trying to access the '{PropertyName}' property on '{MemberType}' " + + Current.Logger.Warn("Trying to access the '{PropertyName}' property on '{MemberType}' " + "but the {PropertyAlias} property does not exist on the member type so a default value is returned. " + "Ensure that you have a property type with alias: {PropertyAlias} configured on your member type in order to use the '{PropertyName}' property on the model correctly.", logPropertyName, @@ -526,7 +526,7 @@ namespace Umbraco.Core.Models { void DoLog(string logPropertyAlias, string logPropertyName) { - Current.Logger.Warn("An attempt was made to set a value on the property '{PropertyName}' on type '{MemberType}' but the " + + Current.Logger.Warn("An attempt was made to set a value on the property '{PropertyName}' on type '{MemberType}' but the " + "property type {PropertyAlias} does not exist on the member type, ensure that this property type exists so that setting this property works correctly.", logPropertyName, typeof(Member), diff --git a/src/Umbraco.Core/Packaging/PackageActionRunner.cs b/src/Umbraco.Core/Packaging/PackageActionRunner.cs index 8434f52f30..41dbc5cf4c 100644 --- a/src/Umbraco.Core/Packaging/PackageActionRunner.cs +++ b/src/Umbraco.Core/Packaging/PackageActionRunner.cs @@ -34,7 +34,7 @@ namespace Umbraco.Core.Packaging catch (Exception ex) { e.Add($"{ipa.Alias()} - {ex.Message}"); - _logger.Error(ex, "Error loading package action '{PackageActionAlias}' for package {PackageName}", ipa.Alias(), packageName); + _logger.Error(ex, "Error loading package action '{PackageActionAlias}' for package {PackageName}", ipa.Alias(), packageName); } } @@ -56,7 +56,7 @@ namespace Umbraco.Core.Packaging catch (Exception ex) { e.Add($"{ipa.Alias()} - {ex.Message}"); - _logger.Error(ex, "Error undoing package action '{PackageActionAlias}' for package {PackageName}", ipa.Alias(), packageName); + _logger.Error(ex, "Error undoing package action '{PackageActionAlias}' for package {PackageName}", ipa.Alias(), packageName); } } errors = e; diff --git a/src/Umbraco.Core/Packaging/PackageDataInstallation.cs b/src/Umbraco.Core/Packaging/PackageDataInstallation.cs index 6262f99c56..016b349282 100644 --- a/src/Umbraco.Core/Packaging/PackageDataInstallation.cs +++ b/src/Umbraco.Core/Packaging/PackageDataInstallation.cs @@ -564,7 +564,7 @@ namespace Umbraco.Core.Packaging var tryCreateFolder = _contentTypeService.CreateContainer(-1, rootFolder); if (tryCreateFolder == false) { - _logger.Error(tryCreateFolder.Exception, "Could not create folder: {FolderName}", rootFolder); + _logger.Error(tryCreateFolder.Exception, "Could not create folder: {FolderName}", rootFolder); throw tryCreateFolder.Exception; } var rootFolderId = tryCreateFolder.Result.Entity.Id; @@ -598,7 +598,7 @@ namespace Umbraco.Core.Packaging var tryCreateFolder = _contentTypeService.CreateContainer(current.Id, folderName); if (tryCreateFolder == false) { - _logger.Error(tryCreateFolder.Exception, "Could not create folder: {FolderName}", folderName); + _logger.Error(tryCreateFolder.Exception, "Could not create folder: {FolderName}", folderName); throw tryCreateFolder.Exception; } return _contentTypeService.GetContainer(tryCreateFolder.Result.Entity.Id); @@ -713,7 +713,7 @@ namespace Umbraco.Core.Packaging } else { - _logger.Warn("Packager: Error handling allowed templates. Template with alias '{TemplateAlias}' could not be found.", alias); + _logger.Warn("Packager: Error handling allowed templates. Template with alias '{TemplateAlias}' could not be found.", alias); } } @@ -729,7 +729,7 @@ namespace Umbraco.Core.Packaging } else { - _logger.Warn("Packager: Error handling default template. Default template with alias '{DefaultTemplateAlias}' could not be found.", defaultTemplateElement.Value); + _logger.Warn("Packager: Error handling default template. Default template with alias '{DefaultTemplateAlias}' could not be found.", defaultTemplateElement.Value); } } } @@ -801,7 +801,7 @@ namespace Umbraco.Core.Packaging if (dataTypeDefinition == null) { // TODO: We should expose this to the UI during install! - _logger.Warn("Packager: Error handling creation of PropertyType '{PropertyType}'. Could not find DataTypeDefintion with unique id '{DataTypeDefinitionId}' nor one referencing the DataType with a property editor alias (or legacy control id) '{PropertyEditorAlias}'. Did the package creator forget to package up custom datatypes? This property will be converted to a label/readonly editor if one exists.", + _logger.Warn("Packager: Error handling creation of PropertyType '{PropertyType}'. Could not find DataTypeDefintion with unique id '{DataTypeDefinitionId}' nor one referencing the DataType with a property editor alias (or legacy control id) '{PropertyEditorAlias}'. Did the package creator forget to package up custom datatypes? This property will be converted to a label/readonly editor if one exists.", property.Element("Name").Value, dataTypeDefinitionId, property.Element("Type").Value.Trim()); //convert to a label! @@ -863,7 +863,7 @@ namespace Umbraco.Core.Packaging var allowedChild = importedContentTypes.ContainsKey(alias) ? importedContentTypes[alias] : _contentTypeService.Get(alias); if (allowedChild == null) { - _logger.Warn( + _logger.Warn( "Packager: Error handling DocumentType structure. DocumentType with alias '{DoctypeAlias}' could not be found and was not added to the structure for '{DoctypeStructureAlias}'.", alias, contentType.Alias); continue; @@ -984,7 +984,7 @@ namespace Umbraco.Core.Packaging var tryCreateFolder = _dataTypeService.CreateContainer(-1, rootFolder); if (tryCreateFolder == false) { - _logger.Error(tryCreateFolder.Exception, "Could not create folder: {FolderName}", rootFolder); + _logger.Error(tryCreateFolder.Exception, "Could not create folder: {FolderName}", rootFolder); throw tryCreateFolder.Exception; } current = _dataTypeService.GetContainer(tryCreateFolder.Result.Entity.Id); @@ -1017,7 +1017,7 @@ namespace Umbraco.Core.Packaging var tryCreateFolder = _dataTypeService.CreateContainer(current.Id, folderName); if (tryCreateFolder == false) { - _logger.Error(tryCreateFolder.Exception, "Could not create folder: {FolderName}", folderName); + _logger.Error(tryCreateFolder.Exception, "Could not create folder: {FolderName}", folderName); throw tryCreateFolder.Exception; } return _dataTypeService.GetContainer(tryCreateFolder.Result.Entity.Id); @@ -1322,7 +1322,7 @@ namespace Umbraco.Core.Packaging else if (string.IsNullOrEmpty((string)elementCopy.Element("Master")) == false && templateElements.Any(x => (string)x.Element("Alias") == (string)elementCopy.Element("Master")) == false) { - _logger.Info( + _logger.Info( "Template '{TemplateAlias}' has an invalid Master '{TemplateMaster}', so the reference has been ignored.", (string)elementCopy.Element("Alias"), (string)elementCopy.Element("Master")); diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentRepositoryBase.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentRepositoryBase.cs index 1aabb51d6c..85814ef681 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentRepositoryBase.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentRepositoryBase.cs @@ -708,7 +708,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement { if (ContentRepositoryBase.ThrowOnWarning) throw new InvalidOperationException($"The query returned multiple property sets for content {temp.Id}, {temp.ContentType.Name}"); - Logger.Warn>("The query returned multiple property sets for content {ContentId}, {ContentTypeName}", temp.Id, temp.ContentType.Name); + Logger.Warn, int, string>("The query returned multiple property sets for content {ContentId}, {ContentTypeName}", temp.Id, temp.ContentType.Name); } result[temp.VersionId] = new PropertyCollection(properties); diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeCommonRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeCommonRepository.cs index 90774e4c0b..ec998660fd 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeCommonRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeCommonRepository.cs @@ -171,9 +171,11 @@ namespace Umbraco.Core.Persistence.Repositories.Implement while (compositionIx < compositionDtos.Count && compositionDtos[compositionIx].ChildId == contentType.Id) { var parentDto = compositionDtos[compositionIx]; - if (!contentTypes.TryGetValue(parentDto.ParentId, out var parentContentType)) continue; - contentType.AddContentType(parentContentType); compositionIx++; + + if (!contentTypes.TryGetValue(parentDto.ParentId, out var parentContentType)) + continue; + contentType.AddContentType(parentContentType); } } } diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepository.cs index 483f2393af..6571a847a9 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepository.cs @@ -228,7 +228,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement if (string.IsNullOrWhiteSpace(entity.Alias)) { var ex = new Exception($"ContentType '{entity.Name}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias."); - Logger.Error("ContentType '{EntityName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.", entity.Name); + Logger.Error("ContentType '{EntityName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.", entity.Name); throw ex; } diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs index ed0c288691..a061337127 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs @@ -1203,7 +1203,7 @@ AND umbracoNode.id <> @id", { var ex = new InvalidOperationException($"Property Type '{pt.Name}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias."); - Logger.Error>("Property Type '{PropertyTypeName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.", + Logger.Error, string>("Property Type '{PropertyTypeName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.", pt.Name); throw ex; @@ -1216,7 +1216,7 @@ AND umbracoNode.id <> @id", { var ex = new InvalidOperationException($"{typeof(TEntity).Name} '{entity.Name}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias."); - Logger.Error>("{EntityTypeName} '{EntityName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.", + Logger.Error, string, string>("{EntityTypeName} '{EntityName}' cannot have an empty Alias. This is most likely due to invalid characters stripped from the Alias.", typeof(TEntity).Name, entity.Name); @@ -1248,7 +1248,7 @@ AND umbracoNode.id <> @id", } else { - Logger.Warn>("Could not assign a data type for the property type {PropertyTypeAlias} since no data type was found with a property editor {PropertyEditorAlias}", propertyType.Alias, propertyType.PropertyEditorAlias); + Logger.Warn, string, string>("Could not assign a data type for the property type {PropertyTypeAlias} since no data type was found with a property editor {PropertyEditorAlias}", propertyType.Alias, propertyType.PropertyEditorAlias); } } } diff --git a/src/Umbraco.Core/Persistence/UmbracoDatabase.cs b/src/Umbraco.Core/Persistence/UmbracoDatabase.cs index ec09db690f..f20c4ffbec 100644 --- a/src/Umbraco.Core/Persistence/UmbracoDatabase.cs +++ b/src/Umbraco.Core/Persistence/UmbracoDatabase.cs @@ -207,10 +207,10 @@ namespace Umbraco.Core.Persistence protected override void OnException(Exception ex) { - _logger.Error(ex, "Exception ({InstanceId}).", InstanceId); - _logger.Debug("At:\r\n{StackTrace}", Environment.StackTrace); + _logger.Error(ex, "Exception ({InstanceId}).", InstanceId); + _logger.Debug("At:\r\n{StackTrace}", Environment.StackTrace); if (EnableSqlTrace == false) - _logger.Debug("Sql:\r\n{Sql}", CommandToString(LastSQL, LastArgs)); + _logger.Debug("Sql:\r\n{Sql}", CommandToString(LastSQL, LastArgs)); base.OnException(ex); } @@ -223,7 +223,7 @@ namespace Umbraco.Core.Persistence cmd.CommandTimeout = cmd.Connection.ConnectionTimeout; if (EnableSqlTrace) - _logger.Debug("SQL Trace:\r\n{Sql}", CommandToString(cmd).Replace("{", "{{").Replace("}", "}}")); // TODO: these escapes should be builtin + _logger.Debug("SQL Trace:\r\n{Sql}", CommandToString(cmd).Replace("{", "{{").Replace("}", "}}")); // TODO: these escapes should be builtin #if DEBUG_DATABASES // detects whether the command is already in use (eg still has an open reader...) diff --git a/src/Umbraco.Core/Persistence/UmbracoDatabaseFactory.cs b/src/Umbraco.Core/Persistence/UmbracoDatabaseFactory.cs index baab8c486e..b113769a1a 100644 --- a/src/Umbraco.Core/Persistence/UmbracoDatabaseFactory.cs +++ b/src/Umbraco.Core/Persistence/UmbracoDatabaseFactory.cs @@ -162,7 +162,7 @@ namespace Umbraco.Core.Persistence // else leave unchanged } - _logger.Debug("SqlServer {SqlServerVersion}, DatabaseType is {DatabaseType} ({Source}).", + _logger.Debug("SqlServer {SqlServerVersion}, DatabaseType is {DatabaseType} ({Source}).", versionName, _databaseType, fromSettings ? "settings" : "detected"); } diff --git a/src/Umbraco.Core/PropertyEditors/DataValueEditor.cs b/src/Umbraco.Core/PropertyEditors/DataValueEditor.cs index eebe5f5722..fbcd5ec440 100644 --- a/src/Umbraco.Core/PropertyEditors/DataValueEditor.cs +++ b/src/Umbraco.Core/PropertyEditors/DataValueEditor.cs @@ -219,7 +219,7 @@ namespace Umbraco.Core.PropertyEditors var result = TryConvertValueToCrlType(editorValue.Value); if (result.Success == false) { - Current.Logger.Warn("The value {EditorValue} cannot be converted to the type {StorageTypeValue}", editorValue.Value, ValueTypes.ToStorageType(ValueType)); + Current.Logger.Warn("The value {EditorValue} cannot be converted to the type {StorageTypeValue}", editorValue.Value, ValueTypes.ToStorageType(ValueType)); return null; } return result.Result; diff --git a/src/Umbraco.Core/PropertyEditors/EyeDropperColorPickerConfiguration.cs b/src/Umbraco.Core/PropertyEditors/EyeDropperColorPickerConfiguration.cs new file mode 100644 index 0000000000..3e74b074f9 --- /dev/null +++ b/src/Umbraco.Core/PropertyEditors/EyeDropperColorPickerConfiguration.cs @@ -0,0 +1,14 @@ +namespace Umbraco.Core.PropertyEditors +{ + /// + /// Represents the configuration for the Eye Dropper picker value editor. + /// + public class EyeDropperColorPickerConfiguration + { + [ConfigurationField("showAlpha", "Show alpha", "boolean", Description = "Allow alpha transparency selection.")] + public bool ShowAlpha { get; set; } + + [ConfigurationField("showPalette", "Show palette", "boolean", Description = "Show a palette next to the color picker.")] + public bool ShowPalette { get; set; } + } +} diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs index b3685457ec..fdb0a8c842 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs @@ -96,7 +96,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters } catch (Exception ex) { - Current.Logger.Error(ex, "Could not parse the string '{JsonString}' to a json object", sourceString); + Current.Logger.Error(ex, "Could not parse the string '{JsonString}' to a json object", sourceString); } } diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs index 29e501f993..f8ef82076e 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs @@ -44,8 +44,8 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters } catch (Exception ex) { - // cannot deserialize, assume it may be a raw image URL - Current.Logger.Error(ex, "Could not deserialize string '{JsonString}' into an image cropper value.", sourceString); + // cannot deserialize, assume it may be a raw image url + Current.Logger.Error(ex, "Could not deserialize string '{JsonString}' into an image cropper value.", sourceString); value = new ImageCropperValue { Src = sourceString }; } diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs index 12e6238705..270c8c3b0b 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs @@ -57,7 +57,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters } catch (Exception ex) { - Current.Logger.Error(ex, "Could not parse the string '{JsonString}' to a json object", sourceString); + Current.Logger.Error(ex, "Could not parse the string '{JsonString}' to a json object", sourceString); } } diff --git a/src/Umbraco.Core/Runtime/CoreRuntime.cs b/src/Umbraco.Core/Runtime/CoreRuntime.cs index 26221e5e19..dfedb93c27 100644 --- a/src/Umbraco.Core/Runtime/CoreRuntime.cs +++ b/src/Umbraco.Core/Runtime/CoreRuntime.cs @@ -98,7 +98,7 @@ namespace Umbraco.Core.Runtime HostingEnvironment.ApplicationID, HostingEnvironment.ApplicationPhysicalPath, NetworkHelper.MachineName); - logger.Debug("Runtime: {Runtime}", GetType().FullName); + logger.Debug("Runtime: {Runtime}", GetType().FullName); // application environment ConfigureUnhandledException(); @@ -365,7 +365,7 @@ namespace Umbraco.Core.Runtime { _state.DetermineRuntimeLevel(databaseFactory); - profilingLogger.Debug("Runtime level: {RuntimeLevel} - {RuntimeLevelReason}", _state.Level, _state.Reason); + profilingLogger.Debug("Runtime level: {RuntimeLevel} - {RuntimeLevelReason}", _state.Level, _state.Reason); if (_state.Level == RuntimeLevel.Upgrade) { diff --git a/src/Umbraco.Core/Runtime/MainDom.cs b/src/Umbraco.Core/Runtime/MainDom.cs index 71842905dd..d930841289 100644 --- a/src/Umbraco.Core/Runtime/MainDom.cs +++ b/src/Umbraco.Core/Runtime/MainDom.cs @@ -101,14 +101,14 @@ namespace Umbraco.Core.Runtime lock (_locko) { - _logger.Debug("Signaled ({Signaled}) ({SignalSource})", _signaled ? "again" : "first", source); + _logger.Debug("Signaled ({Signaled}) ({SignalSource})", _signaled ? "again" : "first", source); if (_signaled) return; if (_isMainDom == false) return; // probably not needed _signaled = true; try { - _logger.Info("Stopping ({SignalSource})", source); + _logger.Info("Stopping ({SignalSource})", source); foreach (var callback in _callbacks.OrderBy(x => x.Key).Select(x => x.Value)) { try @@ -122,14 +122,14 @@ namespace Umbraco.Core.Runtime } } - _logger.Debug("Stopped ({SignalSource})", source); + _logger.Debug("Stopped ({SignalSource})", source); } finally { // in any case... _isMainDom = false; _mainDomLock.Dispose(); - _logger.Info("Released ({SignalSource})", source); + _logger.Info("Released ({SignalSource})", source); } } diff --git a/src/Umbraco.Core/Runtime/SqlMainDomLock.cs b/src/Umbraco.Core/Runtime/SqlMainDomLock.cs index f58b279a8d..d98d62cb20 100644 --- a/src/Umbraco.Core/Runtime/SqlMainDomLock.cs +++ b/src/Umbraco.Core/Runtime/SqlMainDomLock.cs @@ -100,7 +100,7 @@ namespace Umbraco.Core.Runtime // if we've inserted, then there was no MainDom so we can instantly acquire InsertLockRecord(_lockId, db); // so update with our appdomain id - _logger.Debug("Acquired with ID {LockId}", _lockId); + _logger.Debug("Acquired with ID {LockId}", _lockId); return true; } @@ -300,7 +300,7 @@ namespace Umbraco.Core.Runtime // so now we update the row with our appdomain id InsertLockRecord(_lockId, db); - _logger.Debug("Acquired with ID {LockId}", _lockId); + _logger.Debug("Acquired with ID {LockId}", _lockId); return true; } else if (mainDomRows.Count == 1 && !mainDomRows[0].Value.StartsWith(tempId)) @@ -359,7 +359,7 @@ namespace Umbraco.Core.Runtime // so now we update the row with our appdomain id InsertLockRecord(_lockId, db); - _logger.Debug("Acquired with ID {LockId}", _lockId); + _logger.Debug("Acquired with ID {LockId}", _lockId); return true; } catch (Exception ex) diff --git a/src/Umbraco.Core/RuntimeState.cs b/src/Umbraco.Core/RuntimeState.cs index c7a1a18d44..bfc125e44f 100644 --- a/src/Umbraco.Core/RuntimeState.cs +++ b/src/Umbraco.Core/RuntimeState.cs @@ -144,13 +144,13 @@ namespace Umbraco.Core { // there *is* a local version, but it does not match the code version // need to upgrade - _logger.Debug("Local version '{LocalVersion}' < code version '{CodeVersion}', need to upgrade Umbraco.", localVersion, codeVersion); + _logger.Debug("Local version '{LocalVersion}' < code version '{CodeVersion}', need to upgrade Umbraco.", localVersion, codeVersion); Level = RuntimeLevel.Upgrade; Reason = RuntimeLevelReason.UpgradeOldVersion; } else if (localVersion > codeVersion) { - _logger.Warn("Local version '{LocalVersion}' > code version '{CodeVersion}', downgrading is not supported.", localVersion, codeVersion); + _logger.Warn("Local version '{LocalVersion}' > code version '{CodeVersion}', downgrading is not supported.", localVersion, codeVersion); // in fact, this is bad enough that we want to throw Reason = RuntimeLevelReason.BootFailedCannotDowngrade; @@ -290,7 +290,7 @@ namespace Umbraco.Core CurrentMigrationState = KeyValueService.GetValue(database, stateValueKey); FinalMigrationState = upgrader.Plan.FinalState; - _logger.Debug("Final upgrade state is {FinalMigrationState}, database contains {DatabaseState}", FinalMigrationState, CurrentMigrationState ?? ""); + _logger.Debug("Final upgrade state is {FinalMigrationState}, database contains {DatabaseState}", FinalMigrationState, CurrentMigrationState ?? ""); return CurrentMigrationState != FinalMigrationState; } diff --git a/src/Umbraco.Core/Scoping/Scope.cs b/src/Umbraco.Core/Scoping/Scope.cs index 7015cee5eb..c4c8d08622 100644 --- a/src/Umbraco.Core/Scoping/Scope.cs +++ b/src/Umbraco.Core/Scoping/Scope.cs @@ -323,7 +323,7 @@ namespace Umbraco.Core.Scoping if (completed.HasValue == false || completed.Value == false) { if (LogUncompletedScopes) - _logger.Debug("Uncompleted Child Scope at\r\n {StackTrace}", Environment.StackTrace); + _logger.Debug("Uncompleted Child Scope at\r\n {StackTrace}", Environment.StackTrace); _completed = false; } diff --git a/src/Umbraco.Core/Scoping/ScopeProvider.cs b/src/Umbraco.Core/Scoping/ScopeProvider.cs index 3c0fa94327..bf4e27bdb6 100644 --- a/src/Umbraco.Core/Scoping/ScopeProvider.cs +++ b/src/Umbraco.Core/Scoping/ScopeProvider.cs @@ -117,7 +117,7 @@ namespace Umbraco.Core.Scoping } // hard to inject into a static method :( - Current.Logger.Warn("Missed {TypeName} Object {ObjectKey}", typeof(T).Name, objectKey.ToString("N").Substring(0, 8)); + Current.Logger.Warn("Missed {TypeName} Object {ObjectKey}", typeof(T).Name, objectKey.ToString("N").Substring(0, 8)); #if DEBUG_SCOPES //Current.Logger.Debug("At:\r\n" + Head(Environment.StackTrace, 24)); #endif diff --git a/src/Umbraco.Core/Services/Changes/TreeChange.cs b/src/Umbraco.Core/Services/Changes/TreeChange.cs index 81c9b67c3f..605cde87a2 100644 --- a/src/Umbraco.Core/Services/Changes/TreeChange.cs +++ b/src/Umbraco.Core/Services/Changes/TreeChange.cs @@ -3,7 +3,7 @@ using System.Linq; namespace Umbraco.Core.Services.Changes { - internal class TreeChange + public class TreeChange { public TreeChange(TItem changedItem, TreeChangeTypes changeTypes) { diff --git a/src/Umbraco.Core/Services/IIconService.cs b/src/Umbraco.Core/Services/IIconService.cs index 963edb22a5..1e1ae38002 100644 --- a/src/Umbraco.Core/Services/IIconService.cs +++ b/src/Umbraco.Core/Services/IIconService.cs @@ -1,4 +1,6 @@ +using System; using System.Collections.Generic; +using System.ComponentModel; using Umbraco.Core.Models; namespace Umbraco.Core.Services @@ -6,7 +8,7 @@ namespace Umbraco.Core.Services public interface IIconService { /// - /// Gets an IconModel containing the icon name and SvgString according to an icon name found at the global icons path + /// Gets the svg string for the icon name found at the global icons path /// /// /// @@ -15,7 +17,15 @@ namespace Umbraco.Core.Services /// /// Gets a list of all svg icons found at at the global icons path. /// - /// + /// A list of + [Obsolete("This method should not be used - use GetIcons instead")] + [EditorBrowsable(EditorBrowsableState.Never)] IList GetAllIcons(); + + /// + /// Gets a list of all svg icons found at at the global icons path. + /// + /// + IReadOnlyDictionary GetIcons(); } } diff --git a/src/Umbraco.Core/Services/Implement/ContentService.cs b/src/Umbraco.Core/Services/Implement/ContentService.cs index a809b83f23..e5363d0e2b 100644 --- a/src/Umbraco.Core/Services/Implement/ContentService.cs +++ b/src/Umbraco.Core/Services/Implement/ContentService.cs @@ -1415,7 +1415,7 @@ namespace Umbraco.Core.Services.Implement var result = CommitDocumentChangesInternal(scope, d, saveEventArgs, allLangs.Value, d.WriterId); if (result.Success == false) - Logger.Error(null, "Failed to publish document id={DocumentId}, reason={Reason}.", d.Id, result.Result); + Logger.Error(null, "Failed to publish document id={DocumentId}, reason={Reason}.", d.Id, result.Result); results.Add(result); } @@ -1425,7 +1425,7 @@ namespace Umbraco.Core.Services.Implement d.ContentSchedule.Clear(ContentScheduleAction.Expire, date); var result = Unpublish(d, userId: d.WriterId); if (result.Success == false) - Logger.Error(null, "Failed to unpublish document id={DocumentId}, reason={Reason}.", d.Id, result.Result); + Logger.Error(null, "Failed to unpublish document id={DocumentId}, reason={Reason}.", d.Id, result.Result); results.Add(result); } } @@ -1479,7 +1479,7 @@ namespace Umbraco.Core.Services.Implement var impact = CultureImpact.Explicit(culture, IsDefaultCulture(allLangs.Value, culture)); var tryPublish = d.PublishCulture(impact) && _propertyValidationService.Value.IsPropertyDataValid(d, out invalidProperties, impact); if (invalidProperties != null && invalidProperties.Length > 0) - Logger.Warn("Scheduled publishing will fail for document {DocumentId} and culture {Culture} because of invalid properties {InvalidProperties}", + Logger.Warn("Scheduled publishing will fail for document {DocumentId} and culture {Culture} because of invalid properties {InvalidProperties}", d.Id, culture, string.Join(",", invalidProperties.Select(x => x.Alias))); publishing &= tryPublish; //set the culture to be published @@ -1496,7 +1496,7 @@ namespace Umbraco.Core.Services.Implement result = CommitDocumentChangesInternal(scope, d, saveEventArgs, allLangs.Value, d.WriterId); if (result.Success == false) - Logger.Error(null, "Failed to publish document id={DocumentId}, reason={Reason}.", d.Id, result.Result); + Logger.Error(null, "Failed to publish document id={DocumentId}, reason={Reason}.", d.Id, result.Result); results.Add(result); } @@ -1510,7 +1510,7 @@ namespace Umbraco.Core.Services.Implement : SaveAndPublish(d, userId: d.WriterId); if (result.Success == false) - Logger.Error(null, "Failed to publish document id={DocumentId}, reason={Reason}.", d.Id, result.Result); + Logger.Error(null, "Failed to publish document id={DocumentId}, reason={Reason}.", d.Id, result.Result); results.Add(result); } @@ -2606,7 +2606,7 @@ namespace Umbraco.Core.Services.Implement /// /// Occurs after change. /// - internal static event TypedEventHandler.EventArgs> TreeChanged; + public static event TypedEventHandler.EventArgs> TreeChanged; /// /// Occurs after a blueprint has been saved. @@ -2640,7 +2640,7 @@ namespace Umbraco.Core.Services.Implement // raise Publishing event if (scope.Events.DispatchCancelable(Publishing, this, savingEventArgs.ToContentPublishingEventArgs())) { - Logger.Info("Document {ContentName} (id={ContentId}) cannot be published: {Reason}", content.Name, content.Id, "publishing was cancelled"); + Logger.Info("Document {ContentName} (id={ContentId}) cannot be published: {Reason}", content.Name, content.Id, "publishing was cancelled"); return new PublishResult(PublishResultType.FailedPublishCancelledByEvent, evtMsgs, content); } @@ -2692,7 +2692,7 @@ namespace Umbraco.Core.Services.Implement // either because it is 'publishing' or because it already has a published version if (content.PublishedState != PublishedState.Publishing && content.PublishedVersionId == 0) { - Logger.Info("Document {ContentName} (id={ContentId}) cannot be published: {Reason}", content.Name, content.Id, "document does not have published values"); + Logger.Info("Document {ContentName} (id={ContentId}) cannot be published: {Reason}", content.Name, content.Id, "document does not have published values"); return new PublishResult(PublishResultType.FailedPublishNothingToPublish, evtMsgs, content); } @@ -2705,20 +2705,20 @@ namespace Umbraco.Core.Services.Implement { case ContentStatus.Expired: if (!variesByCulture) - Logger.Info("Document {ContentName} (id={ContentId}) cannot be published: {Reason}", content.Name, content.Id, "document has expired"); + Logger.Info("Document {ContentName} (id={ContentId}) cannot be published: {Reason}", content.Name, content.Id, "document has expired"); else Logger.Info("Document {ContentName} (id={ContentId}) culture {Culture} cannot be published: {Reason}", content.Name, content.Id, culture, "document culture has expired"); return new PublishResult(!variesByCulture ? PublishResultType.FailedPublishHasExpired : PublishResultType.FailedPublishCultureHasExpired, evtMsgs, content); case ContentStatus.AwaitingRelease: if (!variesByCulture) - Logger.Info("Document {ContentName} (id={ContentId}) cannot be published: {Reason}", content.Name, content.Id, "document is awaiting release"); + Logger.Info("Document {ContentName} (id={ContentId}) cannot be published: {Reason}", content.Name, content.Id, "document is awaiting release"); else Logger.Info("Document {ContentName} (id={ContentId}) culture {Culture} cannot be published: {Reason}", content.Name, content.Id, culture, "document is culture awaiting release"); return new PublishResult(!variesByCulture ? PublishResultType.FailedPublishAwaitingRelease : PublishResultType.FailedPublishCultureAwaitingRelease, evtMsgs, content); case ContentStatus.Trashed: - Logger.Info("Document {ContentName} (id={ContentId}) cannot be published: {Reason}", content.Name, content.Id, "document is trashed"); + Logger.Info("Document {ContentName} (id={ContentId}) cannot be published: {Reason}", content.Name, content.Id, "document is trashed"); return new PublishResult(PublishResultType.FailedPublishIsTrashed, evtMsgs, content); } } @@ -2731,7 +2731,7 @@ namespace Umbraco.Core.Services.Implement var pathIsOk = content.ParentId == Constants.System.Root || IsPathPublished(GetParent(content)); if (!pathIsOk) { - Logger.Info("Document {ContentName} (id={ContentId}) cannot be published: {Reason}", content.Name, content.Id, "parent is not published"); + Logger.Info("Document {ContentName} (id={ContentId}) cannot be published: {Reason}", content.Name, content.Id, "parent is not published"); return new PublishResult(PublishResultType.FailedPublishPathNotPublished, evtMsgs, content); } } @@ -2768,11 +2768,11 @@ namespace Umbraco.Core.Services.Implement return new PublishResult(PublishResultType.FailedPublishNothingToPublish, evtMsgs, content); if (culturesUnpublishing.Count > 0) - Logger.Info("Document {ContentName} (id={ContentId}) cultures: {Cultures} have been unpublished.", + Logger.Info("Document {ContentName} (id={ContentId}) cultures: {Cultures} have been unpublished.", content.Name, content.Id, string.Join(",", culturesUnpublishing)); if (culturesPublishing.Count > 0) - Logger.Info("Document {ContentName} (id={ContentId}) cultures: {Cultures} have been published.", + Logger.Info("Document {ContentName} (id={ContentId}) cultures: {Cultures} have been published.", content.Name, content.Id, string.Join(",", culturesPublishing)); if (culturesUnpublishing.Count > 0 && culturesPublishing.Count > 0) @@ -2784,7 +2784,7 @@ namespace Umbraco.Core.Services.Implement return new PublishResult(PublishResultType.SuccessPublishCulture, evtMsgs, content); } - Logger.Info("Document {ContentName} (id={ContentId}) has been published.", content.Name, content.Id); + Logger.Info("Document {ContentName} (id={ContentId}) has been published.", content.Name, content.Id); return new PublishResult(evtMsgs, content); } @@ -2800,7 +2800,7 @@ namespace Umbraco.Core.Services.Implement // raise Unpublishing event if (scope.Events.DispatchCancelable(Unpublishing, this, new PublishEventArgs(content, evtMsgs))) { - Logger.Info("Document {ContentName} (id={ContentId}) cannot be unpublished: unpublishing was cancelled.", content.Name, content.Id); + Logger.Info("Document {ContentName} (id={ContentId}) cannot be unpublished: unpublishing was cancelled.", content.Name, content.Id); return new PublishResult(PublishResultType.FailedUnpublishCancelledByEvent, evtMsgs, content); } @@ -2832,12 +2832,12 @@ namespace Umbraco.Core.Services.Implement foreach (var p in pastReleases) content.ContentSchedule.Remove(p); if (pastReleases.Count > 0) - Logger.Info("Document {ContentName} (id={ContentId}) had its release date removed, because it was unpublished.", content.Name, content.Id); + Logger.Info("Document {ContentName} (id={ContentId}) had its release date removed, because it was unpublished.", content.Name, content.Id); // change state to unpublishing content.PublishedState = PublishedState.Unpublishing; - Logger.Info("Document {ContentName} (id={ContentId}) has been unpublished.", content.Name, content.Id); + Logger.Info("Document {ContentName} (id={ContentId}) has been unpublished.", content.Name, content.Id); return attempt; } @@ -3169,7 +3169,7 @@ namespace Umbraco.Core.Services.Implement if (rollbackSaveResult.Success == false) { //Log the error/warning - Logger.Error("User '{UserId}' was unable to rollback content '{ContentId}' to version '{VersionId}'", userId, id, versionId); + Logger.Error("User '{UserId}' was unable to rollback content '{ContentId}' to version '{VersionId}'", userId, id, versionId); } else { @@ -3178,7 +3178,7 @@ namespace Umbraco.Core.Services.Implement scope.Events.Dispatch(RolledBack, this, rollbackEventArgs); //Logging & Audit message - Logger.Info("User '{UserId}' rolled back content '{ContentId}' to version '{VersionId}'", userId, id, versionId); + Logger.Info("User '{UserId}' rolled back content '{ContentId}' to version '{VersionId}'", userId, id, versionId); Audit(AuditType.RollBack, userId, id, $"Content '{content.Name}' was rolled back to version '{versionId}'"); } diff --git a/src/Umbraco.Core/Services/Implement/LocalizedTextService.cs b/src/Umbraco.Core/Services/Implement/LocalizedTextService.cs index 4f5121def7..8f58de53bd 100644 --- a/src/Umbraco.Core/Services/Implement/LocalizedTextService.cs +++ b/src/Umbraco.Core/Services/Implement/LocalizedTextService.cs @@ -104,7 +104,7 @@ namespace Umbraco.Core.Services.Implement { if (xmlSource.ContainsKey(culture) == false) { - _logger.Warn("The culture specified {Culture} was not found in any configured sources for this service", culture); + _logger.Warn("The culture specified {Culture} was not found in any configured sources for this service", culture); return result; } @@ -124,7 +124,7 @@ namespace Umbraco.Core.Services.Implement { if (_dictionarySource.ContainsKey(culture) == false) { - _logger.Warn("The culture specified {Culture} was not found in any configured sources for this service", culture); + _logger.Warn("The culture specified {Culture} was not found in any configured sources for this service", culture); return result; } @@ -207,7 +207,7 @@ namespace Umbraco.Core.Services.Implement { if (_dictionarySource.ContainsKey(culture) == false) { - _logger.Warn("The culture specified {Culture} was not found in any configured sources for this service", culture); + _logger.Warn("The culture specified {Culture} was not found in any configured sources for this service", culture); return "[" + key + "]"; } @@ -245,7 +245,7 @@ namespace Umbraco.Core.Services.Implement { if (xmlSource.ContainsKey(culture) == false) { - _logger.Warn("The culture specified {Culture} was not found in any configured sources for this service", culture); + _logger.Warn("The culture specified {Culture} was not found in any configured sources for this service", culture); return "[" + key + "]"; } diff --git a/src/Umbraco.Core/Services/Implement/LocalizedTextServiceFileSources.cs b/src/Umbraco.Core/Services/Implement/LocalizedTextServiceFileSources.cs index 86913071fd..e25fbed509 100644 --- a/src/Umbraco.Core/Services/Implement/LocalizedTextServiceFileSources.cs +++ b/src/Umbraco.Core/Services/Implement/LocalizedTextServiceFileSources.cs @@ -88,7 +88,7 @@ namespace Umbraco.Core.Services.Implement } catch (CultureNotFoundException) { - Current.Logger.Warn("The culture {CultureValue} found in the file {CultureFile} is not a valid culture", cultureVal, fileInfo.FullName); + Current.Logger.Warn("The culture {CultureValue} found in the file {CultureFile} is not a valid culture", cultureVal, fileInfo.FullName); //If the culture in the file is invalid, we'll just hope the file name is a valid culture below, otherwise // an exception will be thrown. } @@ -125,7 +125,7 @@ namespace Umbraco.Core.Services.Implement if (fileSourceFolder.Exists == false) { - Current.Logger.Warn("The folder does not exist: {FileSourceFolder}, therefore no sources will be discovered", fileSourceFolder.FullName); + Current.Logger.Warn("The folder does not exist: {FileSourceFolder}, therefore no sources will be discovered", fileSourceFolder.FullName); } else { @@ -203,7 +203,7 @@ namespace Umbraco.Core.Services.Implement } catch (Exception ex) { - _logger.Error(ex, "Could not load file into XML {File}", supplementaryFile.File.FullName); + _logger.Error(ex, "Could not load file into XML {File}", supplementaryFile.File.FullName); continue; } diff --git a/src/Umbraco.Core/Services/Implement/MediaService.cs b/src/Umbraco.Core/Services/Implement/MediaService.cs index ac9c83458d..ec84c0738e 100644 --- a/src/Umbraco.Core/Services/Implement/MediaService.cs +++ b/src/Umbraco.Core/Services/Implement/MediaService.cs @@ -1279,7 +1279,7 @@ namespace Umbraco.Core.Services.Implement /// /// Occurs after change. /// - internal static event TypedEventHandler.EventArgs> TreeChanged; + public static event TypedEventHandler.EventArgs> TreeChanged; #endregion diff --git a/src/Umbraco.Core/Services/Implement/NotificationService.cs b/src/Umbraco.Core/Services/Implement/NotificationService.cs index 3c5f91e932..b6e42520f0 100644 --- a/src/Umbraco.Core/Services/Implement/NotificationService.cs +++ b/src/Umbraco.Core/Services/Implement/NotificationService.cs @@ -517,7 +517,7 @@ namespace Umbraco.Core.Services.Implement try { if (Sendmail != null) Sendmail(s, request.Mail, _logger); else s.Send(request.Mail); - _logger.Debug("Notification '{Action}' sent to {Username} ({Email})", request.Action, request.UserName, request.Email); + _logger.Debug("Notification '{Action}' sent to {Username} ({Email})", request.Action, request.UserName, request.Email); } catch (Exception ex) { diff --git a/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs b/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs index 7442169b44..49b0d23862 100644 --- a/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs +++ b/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs @@ -192,7 +192,7 @@ namespace Umbraco.Core.Sync if (count > Options.MaxProcessingInstructionCount) { //too many instructions, proceed to cold boot - Logger.Warn( + Logger.Warn( "The instruction count ({InstructionCount}) exceeds the specified MaxProcessingInstructionCount ({MaxProcessingInstructionCount})." + " The server will skip existing instructions, rebuild its caches and indexes entirely, adjust its last synced Id" + " to the latest found in the database and maintain cache updates based on that Id.", @@ -352,7 +352,7 @@ namespace Umbraco.Core.Sync } catch (JsonException ex) { - Logger.Error(ex, "Failed to deserialize instructions ({DtoId}: '{DtoInstructions}').", + Logger.Error(ex, "Failed to deserialize instructions ({DtoId}: '{DtoInstructions}').", dto.Id, dto.Instructions); @@ -410,7 +410,7 @@ namespace Umbraco.Core.Sync //} catch (Exception ex) { - Logger.Error( + Logger.Error ( ex, "DISTRIBUTED CACHE IS NOT UPDATED. Failed to execute instructions ({DtoId}: '{DtoInstructions}'). Instruction is being skipped/ignored", dto.Id, diff --git a/src/Umbraco.Core/Sync/ServerMessengerBase.cs b/src/Umbraco.Core/Sync/ServerMessengerBase.cs index bbf00c3a6b..1b13b49434 100644 --- a/src/Umbraco.Core/Sync/ServerMessengerBase.cs +++ b/src/Umbraco.Core/Sync/ServerMessengerBase.cs @@ -157,7 +157,7 @@ namespace Umbraco.Core.Sync { if (refresher == null) throw new ArgumentNullException(nameof(refresher)); - Current.Logger.Debug("Invoking refresher {RefresherType} on local server for message type RefreshByPayload", refresher.GetType()); + Current.Logger.Debug("Invoking refresher {RefresherType} on local server for message type RefreshByPayload", refresher.GetType()); var payloadRefresher = refresher as IPayloadCacheRefresher; if (payloadRefresher == null) @@ -179,7 +179,7 @@ namespace Umbraco.Core.Sync { if (refresher == null) throw new ArgumentNullException(nameof(refresher)); - Current.Logger.Debug("Invoking refresher {RefresherType} on local server for message type {MessageType}", refresher.GetType(), messageType); + Current.Logger.Debug("Invoking refresher {RefresherType} on local server for message type {MessageType}", refresher.GetType(), messageType); switch (messageType) { @@ -240,7 +240,7 @@ namespace Umbraco.Core.Sync { if (refresher == null) throw new ArgumentNullException(nameof(refresher)); - Current.Logger.Debug("Invoking refresher {RefresherType} on local server for message type {MessageType}", refresher.GetType(), messageType); + Current.Logger.Debug("Invoking refresher {RefresherType} on local server for message type {MessageType}", refresher.GetType(), messageType); var typedRefresher = refresher as ICacheRefresher; diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 84df785bba..f0ba7f66d8 100755 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -131,6 +131,8 @@ + + @@ -167,6 +169,7 @@ + diff --git a/src/Umbraco.Core/UriExtensions.cs b/src/Umbraco.Core/UriExtensions.cs index 60d9cd6ead..96e24e89db 100644 --- a/src/Umbraco.Core/UriExtensions.cs +++ b/src/Umbraco.Core/UriExtensions.cs @@ -4,6 +4,7 @@ using System.Linq; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; using Umbraco.Core.IO; +using Umbraco.Core.Logging; namespace Umbraco.Core { @@ -154,7 +155,7 @@ namespace Umbraco.Core } catch (ArgumentException) { - Current.Logger.Debug(typeof(UriExtensions), "Failed to determine if request was client side (invalid chars in path \"{Path}\"?)", url.LocalPath); + Current.Logger.Debug(typeof(UriExtensions), "Failed to determine if request was client side (invalid chars in path \"{Path}\"?)", url.LocalPath); return false; } } diff --git a/src/Umbraco.Examine/IndexRebuilder.cs b/src/Umbraco.Examine/IndexRebuilder.cs index b14ff25c57..1f953c8cbd 100644 --- a/src/Umbraco.Examine/IndexRebuilder.cs +++ b/src/Umbraco.Examine/IndexRebuilder.cs @@ -69,7 +69,7 @@ namespace Umbraco.Examine } catch (Exception e) { - _logger.Error(e, "Index populating failed for populator {Populator}", populator.GetType()); + _logger.Error(e, "Index populating failed for populator {Populator}", populator.GetType()); } } } diff --git a/src/Umbraco.Examine/UmbracoContentIndex.cs b/src/Umbraco.Examine/UmbracoContentIndex.cs index 88033b1407..2da35201b2 100644 --- a/src/Umbraco.Examine/UmbracoContentIndex.cs +++ b/src/Umbraco.Examine/UmbracoContentIndex.cs @@ -133,7 +133,7 @@ namespace Umbraco.Examine var filtered = c.NativeQuery(rawQuery); var results = filtered.Execute(); - ProfilingLogger.Debug(GetType(), "DeleteFromIndex with query: {Query} (found {TotalItems} results)", rawQuery, results.TotalItemCount); + ProfilingLogger.Debug(GetType(), "DeleteFromIndex with query: {Query} (found {TotalItems} results)", rawQuery, results.TotalItemCount); //need to queue a delete item for each one found QueueIndexOperation(results.Select(r => new IndexOperation(new ValueSet(r.Id), IndexOperationType.Delete))); diff --git a/src/Umbraco.Examine/UmbracoExamineIndex.cs b/src/Umbraco.Examine/UmbracoExamineIndex.cs index e1dd77b994..cc97178e5c 100644 --- a/src/Umbraco.Examine/UmbracoExamineIndex.cs +++ b/src/Umbraco.Examine/UmbracoExamineIndex.cs @@ -159,7 +159,7 @@ namespace Umbraco.Examine /// protected override void AddDocument(Document doc, ValueSet valueSet, IndexWriter writer) { - ProfilingLogger.Debug(GetType(), + ProfilingLogger.Debug(GetType(), "Write lucene doc id:{DocumentId}, category:{DocumentCategory}, type:{DocumentItemType}", valueSet.Id, valueSet.Category, diff --git a/src/Umbraco.ModelsBuilder.Embedded/Building/TextBuilder.cs b/src/Umbraco.ModelsBuilder.Embedded/Building/TextBuilder.cs index e59900bdc4..148d0869d4 100644 --- a/src/Umbraco.ModelsBuilder.Embedded/Building/TextBuilder.cs +++ b/src/Umbraco.ModelsBuilder.Embedded/Building/TextBuilder.cs @@ -246,7 +246,7 @@ namespace Umbraco.ModelsBuilder.Embedded.Building WriteGeneratedCodeAttribute(sb, "\t\t"); sb.AppendFormat("\t\t[ImplementPropertyType(\"{0}\")]\n", property.Alias); - sb.Append("\t\tpublic "); + sb.Append("\t\tpublic virtual "); WriteClrType(sb, property.ClrTypeName); sb.AppendFormat(" {0} => ", @@ -307,14 +307,14 @@ namespace Umbraco.ModelsBuilder.Embedded.Building if (mixinStatic) { - sb.Append("\t\tpublic "); + sb.Append("\t\tpublic virtual "); WriteClrType(sb, property.ClrTypeName); sb.AppendFormat(" {0} => {1}(this);\n", property.ClrName, MixinStaticGetterName(property.ClrName)); } else { - sb.Append("\t\tpublic "); + sb.Append("\t\tpublic virtual "); WriteClrType(sb, property.ClrTypeName); sb.AppendFormat(" {0} => this.Value", property.ClrName); diff --git a/src/Umbraco.ModelsBuilder.Embedded/LiveModelsProvider.cs b/src/Umbraco.ModelsBuilder.Embedded/LiveModelsProvider.cs index 333181f27c..1010d1db19 100644 --- a/src/Umbraco.ModelsBuilder.Embedded/LiveModelsProvider.cs +++ b/src/Umbraco.ModelsBuilder.Embedded/LiveModelsProvider.cs @@ -91,7 +91,7 @@ namespace Umbraco.ModelsBuilder.Embedded catch (Exception e) { _mbErrors.Report("Failed to build Live models.", e); - _logger.Error("Failed to generate models.", e); + _logger.Error(e, "Failed to generate models."); } finally { diff --git a/src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs b/src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs index 912d0e3363..8ef99383a4 100644 --- a/src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs +++ b/src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs @@ -308,7 +308,7 @@ namespace Umbraco.ModelsBuilder.Embedded { try { - _logger.Error("Failed to build models.", e); + _logger.Error(e, "Failed to build models."); _logger.Warn("Running without models."); // be explicit _errors.Report("Failed to build PureLive models.", e); } diff --git a/src/Umbraco.Tests.Benchmarks/LoggerAllocationBenchmark.cs b/src/Umbraco.Tests.Benchmarks/LoggerAllocationBenchmark.cs new file mode 100644 index 0000000000..818eeec7f1 --- /dev/null +++ b/src/Umbraco.Tests.Benchmarks/LoggerAllocationBenchmark.cs @@ -0,0 +1,58 @@ +using BenchmarkDotNet.Attributes; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Umbraco.Core.Logging; +using Umbraco.Tests.Benchmarks.Config; + +namespace Umbraco.Tests.Benchmarks +{ + [QuickRunWithMemoryDiagnoserConfig] + public class LoggerAllocationBenchmark + { + private string rawQuery = ""; + private int totalItemCount; + [Benchmark(Baseline = true)] + public void Baseline() + { + for (int i = 0; i < 1000; i++) + { + OriginalDebugSignature(GetType(), "DeleteFromIndex with query: {Query} (found {TotalItems} results)", rawQuery, totalItemCount); + } + + } + + [Benchmark()] + public void NewOverload2() + { + for (int i = 0; i < 1000; i++) + { + NewDebugSignature(GetType(), "DeleteFromIndex with query: {Query} (found {TotalItems} results)", rawQuery, totalItemCount); + } + } + public void OriginalDebugSignature(Type reporting, string messageTemplate, params object[] propertyValues) + { + + } + + public void NewDebugSignature(Type reporting, string messageTemplate, T1 param1, T2 param2) + { + + } + + // BenchmarkDotNet=v0.11.3, OS=Windows 10.0.18362 + //Intel Core i5-8265U CPU 1.60GHz(Kaby Lake R), 1 CPU, 8 logical and 4 physical cores + // [Host] : .NET Framework 4.7.2 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.8.4180.0 + // Job-JIATTD : .NET Framework 4.7.2 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.8.4180.0 + + //IterationCount=3 IterationTime=100.0000 ms LaunchCount = 1 + //WarmupCount=3 + + // Method | Mean | Error | StdDev | Ratio | Gen 0/1k Op | Gen 1/1k Op | Gen 2/1k Op | Allocated Memory/Op | + //------------- |----------:|----------:|----------:|------:|------------:|------------:|------------:|--------------------:| + // Baseline | 14.599 us | 1.0882 us | 0.0596 us | 1.00 | 10.0420 | - | - | 32048 B | + // NewOverload2 | 1.775 us | 0.4056 us | 0.0222 us | 0.12 | - | - | - | - | + } +} diff --git a/src/Umbraco.Tests.Benchmarks/Umbraco.Tests.Benchmarks.csproj b/src/Umbraco.Tests.Benchmarks/Umbraco.Tests.Benchmarks.csproj index 386cf12a92..b630b08840 100644 --- a/src/Umbraco.Tests.Benchmarks/Umbraco.Tests.Benchmarks.csproj +++ b/src/Umbraco.Tests.Benchmarks/Umbraco.Tests.Benchmarks.csproj @@ -55,6 +55,7 @@ + diff --git a/src/Umbraco.Tests/Composing/TypeLoaderTests.cs b/src/Umbraco.Tests/Composing/TypeLoaderTests.cs index 9cd4f39c17..b0c57b685b 100644 --- a/src/Umbraco.Tests/Composing/TypeLoaderTests.cs +++ b/src/Umbraco.Tests/Composing/TypeLoaderTests.cs @@ -268,7 +268,7 @@ AnotherContentFinder public void GetDataEditors() { var types = _typeLoader.GetDataEditors(); - Assert.AreEqual(39, types.Count()); + Assert.AreEqual(40, types.Count()); } /// diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/DictionaryPublishedContent.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/DictionaryPublishedContent.cs index db8dc38d6d..d13bda9703 100644 --- a/src/Umbraco.Tests/LegacyXmlPublishedCache/DictionaryPublishedContent.cs +++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/DictionaryPublishedContent.cs @@ -109,7 +109,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache else { // this is a property that does not correspond to anything, ignore and log - Current.Logger.Warn("Dropping property '{PropertyKey}' because it does not belong to the content type.", i.Key); + Current.Logger.Warn("Dropping property '{PropertyKey}' because it does not belong to the content type.", i.Key); } } } diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/PreviewContent.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/PreviewContent.cs index 84b6f2b91c..4bedfc9416 100644 --- a/src/Umbraco.Tests/LegacyXmlPublishedCache/PreviewContent.cs +++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/PreviewContent.cs @@ -40,7 +40,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache } catch (Exception ex) { - Current.Logger.Error(ex, "Could not load preview set {PreviewSet} for user {UserId}.", _previewSet, _userId); + Current.Logger.Error(ex, "Could not load preview set {PreviewSet} for user {UserId}.", _previewSet, _userId); ClearPreviewSet(); @@ -146,7 +146,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache } catch (Exception ex) { - Current.Logger.Error(ex, "Couldn't delete preview set {FileName} for user {UserId}", file.Name, userId); + Current.Logger.Error(ex, "Couldn't delete preview set {FileName} for user {UserId}", file.Name, userId); } } diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs index 56033e6b0a..2b4ae40550 100644 --- a/src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs +++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/PublishedMediaCache.cs @@ -338,7 +338,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache var miss = Interlocked.CompareExchange(ref _examineIndexMiss, 0, 0); // volatile read if (miss < ExamineIndexMissMax && Interlocked.Increment(ref _examineIndexMiss) == ExamineIndexMissMax) - Current.Logger.Warn("Failed ({ExamineIndexMissMax} times) to retrieve medias from Examine index and had to load" + Current.Logger.Warn("Failed ({ExamineIndexMissMax} times) to retrieve medias from Examine index and had to load" + " them from DB. This may indicate that the Examine index is corrupted.", ExamineIndexMissMax); return ConvertFromIMedia(media); @@ -356,7 +356,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache : ConvertFromXPathNavigator(media.Current); } - Current.Logger.Warn("Could not retrieve media {MediaId} from Examine index or from legacy library.GetMedia method", id); + Current.Logger.Warn("Could not retrieve media {MediaId} from Examine index or from legacy library.GetMedia method", id); return null; } diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs index 803b86aec5..a7e1f8598e 100644 --- a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs +++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs @@ -702,7 +702,7 @@ AND (umbracoNode.id=@id)"; // if something goes wrong remove the file DeleteXmlFile(); - Current.Logger.Error(ex, "Failed to save Xml to file '{FileName}'.", _xmlFileName); + Current.Logger.Error(ex, "Failed to save Xml to file '{FileName}'.", _xmlFileName); } } @@ -742,7 +742,7 @@ AND (umbracoNode.id=@id)"; // if something goes wrong remove the file DeleteXmlFile(); - Current.Logger.Error(ex, "Failed to save Xml to file '{FileName}'.", _xmlFileName); + Current.Logger.Error(ex, "Failed to save Xml to file '{FileName}'.", _xmlFileName); } } @@ -799,7 +799,7 @@ AND (umbracoNode.id=@id)"; } catch (Exception ex) { - Current.Logger.Error(ex, "Failed to load Xml from file '{FileName}'.", _xmlFileName); + Current.Logger.Error(ex, "Failed to load Xml from file '{FileName}'.", _xmlFileName); try { DeleteXmlFile(); @@ -1039,7 +1039,7 @@ ORDER BY umbracoNode.level, umbracoNode.sortOrder"; { foreach (var payload in payloads) { - Current.Logger.Debug("Notified {ChangeTypes} for content {ContentId}", payload.ChangeTypes, payload.Id); + Current.Logger.Debug("Notified {ChangeTypes} for content {ContentId}", payload.ChangeTypes, payload.Id); if (payload.ChangeTypes.HasType(TreeChangeTypes.RefreshAll)) { @@ -1072,7 +1072,7 @@ ORDER BY umbracoNode.level, umbracoNode.sortOrder"; if (content == null || content.Published == false || content.Trashed) { // no published version - Current.Logger.Debug("Notified, content {ContentId} has no published version.", payload.Id); + Current.Logger.Debug("Notified, content {ContentId} has no published version.", payload.Id); if (current != null) { @@ -1111,7 +1111,7 @@ ORDER BY umbracoNode.level, umbracoNode.sortOrder"; if (dtos.MoveNext() == false) { // gone fishing, remove (possible race condition) - Current.Logger.Debug("Notified, content {ContentId} gone fishing.", payload.Id); + Current.Logger.Debug("Notified, content {ContentId} gone fishing.", payload.Id); if (current != null) { @@ -1225,7 +1225,7 @@ ORDER BY umbracoNode.level, umbracoNode.sortOrder"; .ToArray(); foreach (var payload in payloads) - Current.Logger.Debug("Notified {ChangeTypes} for content type {ContentTypeId}", payload.ChangeTypes, payload.Id); + Current.Logger.Debug("Notified {ChangeTypes} for content type {ContentTypeId}", payload.ChangeTypes, payload.Id); if (ids.Length > 0) // must have refreshes, not only removes RefreshContentTypes(ids); @@ -1244,7 +1244,7 @@ ORDER BY umbracoNode.level, umbracoNode.sortOrder"; _contentTypeCache.ClearDataType(payload.Id); foreach (var payload in payloads) - Current.Logger.Debug("Notified {RemovedStatus} for data type {payload.Id}", + Current.Logger.Debug("Notified {RemovedStatus} for data type {payload.Id}", payload.Removed ? "Removed" : "Refreshed", payload.Id); diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStoreFilePersister.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStoreFilePersister.cs index 56c09b18ac..09dc0e17ef 100644 --- a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStoreFilePersister.cs +++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStoreFilePersister.cs @@ -61,7 +61,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache if (touched == false) return; - _logger.Debug("Created, save in {WaitMilliseconds}ms.", WaitMilliseconds); + _logger.Debug("Created, save in {WaitMilliseconds}ms.", WaitMilliseconds); _initialTouch = DateTime.Now; _timer = new Timer(_ => TimerRelease()); _timer.Change(WaitMilliseconds, 0); @@ -106,7 +106,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache else if (_timer == null) // we don't have a timer yet { - _logger.Debug("Touched, was idle, start and save in {WaitMilliseconds}ms.", WaitMilliseconds); + _logger.Debug("Touched, was idle, start and save in {WaitMilliseconds}ms.", WaitMilliseconds); _initialTouch = DateTime.Now; _timer = new Timer(_ => TimerRelease()); _timer.Change(WaitMilliseconds, 0); @@ -119,7 +119,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache if (DateTime.Now - _initialTouch < TimeSpan.FromMilliseconds(MaxWaitMilliseconds)) { - _logger.Debug("Touched, was waiting, can delay, save in {WaitMilliseconds}ms.", WaitMilliseconds); + _logger.Debug("Touched, was waiting, can delay, save in {WaitMilliseconds}ms.", WaitMilliseconds); _timer.Change(WaitMilliseconds, 0); } else diff --git a/src/Umbraco.Tests/Manifest/ManifestParserTests.cs b/src/Umbraco.Tests/Manifest/ManifestParserTests.cs index 1c90f68d62..6b140e3757 100644 --- a/src/Umbraco.Tests/Manifest/ManifestParserTests.cs +++ b/src/Umbraco.Tests/Manifest/ManifestParserTests.cs @@ -187,6 +187,8 @@ javascript: ['~/test.js',/*** some note about stuff asd09823-4**09234*/ '~/test2 var editor = manifest.PropertyEditors[1]; Assert.IsTrue((editor.Type & EditorType.MacroParameter) > 0); + Assert.IsNotEmpty(editor.DefaultConfiguration); + Assert.AreEqual("some default val", editor.DefaultConfiguration["key1"]); editor = manifest.PropertyEditors[0]; Assert.AreEqual("Test.Test1", editor.Alias); diff --git a/src/Umbraco.Tests/ModelsBuilder/BuilderTests.cs b/src/Umbraco.Tests/ModelsBuilder/BuilderTests.cs index 4f35c57d04..5a64ab1b73 100644 --- a/src/Umbraco.Tests/ModelsBuilder/BuilderTests.cs +++ b/src/Umbraco.Tests/ModelsBuilder/BuilderTests.cs @@ -97,7 +97,7 @@ namespace Umbraco.Web.PublishedModels [global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")] [ImplementPropertyType(""prop1"")] - public string Prop1 => this.Value(""prop1""); + public virtual string Prop1 => this.Value(""prop1""); } } "; @@ -212,7 +212,7 @@ namespace Umbraco.Web.PublishedModels [global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")] [ImplementPropertyType(""foo"")] - public global::System.Collections.Generic.IEnumerable Foo => this.Value>(""foo""); + public virtual global::System.Collections.Generic.IEnumerable Foo => this.Value>(""foo""); } } "; diff --git a/src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs b/src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs index 9f4304ebee..a3955f11aa 100644 --- a/src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs +++ b/src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs @@ -128,7 +128,7 @@ namespace Umbraco.Tests.Services total.AddRange(ServiceContext.ContentService.GetPagedDescendants(content.Id, 0, int.MaxValue, out var _)); } TestProfiler.Disable(); - Current.Logger.Info("Returned {Total} items", total.Count); + Current.Logger.Info("Returned {Total} items", total.Count); } } diff --git a/src/Umbraco.Tests/TestHelpers/ConsoleLogger.cs b/src/Umbraco.Tests/TestHelpers/ConsoleLogger.cs index a3e36db363..f571f876b7 100644 --- a/src/Umbraco.Tests/TestHelpers/ConsoleLogger.cs +++ b/src/Umbraco.Tests/TestHelpers/ConsoleLogger.cs @@ -115,5 +115,62 @@ namespace Umbraco.Tests.TestHelpers { Console.WriteLine("VERBOSE {0} - {1}", reporting.Name, MessageTemplates.Render(messageTemplate, propertyValues)); } + + public void Fatal(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + => Fatal(reporting, exception, messageTemplate, new object[] { propertyValue0, propertyValue1, propertyValue2 }); + + public void Fatal(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Fatal(reporting, exception, messageTemplate, new object[] { propertyValue0, propertyValue1 }); + + public void Fatal(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0) + => Fatal(reporting, exception, messageTemplate, new object[] { propertyValue0 }); + + public void Error(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + => Error(reporting, exception, messageTemplate, new object[] { propertyValue0, propertyValue1, propertyValue2 }); + + public void Error(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Error(reporting, exception, messageTemplate, new object[] { propertyValue0, propertyValue1 }); + + public void Error(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0) + => Error(reporting, exception, messageTemplate, new object[] { propertyValue0 }); + + public void Warn(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + => Warn(reporting, exception, messageTemplate, new object[] { propertyValue0, propertyValue1, propertyValue2 }); + + public void Warn(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Warn(reporting, exception, messageTemplate, new object[] { propertyValue0, propertyValue1 }); + + public void Warn(Type reporting, Exception exception, string messageTemplate, T0 propertyValue0) + => Warn(reporting, exception, messageTemplate, new object[] { propertyValue0 }); + + public void Warn(Type reporting, string message, T0 propertyValue0) + => Warn(reporting, message, new object[] { propertyValue0 }); + + public void Info(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + => Info(reporting, messageTemplate, new object[] { propertyValue0, propertyValue1, propertyValue2 }); + + public void Info(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Info(reporting, messageTemplate, new object[] { propertyValue0, propertyValue1 }); + + public void Info(Type reporting, string messageTemplate, T0 propertyValue0) + => Info(reporting, messageTemplate, new object[] { propertyValue0 }); + + public void Debug(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + => Debug(reporting, messageTemplate, new object[] { propertyValue0, propertyValue1, propertyValue2 }); + + public void Debug(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Debug(reporting, messageTemplate, new object[] { propertyValue0, propertyValue1 }); + + public void Debug(Type reporting, string messageTemplate, T0 propertyValue0) + => Debug(reporting, messageTemplate, new object[] { propertyValue0 }); + + public void Verbose(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1, T2 propertyValue2) + => Verbose(reporting, messageTemplate, new object[] { propertyValue0, propertyValue1, propertyValue2 }); + + public void Verbose(Type reporting, string messageTemplate, T0 propertyValue0, T1 propertyValue1) + => Verbose(reporting, messageTemplate, new object[] { propertyValue0, propertyValue1 }); + + public void Verbose(Type reporting, string messageTemplate, T0 propertyValue0) + => Verbose(reporting, messageTemplate, new object[] { propertyValue0 }); } } diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorheader.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorheader.directive.js index 6f272f1ea2..0ac285c094 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorheader.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorheader.directive.js @@ -341,20 +341,19 @@ Use this directive to construct a header inside the main editor window. } } - scope.accessibility.a11yMessageVisible = !isEmptyOrSpaces(scope.accessibility.a11yMessage); - scope.accessibility.a11yNameVisible = !isEmptyOrSpaces(scope.accessibility.a11yName); + + scope.accessibility.a11yMessageVisible = !isNullOrWhitespace(scope.accessibility.a11yMessage); + scope.accessibility.a11yNameVisible = !isNullOrWhitespace(scope.accessibility.a11yName); }); } - - - function isEmptyOrSpaces(str) { - return str === null || str===undefined || str.trim ===''; + function isNullOrWhitespace(str) { + return str === null || str === undefined || str.trim() === ''; } function SetPageTitle(title) { - scope.$emit("$changeTitle", title); + scope.$emit("$changeTitle", title); } var unbindEventHandler = $rootScope.$on('$setAccessibleHeader', function (event, isNew, editorFor, nameLocked, name, contentTypeName, setTitle) { diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbicon.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbicon.directive.js index 87d976f6d9..73a9617aee 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbicon.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbicon.directive.js @@ -75,9 +75,8 @@ Icon with additional attribute. It can be treated like any other dom element iconHelper.getIcon(icon) .then(data => { - if (data !== null && data.svgString !== undefined) { + if (data && data.svgString) { // Watch source SVG string - //icon.svgString.$$unwrapTrustedValue(); scope.svgString = data.svgString; } }); diff --git a/src/Umbraco.Web.UI.Client/src/common/services/editor.service.js b/src/Umbraco.Web.UI.Client/src/common/services/editor.service.js index 326123f797..b0a2465f42 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/editor.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/editor.service.js @@ -187,7 +187,7 @@ When building a custom infinite editor view you can use the same components as a * @methodOf umbraco.services.editorService * * @description - * Method to return all open editors + * Method to return all open editors. */ function getEditors() { return editors; @@ -199,7 +199,7 @@ When building a custom infinite editor view you can use the same components as a * @methodOf umbraco.services.editorService * * @description - * Method to return the number of open editors + * Method to return the number of open editors. */ function getNumberOfEditors() { return editors.length; @@ -250,8 +250,8 @@ When building a custom infinite editor view you can use the same components as a * Method to open a new editor in infinite editing. * * @param {object} editor rendering options. - * @param {string} editor.view Path to view. - * @param {string} editor.size Sets the size of the editor ("small" || "medium"). If nothing is set it will use full width. + * @param {string} editor.view URL to view. + * @param {string} editor.size Sets the size of the editor (`small` or `medium`). If nothing is set it will use full width. */ function open(editor) { @@ -286,7 +286,7 @@ When building a custom infinite editor view you can use the same components as a * @methodOf umbraco.services.editorService * * @description - * Method to close the latest opened editor + * Method to close the latest opened editor. */ function close() { @@ -321,7 +321,7 @@ When building a custom infinite editor view you can use the same components as a * @methodOf umbraco.services.editorService * * @description - * Method to close all open editors + * Method to close all open editors. */ function closeAll() { @@ -342,6 +342,7 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens a content editor in infinite editing, the submit callback returns the updated content item. + * * @param {object} editor rendering options. * @param {string} editor.id The id of the content item. * @param {boolean} editor.create Create new content item. @@ -351,7 +352,6 @@ When building a custom infinite editor view you can use the same components as a * @param {string} editor.documentTypeAlias If editor.create is true, provide document type alias for the creation of the content item. * @param {boolean} editor.allowSaveAndClose If editor is being used in infinite editing allows the editor to close when the save action is performed. * @param {boolean} editor.allowPublishAndClose If editor is being used in infinite editing allows the editor to close when the publish action is performed. - * * @returns {object} editor object */ function contentEditor(editor) { @@ -395,7 +395,6 @@ When building a custom infinite editor view you can use the same components as a * @param {boolean} editor.multiPicker Pick one or multiple items. * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. * @param {function} editor.close Callback function when the close button is clicked. - * * @returns {object} editor object */ function contentTypePicker(editor) { @@ -418,7 +417,6 @@ When building a custom infinite editor view you can use the same components as a * @param {boolean} editor.multiPicker Pick one or multiple items. * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. * @param {function} editor.close Callback function when the close button is clicked. - * * @returns {object} editor object. */ function mediaTypePicker(editor) { @@ -458,13 +456,14 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens a copy editor in infinite editing, the submit callback returns an array of selected items. + * + * @param {object} editor rendering options. * @param {string} editor.section The node entity type. * @param {string} editor.currentNode The current node id. - * @param {function} editor.submit Saves, submits, and closes the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ - function copy(editor) { editor.view = "views/common/infiniteeditors/copy/copy.html"; if (!editor.size) editor.size = "small"; @@ -478,13 +477,14 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens a move editor in infinite editing. + * + * @param {object} editor rendering options. * @param {string} editor.section The node entity type. * @param {string} editor.currentNode The current node id. - * @param {function} editor.submit Saves, submits, and closes the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ - function move(editor) { editor.view = "views/common/infiniteeditors/move/move.html"; if (!editor.size) editor.size = "small"; @@ -498,11 +498,12 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens an embed editor in infinite editing. - * @param {function} editor.submit Saves, submits, and closes the editor. - * @param {function} editor.close Closes the editor. + * + * @param {object} editor rendering options. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ - function embed(editor) { editor.view = "views/common/infiniteeditors/embed/embed.html"; if (!editor.size) editor.size = "small"; @@ -516,12 +517,13 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens a rollback editor in infinite editing. + * + * @param {object} editor rendering options. * @param {string} editor.node The node to rollback. - * @param {function} editor.submit Saves, submits, and closes the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ - function rollback(editor) { editor.view = "views/common/infiniteeditors/rollback/rollback.html"; if (!editor.size) editor.size = "medium"; @@ -535,11 +537,12 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens an embed editor in infinite editing. + * * @param {object} editor rendering options. * @param {string} editor.icon The icon class. * @param {string} editor.color The color class. - * @param {function} editor.submit Saves, submits, and closes the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function linkPicker(editor) { @@ -555,11 +558,12 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens a media editor in infinite editing, the submit callback returns the updated media item. + * * @param {object} editor rendering options. * @param {string} editor.id The id of the media item. * @param {boolean} editor.create Create new media item. - * @param {function} editor.submit Saves, submits, and closes the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function mediaEditor(editor) { @@ -574,6 +578,7 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens a media picker in infinite editing, the submit callback returns an array of selected media items. + * * @param {object} editor rendering options. * @param {number} editor.startNodeId Set the startnode of the picker (optional). * @param {boolean} editor.multiPicker Pick one or multiple items. @@ -581,8 +586,8 @@ When building a custom infinite editor view you can use the same components as a * @param {boolean} editor.disableFolderSelect Disable folder selection. * @param {boolean} editor.disableFocalPoint Disable focal point editor for selected media. * @param {array} editor.updatedMediaNodes A list of ids for media items that have been updated through the media picker. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function mediaPicker(editor) { @@ -599,10 +604,11 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens the media crop details editor in infinite editing, the submit callback returns the updated media object. + * * @param {object} editor rendering options. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. - * @returns {object} editor object + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. + * @returns {object} editor object. */ function mediaCropDetails(editor) { editor.view = "views/common/infiniteeditors/mediapicker/overlays/mediacropdetails.html"; @@ -616,11 +622,12 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens an icon picker in infinite editing, the submit callback returns the selected icon. + * * @param {object} editor rendering options. - * @param {string} editor.icon The CSS class representing the icon - eg. "icon-autofill". - * @param {string} editor.color The CSS class representing the color - eg. "color-red". - * @param {callback} editor.submit Submits the editor. - * @param {callback} editor.close Closes the editor. + * @param {string} editor.icon The CSS class representing the icon - eg. `icon-autofill. + * @param {string} editor.color The CSS class representing the color - eg. color-red. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function iconPicker(editor) { @@ -636,14 +643,15 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens the document type editor in infinite editing, the submit callback returns the alias of the saved document type. + * * @param {object} editor rendering options. * @param {number} editor.id Indicates the ID of the document type to be edited. Alternatively the ID may be set to `-1` in combination with `create` being set to `true` to open the document type editor for creating a new document type. * @param {boolean} editor.create Set to `true` to open the document type editor for creating a new document type. * @param {boolean} editor.noTemplate If `true` and in combination with `create` being set to `true`, the document type editor will not create a corresponding template by default. This is similar to selecting the "Document Type without a template" in the Create dialog. * @param {boolean} editor.isElement If `true` and in combination with `create` being set to `true`, the "Is an Element type" option will be selected by default in the document type editor. * @param {boolean} editor.allowVaryByCulture If `true` and in combination with `create`, the "Allow varying by culture" option will be selected by default in the document type editor. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function documentTypeEditor(editor) { @@ -658,10 +666,11 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens the media type editor in infinite editing, the submit callback returns the saved media type. + * * @param {object} editor rendering options. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. - * @returns {object} editor object + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. + * @returns {object} editor object. */ function mediaTypeEditor(editor) { editor.view = "views/mediatypes/edit.html"; @@ -675,9 +684,10 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens the member type editor in infinite editing, the submit callback returns the saved member type. + * * @param {object} editor rendering options. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function memberTypeEditor(editor) { @@ -692,9 +702,10 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens the query builder in infinite editing, the submit callback returns the generated query. + * * @param {object} editor rendering options. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function queryBuilder(editor) { @@ -709,12 +720,13 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens the query builder in infinite editing, the submit callback returns the generted query. + * * @param {object} editor rendering options. * @param {string} options.section tree section to display. * @param {string} options.treeAlias specific tree to display. * @param {boolean} options.multiPicker should the tree pick one or multiple items before returning. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function treePicker(editor) { @@ -730,9 +742,10 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens the an editor to set node permissions. + * * @param {object} editor rendering options. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function nodePermissions(editor) { @@ -748,9 +761,10 @@ When building a custom infinite editor view you can use the same components as a * * @description * Open an editor to insert code snippets into the code editor. + * * @param {object} editor rendering options. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function insertCodeSnippet(editor) { @@ -766,6 +780,7 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens the user group picker in infinite editing, the submit callback returns an array of the selected user groups. + * * @param {object} editor rendering options. * @param {function} editor.submit Submits the editor. * @param {function} editor.close Closes the editor. @@ -783,10 +798,11 @@ When building a custom infinite editor view you can use the same components as a * @methodOf umbraco.services.editorService * * @description - * Opens the user group picker in infinite editing, the submit callback returns the saved user group + * Opens the user group picker in infinite editing, the submit callback returns the saved user group. + * * @param {object} editor rendering options. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function userGroupEditor(editor) { @@ -801,10 +817,11 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens the template editor in infinite editing, the submit callback returns the saved template. + * * @param {object} editor rendering options. * @param {string} editor.id The template id. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function templateEditor(editor) { @@ -819,9 +836,10 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens the section picker in infinite editing, the submit callback returns an array of the selected sections. + * * @param {object} editor rendering options. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function sectionPicker(editor) { @@ -837,9 +855,10 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens the insert field editor in infinite editing, the submit callback returns the code snippet. + * * @param {object} editor rendering options. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function insertField(editor) { @@ -855,9 +874,10 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens the template sections editor in infinite editing, the submit callback returns the type to insert. + * * @param {object} editor rendering options. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function templateSections(editor) { @@ -873,9 +893,10 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens the section picker in infinite editing, the submit callback returns an array of the selected users. + * * @param {object} editor rendering options. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function userPicker(editor) { @@ -896,8 +917,8 @@ When building a custom infinite editor view you can use the same components as a * @param {array} editor.availableItems Array of available items. * @param {array} editor.selectedItems Array of selected items. When passed in the selected items will be filtered from the available items. * @param {boolean} editor.filter Set to false to hide the filter. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function itemPicker(editor) { @@ -914,8 +935,9 @@ When building a custom infinite editor view you can use the same components as a * @description * Opens a macro picker in infinite editing, the submit callback returns an array of the selected items. * - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. + * @param {object} editor rendering options. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function macroPicker(editor) { @@ -934,8 +956,8 @@ When building a custom infinite editor view you can use the same components as a * * @param {object} editor rendering options. * @param {object} editor.multiPicker Pick one or multiple items. - * @param {function} editor.submit Submits the editor. - * @param {function} editor.close Closes the editor. + * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. + * @param {function} editor.close Callback function when the close button is clicked. * @returns {object} editor object. */ function memberGroupPicker(editor) { @@ -956,7 +978,6 @@ When building a custom infinite editor view you can use the same components as a * @param {boolean} editor.multiPicker Pick one or multiple items. * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. * @param {function} editor.close Callback function when the close button is clicked. - * * @returns {object} editor object. */ function memberPicker(editor) { @@ -974,13 +995,13 @@ When building a custom infinite editor view you can use the same components as a * * @description * Opens a member editor in infinite editing, the submit callback returns the updated member. + * * @param {object} editor rendering options. * @param {string} editor.id The id (GUID) of the member. * @param {boolean} editor.create Create new member. * @param {function} editor.submit Callback function when the submit button is clicked. Returns the editor model object. * @param {function} editor.close Callback function when the close button is clicked. - * @param {string} editor.doctype If editor.create is true, provide member type for the creation of the member. - * + * @param {string} editor.doctype If `editor.create` is `true`, provide member type for the creation of the member. * @returns {object} editor object. */ function memberEditor(editor) { @@ -998,7 +1019,6 @@ When building a custom infinite editor view you can use the same components as a * @description * Internal method to keep track of keyboard shortcuts registered * to each editor so they can be rebound when an editor closes. - * */ function unbindKeyboardShortcuts() { const shortcuts = Utilities.copy(keyboardService.keyboardEvent); @@ -1018,7 +1038,6 @@ When building a custom infinite editor view you can use the same components as a * * @description * Internal method to rebind keyboard shortcuts for the editor in focus. - * */ function rebindKeyboardShortcuts() { // find the shortcuts from the previous editor diff --git a/src/Umbraco.Web.UI.Client/src/common/services/iconhelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/iconhelper.service.js index f26763bd14..f3f5deb695 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/iconhelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/iconhelper.service.js @@ -3,9 +3,9 @@ * @name umbraco.services.iconHelper * @description A helper service for dealing with icons, mostly dealing with legacy tree icons **/ -function iconHelper($http, $q, $sce, $timeout, umbRequestHelper) { +function iconHelper($http, $q, $sce, $timeout) { - var converter = [ + const converter = [ { oldIcon: ".sprNew", newIcon: "add" }, { oldIcon: ".sprDelete", newIcon: "remove" }, { oldIcon: ".sprMove", newIcon: "enter" }, @@ -85,15 +85,61 @@ function iconHelper($http, $q, $sce, $timeout, umbRequestHelper) { { oldIcon: ".sprTreeDeveloperPython", newIcon: "icon-linux" } ]; - var collectedIcons; + let collectedIcons; - var imageConverter = [ - {oldImage: "contour.png", newIcon: "icon-umb-contour"} - ]; + let imageConverter = [ + {oldImage: "contour.png", newIcon: "icon-umb-contour"} + ]; - var iconCache = []; - var liveRequests = []; - var allIconsRequested = false; + const iconCache = []; + const promiseQueue = []; + let resourceLoadStatus = "none"; + + /** + * This is the same approach as use for loading the localized text json + * We don't want multiple requests for the icon collection, so need to track + * the current request state, and resolve the queued requests once the icons arrive + * Subsequent requests are returned immediately as the icons are cached into + */ + function init() { + const deferred = $q.defer(); + + if (resourceLoadStatus === "loaded") { + deferred.resolve(iconCache); + return deferred.promise; + } + + if (resourceLoadStatus === "loading") { + promiseQueue.push(deferred); + return deferred.promise; + } + + resourceLoadStatus = "loading"; + + $http({ method: "GET", url: Umbraco.Sys.ServerVariables.umbracoUrls.iconApiBaseUrl + 'GetIcons' }) + .then(function (response) { + resourceLoadStatus = "loaded"; + + for (const [key, value] of Object.entries(response.data.Data)) { + iconCache.push({name: key, svgString: $sce.trustAsHtml(value)}) + } + + deferred.resolve(iconCache); + + //ensure all other queued promises are resolved + for (let p in promiseQueue) { + promiseQueue[p].resolve(iconCache); + } + }, function (err) { + deferred.reject("Something broke"); + //ensure all other queued promises are resolved + for (let p in promiseQueue) { + promiseQueue[p].reject("Something broke"); + } + }); + + return deferred.promise; + } return { @@ -187,67 +233,12 @@ function iconHelper($http, $q, $sce, $timeout, umbRequestHelper) { /** Gets a single IconModel */ getIcon: function(iconName) { - return $q((resolve, reject) => { - var icon = this._getIconFromCache(iconName); - - if(icon !== undefined) { - resolve(icon); - } else { - var iconRequestPath = Umbraco.Sys.ServerVariables.umbracoUrls.iconApiBaseUrl + 'GetIcon?iconName=' + iconName; - - // If the current icon is being requested, wait a bit so that we don't have to make another http request and can instead get the icon from the cache. - // This is a bit rough and ready and could probably be improved used an event based system - if(liveRequests.indexOf(iconRequestPath) >= 0) { - setTimeout(() => { - resolve(this.getIcon(iconName)); - }, 10); - } else { - liveRequests.push(iconRequestPath); - // TODO - fix bug where Umbraco.Sys.ServerVariables.umbracoUrls.iconApiBaseUrl is undefinied when help icon - umbRequestHelper.resourcePromise( - $http.get(iconRequestPath) - ,'Failed to retrieve icon: ' + iconName) - .then(icon => { - if(icon) { - var trustedIcon = this.defineIcon(icon.Name, icon.SvgString); - - liveRequests = _.filter(liveRequests, iconRequestPath); - - resolve(trustedIcon); - } - }) - .catch(err => { - console.warn(err); - }); - }; - - } - }); + return init().then(icons => icons.find(i => i.name === iconName)); }, /** Gets all the available icons in the backoffice icon folder and returns them as an array of IconModels */ getAllIcons: function() { - return $q((resolve, reject) => { - if(allIconsRequested === false) { - allIconsRequested = true; - - umbRequestHelper.resourcePromise( - $http.get(Umbraco.Sys.ServerVariables.umbracoUrls.iconApiBaseUrl + 'GetAllIcons') - ,'Failed to retrieve icons') - .then(icons => { - icons.forEach(icon => { - this.defineIcon(icon.Name, icon.SvgString); - }); - - resolve(iconCache); - }) - .catch(err => { - console.warn(err); - });; - } else { - resolve(iconCache); - } - }); + return init().then(icons => icons); }, /** LEGACY - Return a list of icons from icon fonts, optionally filter them */ @@ -312,9 +303,8 @@ function iconHelper($http, $q, $sce, $timeout, umbRequestHelper) { }, /** Returns the cached icon or undefined */ - _getIconFromCache: function(iconName) { - return _.find(iconCache, {name: iconName}); - } + _getIconFromCache: iconName => iconCache.find(icon => icon.name === iconName) + }; } angular.module('umbraco.services').factory('iconHelper', iconHelper); diff --git a/src/Umbraco.Web.UI.Client/src/less/components/editor/umb-editor.less b/src/Umbraco.Web.UI.Client/src/less/components/editor/umb-editor.less index 19d6a1306e..274f74bbac 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/editor/umb-editor.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/editor/umb-editor.less @@ -34,6 +34,17 @@ &--level0 { transform: none; } + + &--small .umb-property { + .control-header { + float: none; + width: 100%; + } + + .controls { + margin-left: 0; + } + } } // use a loop to build the editor levels diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-grid.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-grid.less index 3b084c9905..281284a5ca 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-grid.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-grid.less @@ -401,6 +401,7 @@ text-align: center; text-align: -moz-center; width: 100%; + box-sizing: border-box; } .umb-grid .umb-editor-placeholder i { diff --git a/src/Umbraco.Web.UI.Client/src/less/forms.less b/src/Umbraco.Web.UI.Client/src/less/forms.less index 90b2dbe37e..f38ba8f806 100644 --- a/src/Umbraco.Web.UI.Client/src/less/forms.less +++ b/src/Umbraco.Web.UI.Client/src/less/forms.less @@ -800,9 +800,12 @@ legend + .control-group { // adjustments for properties tab .form-horizontal .block-form .control-label { - display: block; - float: none; - width: 100%; + display: block; + float: none; + width: 100%; +} +.form-horizontal .block-form .controls { + margin-left: 0; } //make sure buttons are always on top diff --git a/src/Umbraco.Web.UI.Client/src/navigation.controller.js b/src/Umbraco.Web.UI.Client/src/navigation.controller.js index a383c2d44a..9f5a6e46c6 100644 --- a/src/Umbraco.Web.UI.Client/src/navigation.controller.js +++ b/src/Umbraco.Web.UI.Client/src/navigation.controller.js @@ -325,6 +325,9 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar var queryParams = {}; if ($scope.selectedLanguage && $scope.selectedLanguage.culture) { queryParams["culture"] = $scope.selectedLanguage.culture; + if (!mainCulture) { + $location.search("mculture", $scope.selectedLanguage.culture); + } } var queryString = $.param(queryParams); //create the query string from the params object } diff --git a/src/Umbraco.Web.UI.Client/src/utilities.js b/src/Umbraco.Web.UI.Client/src/utilities.js index 64884b589b..01e18e4e1c 100644 --- a/src/Umbraco.Web.UI.Client/src/utilities.js +++ b/src/Umbraco.Web.UI.Client/src/utilities.js @@ -71,28 +71,29 @@ const isScope = obj => obj && obj.$evalAsync && obj.$watch; const toJsonReplacer = (key, value) => { - var val = value; + var val = value; if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') { - val = undefined; + val = undefined; } else if (isWindow(value)) { - val = '$WINDOW'; - } else if (value && window.document === value) { - val = '$DOCUMENT'; + val = '$WINDOW'; + } else if (value && window.document === value) { + val = '$DOCUMENT'; } else if (isScope(value)) { - val = '$SCOPE'; - } + val = '$SCOPE'; + } return val; - } + }; + /** * Equivalent to angular.toJson */ const toJson = (obj, pretty) => { if (isUndefined(obj)) return undefined; if (!isNumber(pretty)) { - pretty = pretty ? 2 : null; + pretty = pretty ? 2 : null; } return JSON.stringify(obj, toJsonReplacer, pretty); - } + }; /** * Equivalent to angular.fromJson @@ -102,7 +103,7 @@ return val; } return JSON.parse(val); - } + }; /** * Not equivalent to angular.forEach. But like the angularJS method this does not fail on null or undefined. @@ -112,7 +113,7 @@ return obj.forEach(iterator); } return obj; - } + }; let _utilities = { noop: noop, diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/blockeditor/blockeditor.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/blockeditor/blockeditor.controller.js index 88cda027a8..d3a87791f9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/blockeditor/blockeditor.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/blockeditor/blockeditor.controller.js @@ -1,6 +1,7 @@ angular.module("umbraco") .controller("Umbraco.Editors.BlockEditorController", function ($scope, localizationService, formHelper, overlayService) { + var vm = this; vm.model = $scope.model; @@ -52,7 +53,7 @@ angular.module("umbraco") vm.saveButtonState = "error"; } } - } + }; vm.close = function () { if (vm.model && vm.model.close) { @@ -93,7 +94,7 @@ angular.module("umbraco") } } - } + }; } ); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/blockeditor/blockeditor.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/blockeditor/blockeditor.html index 2367771804..8fe5526c53 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/blockeditor/blockeditor.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/blockeditor/blockeditor.html @@ -1,4 +1,4 @@ -
+
@@ -14,20 +14,12 @@ hide-description="true"> -
+ - + + -
- - -
- -
+ diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/blockpicker/blockpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/blockpicker/blockpicker.controller.js index 2894e0bef4..90803a3765 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/blockpicker/blockpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/blockpicker/blockpicker.controller.js @@ -1,11 +1,14 @@ angular.module("umbraco") .controller("Umbraco.Editors.BlockPickerController", function ($scope, localizationService) { - var vm = this; + var vm = this; vm.navigation = []; + vm.filter = { + searchTerm: '' + }; localizationService.localizeMany(["blockEditor_tabCreateEmpty", "blockEditor_tabClipboard"]).then( function (data) { @@ -28,33 +31,32 @@ angular.module("umbraco") vm.activeTab = vm.navigation[0]; } ); - - vm.onNavigationChanged = function(tab) { + vm.onNavigationChanged = function (tab) { vm.activeTab.active = false; vm.activeTab = tab; vm.activeTab.active = true; - } + }; - vm.clickClearClipboard = function() { + vm.clickClearClipboard = function () { vm.onNavigationChanged(vm.navigation[0]); vm.navigation[1].disabled = true;// disabled ws determined when creating the navigation, so we need to update it here. vm.model.clipboardItems = [];// This dialog is not connected via the clipboardService events, so we need to update manually. vm.model.clickClearClipboard(); - } + }; vm.model = $scope.model; - vm.selectItem = function(item, $event) { + vm.selectItem = function (item, $event) { vm.model.selectedItem = item; vm.model.submit($scope.model, $event); - } + }; - vm.close = function() { + vm.close = function () { if ($scope.model && $scope.model.close) { $scope.model.close($scope.model); } - } + }; } ); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/blockpicker/blockpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/blockpicker/blockpicker.html index 4b08d4e5fc..b72de0960d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/blockpicker/blockpicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/blockpicker/blockpicker.html @@ -12,35 +12,35 @@ hide-description="true"> -
+ -
+
- -
+
+
-
+ diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/datatypesettings/datatypesettings.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/datatypesettings/datatypesettings.html index 428905020b..77cfc705a3 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/datatypesettings/datatypesettings.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/datatypesettings/datatypesettings.html @@ -36,13 +36,15 @@
- -
- - - - - + +
+
+ + + + +
+ diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/embed/embed.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/embed/embed.controller.js index c3d1312109..e29ba996c7 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/embed/embed.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/embed/embed.controller.js @@ -18,8 +18,11 @@ preview: "", success: false, info: "", - supportsDimensions: false - }; + a11yInfo: "", + supportsDimensions: false, + originalWidth: 360, + originalHeight: 240 + }; if ($scope.model.modify) { Utilities.extend($scope.model.embed, $scope.model.modify); @@ -32,8 +35,8 @@ vm.changeSize = changeSize; vm.submit = submit; vm.close = close; - - function onInit() { + + function onInit() { if (!$scope.model.title) { localizationService.localize("general_embed").then(function(value){ $scope.model.title = value; @@ -46,8 +49,8 @@ if ($scope.model.embed.url) { $scope.model.embed.show = true; $scope.model.embed.info = ""; + $scope.model.embed.a11yInfo = ""; $scope.model.embed.success = false; - vm.loading = true; $http({ @@ -67,6 +70,7 @@ //not supported $scope.model.embed.preview = ""; $scope.model.embed.info = "Not supported"; + $scope.model.embed.a11yInfo = $scope.model.embed.info; $scope.model.embed.success = false; $scope.model.embed.supportsDimensions = false; vm.trustedPreview = null; @@ -75,6 +79,7 @@ //error $scope.model.embed.preview = ""; $scope.model.embed.info = "Could not embed media - please ensure the URL is valid"; + $scope.model.embed.a11yInfo = $scope.model.embed.info; $scope.model.embed.success = false; $scope.model.embed.supportsDimensions = false; vm.trustedPreview = null; @@ -83,6 +88,8 @@ $scope.model.embed.success = true; $scope.model.embed.supportsDimensions = response.data.SupportsDimensions; $scope.model.embed.preview = response.data.Markup; + $scope.model.embed.info = ""; + $scope.model.embed.a11yInfo = "Retrieved URL"; vm.trustedPreview = $sce.trustAsHtml(response.data.Markup); break; } @@ -94,24 +101,28 @@ $scope.model.embed.supportsDimensions = false; $scope.model.embed.preview = ""; $scope.model.embed.info = "Could not embed media - please ensure the URL is valid"; - + $scope.model.embed.a11yInfo = $scope.model.embed.info; vm.loading = false; }); } else { $scope.model.embed.supportsDimensions = false; $scope.model.embed.preview = ""; $scope.model.embed.info = "Please enter a URL"; + $scope.model.embed.a11yInfo = $scope.model.embed.info; } } function changeSize(type) { - var width, height; + var width = parseInt($scope.model.embed.width, 10); + var height = parseInt($scope.model.embed.height, 10); + var originalWidth = parseInt($scope.model.embed.originalWidth, 10); + var originalHeight = parseInt($scope.model.embed.originalHeight, 10); + var resize = originalWidth !== width || originalHeight !== height; if ($scope.model.embed.constrain) { - width = parseInt($scope.model.embed.width, 10); - height = parseInt($scope.model.embed.height, 10); - if (type == 'width') { + + if (type === 'width') { origHeight = Math.round((width / origWidth) * height); $scope.model.embed.height = origHeight; } else { @@ -119,9 +130,12 @@ $scope.model.embed.width = origWidth; } } - if ($scope.model.embed.url !== "") { + $scope.model.embed.originalWidth = $scope.model.embed.width; + $scope.model.embed.originalHeight = $scope.model.embed.height; + if ($scope.model.embed.url !== "" && resize) { showPreview(); } + } function toggleConstrain() { @@ -138,7 +152,7 @@ if ($scope.model && $scope.model.close) { $scope.model.close(); } - } + } onInit(); } diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/embed/embed.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/embed/embed.html index 19cf9b2278..fd86f55c07 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/embed/embed.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/embed/embed.html @@ -15,7 +15,7 @@ - + -

+ +
- - + + - - + + - - + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/iconpicker/iconpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/iconpicker/iconpicker.controller.js index 59a9aed4bb..51c2c15898 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/iconpicker/iconpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/iconpicker/iconpicker.controller.js @@ -10,6 +10,10 @@ function IconPickerController($scope, localizationService, iconHelper) { var vm = this; + vm.filter = { + searchTerm: '' + }; + vm.selectIcon = selectIcon; vm.selectColor = selectColor; vm.submit = submit; diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/iconpicker/iconpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/iconpicker/iconpicker.html index 7368d2f39b..19fe679189 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/iconpicker/iconpicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/iconpicker/iconpicker.html @@ -20,7 +20,7 @@
    -
  • +
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/application/umb-navigation.html b/src/Umbraco.Web.UI.Client/src/views/components/application/umb-navigation.html index 86e905183c..bb4b025410 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/application/umb-navigation.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/application/umb-navigation.html @@ -23,7 +23,7 @@ class="umb-language-picker__dropdown-item" ng-class="{'umb-language-picker__dropdown-item--current': language.active}" ng-click="selectLanguage(language)" - ng-repeat="language in languages | orderBy:'name'" + ng-repeat="language in languages" > Switch language to diff --git a/src/Umbraco.Web.UI.Client/src/views/components/content/umb-variant-content.html b/src/Umbraco.Web.UI.Client/src/views/components/content/umb-variant-content.html index 40a88ae6a6..9efc0e80bd 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/content/umb-variant-content.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/content/umb-variant-content.html @@ -36,7 +36,8 @@
- + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/content/recyclebin.html b/src/Umbraco.Web.UI.Client/src/views/content/recyclebin.html index 2981097656..410ad938f8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/recyclebin.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/recyclebin.html @@ -11,7 +11,8 @@
- + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/contentblueprints/intro.html b/src/Umbraco.Web.UI.Client/src/views/contentblueprints/intro.html index 66695ace91..57c29d31d6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/contentblueprints/intro.html +++ b/src/Umbraco.Web.UI.Client/src/views/contentblueprints/intro.html @@ -17,7 +17,7 @@ What are Content Templates?

- Content Templates are pre-defined content that can be selected when creating a new content node. + Content Templates are pre-defined content that can be selected when creating a new content node.

diff --git a/src/Umbraco.Web.UI.Client/src/views/dictionary/list.html b/src/Umbraco.Web.UI.Client/src/views/dictionary/list.html index de7beae0cc..84c138c180 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dictionary/list.html +++ b/src/Umbraco.Web.UI.Client/src/views/dictionary/list.html @@ -32,19 +32,21 @@ - + - + - + diff --git a/src/Umbraco.Web.UI.Client/src/views/languages/overview.html b/src/Umbraco.Web.UI.Client/src/views/languages/overview.html index 95cb7c535f..9a11691e09 100644 --- a/src/Umbraco.Web.UI.Client/src/views/languages/overview.html +++ b/src/Umbraco.Web.UI.Client/src/views/languages/overview.html @@ -36,7 +36,7 @@ - + {{ language.name }} diff --git a/src/Umbraco.Web.UI.Client/src/views/macros/views/settings.html b/src/Umbraco.Web.UI.Client/src/views/macros/views/settings.html index 9825a6f919..c152c33193 100644 --- a/src/Umbraco.Web.UI.Client/src/views/macros/views/settings.html +++ b/src/Umbraco.Web.UI.Client/src/views/macros/views/settings.html @@ -1,62 +1,76 @@ 
- - - - - {{model.macro.id}}
- {{model.macro.key}} -
-
-
- - - - - - +
- +
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
{{model.macro.id}}
+ {{model.macro.key}} +
+
+
+
+ +
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/Umbraco.Web.UI.Client/src/views/media/edit.html b/src/Umbraco.Web.UI.Client/src/views/media/edit.html index d2782a2a21..8f8a62474b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/media/edit.html @@ -23,7 +23,8 @@
- + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/media/media.sort.controller.js b/src/Umbraco.Web.UI.Client/src/views/media/media.sort.controller.js index 95aeb239b9..2cc27be914 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/media.sort.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/media/media.sort.controller.js @@ -11,6 +11,8 @@ vm.saveButtonState = "init"; vm.sortOrder = {}; vm.sortableOptions = { + axis: "y", + containment: "parent", distance: 10, tolerance: "pointer", opacity: 0.7, diff --git a/src/Umbraco.Web.UI.Client/src/views/media/recyclebin.html b/src/Umbraco.Web.UI.Client/src/views/media/recyclebin.html index cd4ad6d07e..fddf63bef3 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/recyclebin.html +++ b/src/Umbraco.Web.UI.Client/src/views/media/recyclebin.html @@ -12,7 +12,8 @@
- + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/media/sort.html b/src/Umbraco.Web.UI.Client/src/views/media/sort.html index a483e9c7dc..05a55f435f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/sort.html +++ b/src/Umbraco.Web.UI.Client/src/views/media/sort.html @@ -19,19 +19,17 @@ diff --git a/src/Umbraco.Web.UI.Client/src/views/member/edit.html b/src/Umbraco.Web.UI.Client/src/views/member/edit.html index 3fec222350..50c986bd6a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/member/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/member/edit.html @@ -26,7 +26,8 @@
- + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/member/list.html b/src/Umbraco.Web.UI.Client/src/views/member/list.html index a61614e8f5..4f27b54aa9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/member/list.html +++ b/src/Umbraco.Web.UI.Client/src/views/member/list.html @@ -18,7 +18,8 @@
- + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js index 56dbc68d90..613e6a8c6a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js @@ -241,23 +241,24 @@ block.hideContentInOverlay = block.config.forceHideContentEditorInOverlay === true || inlineEditing === true; block.showSettings = block.config.settingsElementTypeKey != null; - block.showCopy = vm.supportCopy && block.config.contentElementTypeKey != null;// if we have content, otherwise it doesn't make sense to copy. + // If we have content, otherwise it doesn't make sense to copy. + block.showCopy = vm.supportCopy && block.config.contentElementTypeKey != null; // Index is set by umbblocklistblock component and kept up to date by it. block.index = 0; block.setParentForm = function (parentForm) { this._parentForm = parentForm; - } + }; block.activate = activateBlock.bind(null, block); block.edit = function () { var blockIndex = vm.layout.indexOf(this.layout); editBlock(this, false, blockIndex, this._parentForm); - } + }; block.editSettings = function () { var blockIndex = vm.layout.indexOf(this.layout); editBlock(this, true, blockIndex, this._parentForm); - } + }; block.requestDelete = requestDeleteBlock.bind(null, block); block.delete = deleteBlock.bind(null, block); block.copy = copyBlock.bind(null, block); @@ -265,7 +266,6 @@ return block; } - function addNewBlock(index, contentElementTypeKey) { // Create layout entry. (not added to property model jet.) @@ -292,7 +292,6 @@ vm.setBlockFocus(blockObject); return true; - } function deleteBlock(block) { @@ -316,7 +315,6 @@ }); modelObject.removeDataAndDestroyModel(block); - } function deleteAllBlocks() { @@ -409,6 +407,7 @@ } vm.showCreateDialog = showCreateDialog; + function showCreateDialog(createIndex, $event) { if (vm.blockTypePicker) { @@ -524,7 +523,7 @@ }; - var requestCopyAllBlocks = function() { + var requestCopyAllBlocks = function () { var aliases = []; @@ -534,7 +533,7 @@ aliases.push(entry.$block.content.contentTypeAlias); // No need to clone the data as its begin handled by the clipboardService. - return {"layout": entry.$block.layout, "data": entry.$block.data, "settingsData":entry.$block.settingsData} + return { "layout": entry.$block.layout, "data": entry.$block.data, "settingsData": entry.$block.settingsData } } ); @@ -543,9 +542,9 @@ var contentNodeName = "?"; var contentNodeIcon = null; - if(vm.umbVariantContent) { + if (vm.umbVariantContent) { contentNodeName = vm.umbVariantContent.editor.content.name; - if(vm.umbVariantContentEditors) { + if (vm.umbVariantContentEditors) { contentNodeIcon = vm.umbVariantContentEditors.content.icon.split(" ")[0]; } else if (vm.umbElementEditorContent) { contentNodeIcon = vm.umbElementEditorContent.model.documentType.icon.split(" ")[0]; @@ -555,13 +554,15 @@ contentNodeIcon = vm.umbElementEditorContent.model.documentType.icon.split(" ")[0]; } - localizationService.localize("clipboard_labelForArrayOfItemsFrom", [vm.model.label, contentNodeName]).then(function(localizedLabel) { + localizationService.localize("clipboard_labelForArrayOfItemsFrom", [vm.model.label, contentNodeName]).then(function (localizedLabel) { clipboardService.copyArray(clipboardService.TYPES.BLOCK, aliases, elementTypesToCopy, localizedLabel, contentNodeIcon || "icon-thumbnail-list", vm.model.id); }); - } + }; + function copyBlock(block) { clipboardService.copy(clipboardService.TYPES.BLOCK, block.content.contentTypeAlias, {"layout": block.layout, "data": block.data, "settingsData":block.settingsData}, block.label, block.content.icon, block.content.udi); } + function requestPasteFromClipboard(index, pasteEntry, pasteType) { if (pasteEntry === undefined) { @@ -599,7 +600,6 @@ vm.currentBlockInFocus = blockObject; return true; - } function requestDeleteBlock(block) { @@ -620,6 +620,7 @@ overlayService.confirmDelete(overlay); }); } + function requestDeleteAllBlocks() { localizationService.localizeMany(["content_nestedContentDeleteAllItems", "general_delete"]).then(function (data) { overlayService.confirmDelete({ @@ -647,7 +648,7 @@ requestDeleteBlock: requestDeleteBlock, deleteBlock: deleteBlock, openSettingsForBlock: openSettingsForBlock - } + }; vm.sortableOptions = { axis: "y", @@ -664,7 +665,6 @@ } }; - function onAmountOfBlocksChanged() { // enable/disable property actions diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.createButton.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.createButton.controller.js index 98d4f4ea3a..365ec809ac 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.createButton.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.createButton.controller.js @@ -9,9 +9,9 @@ var vm = this; vm.plusPosX = 0; - vm.onMouseMove = function($event) { + vm.onMouseMove = function ($event) { vm.plusPosX = $event.offsetX; - } + }; }); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbblocklistblock.component.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbblocklistblock.component.js index 41d76475e4..285437b011 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbblocklistblock.component.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbblocklistblock.component.js @@ -78,7 +78,7 @@ model.block.index = index; model.block.updateLabel(); } - } + }; } diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.controller.js index c1b432b36e..886d051f4d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.controller.js @@ -2,16 +2,16 @@ function ColorPickerController($scope, $timeout) { var vm = this; - //setup the default config + // setup the default config var config = { items: [], multiple: false }; - //map the user config - angular.extend(config, $scope.model.config); + // map the user config + Utilities.extend(config, $scope.model.config); - //map back to the model + // map back to the model $scope.model.config = config; $scope.isConfigured = $scope.model.config && $scope.model.config.items && _.keys($scope.model.config.items).length > 0; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/decimal/decimal.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/decimal/decimal.html index ac2fdabf3d..fb68a67c60 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/decimal/decimal.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/decimal/decimal.html @@ -9,10 +9,15 @@ aria-required="{{model.validation.mandatory}}" id="{{model.alias}}" val-server="value" - fix-number min="{{model.config.min}}" max="{{model.config.max}}" step="{{model.config.step}}" /> + min="{{model.config.min}}" + max="{{model.config.max}}" + step="{{model.config.step}}" + ng-step="model.config.step" + fix-number /> - + Not a number + Not a valid numeric step size {{decimalFieldForm.decimalField.errorMsg}} diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/eyedropper/eyedropper.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/eyedropper/eyedropper.controller.js new file mode 100644 index 0000000000..82a0d18cab --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/eyedropper/eyedropper.controller.js @@ -0,0 +1,44 @@ +function EyeDropperColorPickerController($scope, angularHelper) { + + var vm = this; + + //setup the default config + var config = { + showAlpha: true, + showPalette: true, + allowEmpty: true + }; + + // map the user config + Utilities.extend(config, $scope.model.config); + + // map back to the model + $scope.model.config = config; + + vm.options = $scope.model.config; + + vm.color = $scope.model.value || null; + + vm.selectColor = function (color) { + angularHelper.safeApply($scope, function () { + vm.color = color ? color.toString() : null; + $scope.model.value = vm.color; + $scope.propertyForm.selectedColor.$setViewValue(vm.color); + }); + }; + + // Method required by the valPropertyValidator directive (returns true if the property editor has at least one color selected) + $scope.validateMandatory = function () { + var isValid = !$scope.model.validation.mandatory || ( + $scope.model.value != null + && $scope.model.value != ""); + + return { + isValid: isValid, + errorMsg: $scope.model.validation.mandatoryMessage || "Value cannot be empty", + errorKey: "required" + }; + }; +} + +angular.module("umbraco").controller("Umbraco.PropertyEditors.EyeDropperColorPickerController", EyeDropperColorPickerController); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/eyedropper/eyedropper.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/eyedropper/eyedropper.html new file mode 100644 index 0000000000..821f50f92b --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/eyedropper/eyedropper.html @@ -0,0 +1,11 @@ +
+ + + + + + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.html index 91abc3be87..84ddf7ee3b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/imagecropper/imagecropper.html @@ -28,9 +28,9 @@

- - - + + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js index f262647a0d..e1238313cc 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js @@ -105,12 +105,13 @@ localizationService.localizeMany(["grid_addElement", "content_createEmpty", "actions_copy"]).then(function (data) { labels.grid_addElement = data[0]; labels.content_createEmpty = data[1]; - labels.copy_icon_title = data[2] + labels.copy_icon_title = data[2]; }); - function setCurrentNode(node) { + function setCurrentNode(node, focusNode) { updateModel(); vm.currentNode = node; + vm.focusOnNode = focusNode; } var copyAllEntries = function () { @@ -180,7 +181,7 @@ var newNode = createNode(scaffold, null); - setCurrentNode(newNode); + setCurrentNode(newNode, true); setDirty(); validate(); }; @@ -202,7 +203,6 @@ }); const dialog = { - view: "itempicker", orderBy: "$index", view: "itempicker", event: $event, @@ -277,9 +277,9 @@ vm.editNode = function (idx) { if (vm.currentNode && vm.currentNode.key === vm.nodes[idx].key) { - setCurrentNode(null); + setCurrentNode(null, false); } else { - setCurrentNode(vm.nodes[idx]); + setCurrentNode(vm.nodes[idx], true); } }; @@ -500,7 +500,7 @@ setDirty(); //updateModel();// done by setting current node... - setCurrentNode(newNode); + setCurrentNode(newNode, true); } function checkAbilityToPasteContent() { @@ -592,7 +592,7 @@ // If there is only one item, set it as current node if (vm.singleMode || (vm.nodes.length === 1 && vm.maxItems === 1)) { - setCurrentNode(vm.nodes[0]); + setCurrentNode(vm.nodes[0], false); } validate(); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.propertyeditor.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.propertyeditor.html index f853387612..aaebb5d07e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.propertyeditor.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.propertyeditor.html @@ -16,7 +16,7 @@
+ umb-auto-focus="{{vm.focusOnNode && vm.currentNode.key === node.key ? 'true' : 'false'}}">
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/notsupported/notsupported.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/notsupported/notsupported.html index a2fbb0e907..f052415a05 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/notsupported/notsupported.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/notsupported/notsupported.html @@ -1,3 +1,3 @@
- +
diff --git a/src/Umbraco.Web.UI.Client/src/views/relationtypes/views/relationType.html b/src/Umbraco.Web.UI.Client/src/views/relationtypes/views/relationType.html index 100d8d9d09..8f910a6c86 100644 --- a/src/Umbraco.Web.UI.Client/src/views/relationtypes/views/relationType.html +++ b/src/Umbraco.Web.UI.Client/src/views/relationtypes/views/relationType.html @@ -1,46 +1,63 @@
- - - - -
{{model.relationType.id}}
- {{model.relationType.key}} -
- - -
    -
  • - - -
  • -
  • - - -
  • -
-
+
- - -
{{model.relationType.parentObjectTypeName}}
-
+
- - -
{{model.relationType.childObjectTypeName}}
-
+ + - - -
{{model.relationType.relations.length}}
-
-
-
+ + +
    +
  • + + +
  • +
  • + + +
  • +
+
+ + + +
{{model.relationType.parentObjectTypeName}}
+
+ + + +
{{model.relationType.childObjectTypeName}}
+
+ + + +
{{model.relationType.relations.length}}
+
+ + + +
+ +
+ + + + +
{{model.relationType.id}}
+ {{model.relationType.key}} +
+
+
+
+ +
+
diff --git a/src/Umbraco.Web.UI/Umbraco/Views/Default.cshtml b/src/Umbraco.Web.UI/Umbraco/Views/Default.cshtml index eefd182aff..5166815a1c 100644 --- a/src/Umbraco.Web.UI/Umbraco/Views/Default.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/Views/Default.cshtml @@ -121,12 +121,6 @@ @Html.AngularValueResetPasswordCodeInfoScript(ViewData["PasswordResetCode"]) @Html.AngularValueTinyMceAssets() - app.run(["iconHelper", function (iconHelper) { - @* We inject icons to the icon helper(service), since icons can only be loaded if user is authorized. By injecting these to the service they will not be requested as they will become cached. *@ - iconHelper.defineIcon("icon-check", '@Html.Raw(Model.IconCheckData)'); - iconHelper.defineIcon("icon-delete", '@Html.Raw(Model.IconDeleteData)'); - }]); - //required for the noscript trick document.getElementById("mainwrapper").style.display = "inherit"; diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/cs.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/cs.xml index 2375ebaf6d..61c4abcade 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/cs.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/cs.xml @@ -373,7 +373,7 @@ Prohlédnout svůj web - Skrýt - Jestli se umbraco neotevírá, možná budete muset povolit na tomto webu vyskakovací okna + Jestli se Umbraco neotevírá, možná budete muset povolit na tomto webu vyskakovací okna byl otevřený v novém okně Restart Navštívit @@ -837,29 +837,29 @@ Heslo výchozího uživatele bylo úspěšně změněno od doby instalace!

Netřeba nic dalšího dělat. Klikněte na Následující pro pokračování.]]> Heslo je změněno! Mějte skvělý start, sledujte naše uváděcí videa - Kliknutím na tlačítko následující (nebo modifikováním umbracoConfigurationStatus v souboru web.config) přijímáte licenci tohoto software tak, jak je uvedena v poli níže. Upozorňujeme, že tato distribuce Umbraca se skládá ze dvou různých licencí, open source MIT licence pro framework a umbraco freeware licence, která pokrývá UI. + Kliknutím na tlačítko následující (nebo modifikováním umbracoConfigurationStatus v souboru web.config) přijímáte licenci tohoto software tak, jak je uvedena v poli níže. Upozorňujeme, že tato distribuce Umbraca se skládá ze dvou různých licencí, open source MIT licence pro framework a Umbraco freeware licence, která pokrývá UI. Není nainstalováno. Dotčené soubory a složky - Další informace o nastavování oprávnění pro umbraco zde + Další informace o nastavování oprávnění pro Umbraco zde Musíte udělit ASP.NET oprávnění měnit následující soubory/složky Vaše nastavení oprávnění je téměř dokonalé!

- Můžete provozovat umbraco bez potíží, ale nebudete smět instalovat balíčky, které jsou doporučené pro plné využívání všech možností umbraca.]]>
+ Můžete provozovat Umbraco bez potíží, ale nebudete smět instalovat balíčky, které jsou doporučené pro plné využívání všech možností umbraca.]]> Jak to vyřešit Klikněte zde, chcete-li číst textovou verzi výukové video o nastavovaní oprávnění pro složky umbraca, nebo si přečtěte textovou verzi.]]> Vaše nastavení oprávnění může být problém!

- Můžete provozovat umbraco bez potíží, ale nebudete smět vytvářet složky a instalovat balíčky, které jsou doporučené pro plné využívání všech možností umbraca.]]>
+ Můžete provozovat Umbraco bez potíží, ale nebudete smět vytvářet složky a instalovat balíčky, které jsou doporučené pro plné využívání všech možností umbraca.]]> Vaše nastavení oprívnění není připraveno pro umbraco!

- Abyste mohli umbraco provozovat, budete muset aktualizovat Vaše nastavení oprávnění.]]>
+ Abyste mohli Umbraco provozovat, budete muset aktualizovat Vaše nastavení oprávnění.]]> Vaše nastavení oprávnění je dokonalé!

- Jste připraveni provozovat umbraco a instalovat balíčky!]]>
+ Jste připraveni provozovat Umbraco a instalovat balíčky!]]> Řešení potíží se složkami Následujte tento odkaz pro další informace o potížích s ASP.NET a vytvářením složek. Nastavování oprávnění pro složky Chci začít od nuly @@ -898,7 +898,7 @@ Abyste získali pomoc od naší oceňované komunity, projděte si dokumentaci, nebo si pusťte některá videa zdarma o tom, jak vytvořit jednoduchý web, jak používat balíčky a rychlý úvod do terminologie umbraca]]> Umbraco %0% je nainstalováno a připraveno k použití soubor /web.config a upravit klíč AppSetting umbracoConfigurationStatus dole na hodnotu '%0%'.]]> - ihned začít kliknutím na tlačítko "Spustit Umbraco" níže.
Jestliže je pro Vás umbraco nové, + ihned začít kliknutím na tlačítko "Spustit Umbraco" níže.
Jestliže je pro Vás Umbraco nové, spoustu zdrojů naleznete na naších stránkách "začínáme".]]>
Spustit Umbraco Chcete-li spravovat Váš web, jednoduše přejděte do administrace umbraca a začněte přidávat obsah, upravovat šablony a stylopisy, nebo přidávat nové funkce]]> @@ -980,7 +980,7 @@ Vyžadováno resetování hesla

- Vaše uživatelské jméno pro přihlášení do back-office Umbraco je: %0% + Vaše uživatelské jméno pro přihlášení do backoffice Umbraco je: %0%

@@ -1055,7 +1055,7 @@ Mějte hezký den! - Zdraví umbraco robot + Zdraví Umbraco robot ]]>Následující jazyky byly změněny %0%Ahoj %0%

@@ -1083,7 +1083,7 @@

Mějte hezký den!

- Zdraví umbraco robot + Zdraví Umbraco robot

]]>
Byly změněny následující jazyky:

%0% @@ -1097,7 +1097,7 @@ Vytvořit balíček - a výběrem balíčku. Balíčky umbraco mají obvykle přípony ".umb" nebo ".zip". + a výběrem balíčku. Balíčky Umbraco mají obvykle přípony ".umb" nebo ".zip". ]]> Tím se balíček odstraní Přetáhněte sem pro nahrání @@ -1328,7 +1328,6 @@ Záložky Nadřazený typ obsahu povolen Tento typ obsahu používá - jako nadřazený typ obsahu. Záložky z nadřazených typů obsahu nejsou zobrazeny a mohou byt editovány pouze na nadřazených typech obsahu samotných Na této záložce nejsou definovány žádné vlastnosti. Pro vytvoření nové vlastnosti klikněte na odkaz "přidat novou vlastnost" nahoře. Vytvořit odpovídající šablonu Přidat ikonu diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/cy.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/cy.xml index eacfcde1bf..0b00cfd423 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/cy.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/cy.xml @@ -589,7 +589,7 @@ Offer i reoli'r mynegai meysydd Ni ellir darllen yr mynegai a bydd angen ei ailadeiladu - Mae'r broses yn cymryd mwy o amser na'r disgwyl, gwiriwch y log umbraco i weld os mae wedi bod unrhyw wall yn ystod y gweithrediad hwn + Mae'r broses yn cymryd mwy o amser na'r disgwyl, gwiriwch y log Umbraco i weld os mae wedi bod unrhyw wall yn ystod y gweithrediad hwn Ni ellir ailadeiladu'r mynegai hwn oherwydd nad yw wedi'i aseinio IIndexPopulator @@ -676,7 +676,6 @@ %0% yn faes ofynnol %0% yn %1% mewn fformat annilys %0% mewn fformat annilys - Briodwedd '%0%' yn defnyddio'r golygydd '%1%' sydd ddim wedi ei chynnal yn y teipiau elfen. Derbynwyd gwall o'r gweinydd @@ -701,7 +700,6 @@ Symudwch y cyrchwr ar ochr chwith y ddwy gell yr ydych eisiau cyfuno Ni allwch hollti cell sydd heb ei gyfuno. Mae gan briodwedd hon gwallau - Priodwedd '%0%' yn defnyddio'r golygydd '%1%' sydd ddim yn cael ei gefnogi mewn Mathau o Elfen. Gwall yn y ffynhonnell XSLT Nid yw'r XSLTwedi'i achub gan ei fod yn cynnwys gwall(au) Mae gwall ffurfwedd gyda'r math o ddata sy'n cael ei ddefnyddio ar gyfer y priodwedd yma, gwiriwch y fath o ddata @@ -1566,7 +1564,6 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang Tabiau Math o Gynnwys Meistr wedi'i alluogi Mae'r Math o Gynnwys yma yn defnyddio - fel Math o Gynnwys Meistr. Nid yw tabiau o Fath o Gynnwys Meistr yn cael eu dangos a gall dim ond eu golygu ar y Math o Gynnwys Meistr ei hunan Dim priodweddau wedi'u diffinio ar y tab yma. Cliciwch ar y ddolen "ychwanegu priodwedd newydd" ar y topi greu priodwedd newydd. Math o Ddogfen Feistr Creu templedi cydweddol @@ -2763,6 +2760,7 @@ Er mwyn gweinyddu eich gwefan, agorwch swyddfa gefn Umbraco a dechreuwch ychwang Rydych chi wedi gwneud newidiadau i'r cynnwys hwn. Wyt ti'n siŵr eich bod chi am eu taflu ei fwrdd? Gwaredu cread? + Priodwedd '%0%' yn defnyddio'r golygydd '%1%' sydd ddim yn cael ei gefnogi mewn blociau. Beth yw Templedi Gynnwys diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml index 494416d777..250b1b4579 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/da.xml @@ -307,6 +307,7 @@ Vælg dato og klokkeslæt for at udgive og/eller afpublicere indholdet. Opret ny Indsæt fra udklipsmappen + Dette element er i papirkurven Opret en ny indholdsskabelon fra '%0%' @@ -623,7 +624,6 @@ Du skal stå til venstre for de 2 celler du ønsker at samle! Du kan ikke opdele en celle, som ikke allerede er delt. Denne egenskab er ugyldig - Feltet %0% bruger editor %1% som ikke er supporteret for ElementTyper. Om @@ -949,7 +949,7 @@ Mange hilsner fra Umbraco robotten

Dette er en automatisk mail for at informere dig om at opgaven '%1%' er blevet udførtpå siden '%2%' af brugeren '%3%'

Opdateringssammendrag:

%6%

Hav en fortsat god dag!

De bedste hilsner fra umbraco robotten

]]>
+      RET       

Opdateringssammendrag:

%6%

Hav en fortsat god dag!

De bedste hilsner fra Umbraco robotten

]]> [%0%] Notificering om %1% udført på %2% Notificeringer @@ -1589,7 +1589,7 @@ Mange hilsner fra Umbraco robotten er ikke blevet låst ude Kodeordet er ikke blevet ændret Gentag dit nye kodeord - Du kan ændre dit kodeord, som giver dig adgang til Umbraco Back Office ved at udfylde formularen og klikke på knappen 'Skift dit kodeord' + Du kan ændre dit kodeord, som giver dig adgang til Umbraco backoffice ved at udfylde formularen og klikke på knappen 'Skift dit kodeord' Indholdskanal Opret endnu en bruger Opret nye brugere for at give dem adgang til Umbraco. Når en ny bruger oprettes, genereres der en adgangskode, som du kan dele med brugeren. @@ -1691,10 +1691,16 @@ Mange hilsner fra Umbraco robotten Du kan kun have Tilføj op til elementer + URL(er) + URL(er) valgt elementer valgt Ugyldig dato Ikke et tal + Ikke en gyldig numerisk trinstørrelse Ugyldig e-mail + Værdien kan ikke være tom + Værdien kan ikke være tom + Værdien er ugyldig, som ikke matcher det korrekte format %1% mere.]]> %1% for mange.]]> @@ -1852,7 +1858,7 @@ Mange hilsner fra Umbraco robotten Label Speciel visning Vis speciel visning beskrivelsen - Overskrift hvordan denne block præsenteres i BackOffice interfacet. Vælg en .html fil der indeholder din præsensation. + Overskrift hvordan denne block præsenteres i backoffice interfacet. Vælg en .html fil der indeholder din præsensation. Indstillings model Rederings lagets størrelse Tilføj speciel visning @@ -1874,7 +1880,25 @@ Mange hilsner fra Umbraco robotten Error! The ElementType of this block does not exist anymore + Feltet %0% bruger editor %1% som ikke er supporteret for blokke. + + Hvad er Indholdsskabeloner? + Indholdsskabeloner er foruddefineret indhold der kan vælges når der oprettes nye indholdselementer. + Hvordan opretter jeg en Indholdsskabelon? + + Der er to måder at oprette Indholdsskabeloner på:

+
    +
  • Højreklik på en indholdsnode og vælg "Opret indholdsskabelon" for at oprette en ny Indholdsskabelon.
  • +
  • Højreklik på Indholdsskabeloner i sektionen Indstillinger og vælg den dokumenttype du vil oprette en Indholdsskabelon for.
  • +
+

Når indholdsskabelonen har fået et navn, kan redaktører begynde at bruge indholdsskabelonen som udgangspunkt for deres nye side.

+ ]]> +
+ Hvordan vedligeholder jeg Indholdsskabeloner? + Du kan redigere og slette Indholdsskabeloner fra "Indholdsskabeloner" i sektionen Indstillinger. Fold dokumenttypen som Indholdsskabelonen er baseret på ud og klik på den for at redigere eller slette den. + Afslut Afslut forhåndsvisning diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/de.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/de.xml index 4f1c4c977f..b8c115c460 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/de.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/de.xml @@ -1388,7 +1388,6 @@ Registerkarten Masterdokumenttyp aktiviert Dieser Dokumenttyp verwendet - als Masterdokumenttyp. Register vom Masterdokumenttyp werden nicht angezeigt und können nur im Masterdokumenttyp selbst bearbeitet werden Für dieses Register sind keine Eigenschaften definiert. Klicken Sie oben auf "neue Eigenschaft hinzufügen", um eine neue Eigenschaft hinzuzufügen. Zugehörige Vorlage anlegen Bildsymbol hinzufügen diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml index c6a5ce4821..9d6240325d 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml @@ -66,7 +66,7 @@ Allow access to assign culture and hostnames Allow access to view a node's history log Allow access to view a node - Allow access to change document type for a node + Allow access to change Document Type for a node Allow access to copy a node Allow access to create nodes Allow access to delete nodes @@ -190,12 +190,12 @@ History (all variants) - To change the document type for the selected content, first select from the list of valid types for this location. + To change the Document Type for the selected content, first select from the list of valid types for this location. Then confirm and/or amend the mapping of properties from the current type to the new, and click Save. The content has been re-published. Current Property Current type - The document type cannot be changed, as there are no alternatives valid for this location. An alternative will be valid if it is allowed under the parent of the selected content item and that all existing child content items are allowed to be created under it. + The Document Type cannot be changed, as there are no alternatives valid for this location. An alternative will be valid if it is allowed under the parent of the selected content item and that all existing child content items are allowed to be created under it. Document Type Changed Map Properties Map to Property @@ -204,7 +204,7 @@ none Content Select New Document Type - The document type of the selected content has been successfully changed to [new type] and the following properties mapped: + The Document Type of the selected content has been successfully changed to [new type] and the following properties mapped: to Could not complete property mapping as one or more properties have more than one mapping defined. Only alternate types valid for the current location are displayed. @@ -287,10 +287,10 @@ Are you sure you want to delete this item? Property %0% uses editor %1% which is not supported by Nested Content. Are you sure you want to delete all items? - No content types are configured for this property. - Add element type - Select element type - Select the group whose properties should be displayed. If left blank, the first group on the element type will be used. + No Content Types are configured for this property. + Add Element Type + Select Element Type + Select the group whose properties should be displayed. If left blank, the first group on the Element Type will be used. Enter an angular expression to evaluate against each item for its name. Use to display the item index Add another text box @@ -358,18 +358,18 @@ Where do you want to create the new %0% Create an item under - Select the document type you want to make a content template for + Select the Document Type you want to make a content template for Enter a folder name Choose a type and a title - Document Types within the Settings section, by editing the Allowed child node types under Permissions.]]> - Document Types within the Settings section.]]> + Document Types within the Settings section, by editing the Allowed child node types under Permissions.]]> + Document Types within the Settings section.]]> The selected page in the content tree doesn't allow for any pages to be created below it. - Edit permissions for this document type - Create a new document type - Document Types within the Settings section, by changing the Allow as root option under Permissions.]]> - Media Types Types within the Settings section, by editing the Allowed child node types under Permissions.]]> + Edit permissions for this Document Type + Create a new Document Type + Document Types within the Settings section, by changing the Allow as root option under Permissions.]]> + Media Types within the Settings section, by editing the Allowed child node types under Permissions.]]> The selected media in the tree doesn't allow for any other media to be created below it. - Edit permissions for this media type + Edit permissions for this Media Types Document Type without a template Document Type with Template The data definition for a content page that can be created by editors in the content tree and is directly accessible via a URL. @@ -382,7 +382,7 @@ Folder Used to organise the Document Types, Compositions and Element Types created in this Document Type tree. New folder - New data type + New Data Type New JavaScript file New empty partial view New partial view macro @@ -566,7 +566,7 @@ Tools to manage the index fields The index cannot be read and will need to be rebuilt - The process is taking longer than expected, check the umbraco log to see if there have been any errors during this operation + The process is taking longer than expected, check the Umbraco log to see if there have been any errors during this operation This index cannot be rebuilt because it has no assigned IIndexPopulator @@ -597,7 +597,7 @@ Create custom list view Remove custom list view - A content type, media type or member type with this alias already exists + A Content Type, Media Type or Member Type with this alias already exists Renamed @@ -617,9 +617,9 @@ Show label Width and height All property types & property data - using this data type will be deleted permanently, please confirm you want to delete these as well + using this Data Type will be deleted permanently, please confirm you want to delete these as well Yes, delete - and all property types & property data using this data type + and all property types & property data using this Data Type Select the folder to move to in the tree structure below was moved underneath @@ -636,7 +636,6 @@ %0% is a mandatory field %0% at %1% is not in a correct format %0% is not in a correct format - Property '%0%' uses editor '%1%' which is not supported in Element Types. Received an error from the server @@ -909,7 +908,7 @@ ]]> I want to start from scratch learn how) You can still choose to install Runway later on. Please go to the Developer section and choose Packages. ]]> @@ -923,7 +922,7 @@ I want to start with a simple website - "Runway" is a simple website providing some basic document types and templates. The installer can set up Runway for you automatically, + "Runway" is a simple website providing some basic Document Types and templates. The installer can set up Runway for you automatically, but you can easily edit, extend or remove it. It's not necessary and you can perfectly use Umbraco without it. However, Runway offers an easy foundation based on best practices to get you started faster than ever. If you choose to install Runway, you can optionally select basic building blocks called Runway Modules to enhance your Runway pages. @@ -950,7 +949,7 @@ Get help from our award winning community, browse the documentation or watch som started instantly by clicking the "Launch Umbraco" button below.
If you are new to Umbraco, you can find plenty of resources on our getting started pages.]]>
Launch Umbraco -To manage your website, simply open the Umbraco back office and start adding content, updating the templates and stylesheets or add new functionality]]> +To manage your website, simply open the Umbraco backoffice and start adding content, updating the templates and stylesheets or add new functionality]]>
Connection to database failed. Umbraco Version 3 Umbraco Version 4 @@ -1029,7 +1028,7 @@ To manage your website, simply open the Umbraco back office and start adding con Password reset requested

- Your username to login to the Umbraco back-office is: %0% + Your username to login to the Umbraco backoffice is: %0%

@@ -1400,7 +1399,7 @@ To manage your website, simply open the Umbraco back office and start adding con Default template - To import a document type, find the ".udt" file on your computer by clicking the "Browse" button and click "Import" (you'll be asked for confirmation on the next screen) + To import a Document Type, find the ".udt" file on your computer by clicking the "Browse" button and click "Import" (you'll be asked for confirmation on the next screen)New Tab TitleNode typeType @@ -1411,7 +1410,6 @@ To manage your website, simply open the Umbraco back office and start adding con TabsMaster Content Type enabledThis Content Type uses - as a Master Content Type. Tabs from Master Content Types are not shown and can only be edited on the Master Content Type itselfNo properties defined on this tab. Click on the "add a new property" link at the top to create a new property.Create matching templateAdd icon @@ -1497,8 +1495,8 @@ To manage your website, simply open the Umbraco back office and start adding con User %0% was deletedInvite userInvitation has been re-sent to %0% - Document type was exported to file - An error occurred while exporting the document type + Document Type was exported to file + An error occurred while exporting the Document TypeAdd style @@ -1659,10 +1657,10 @@ To manage your website, simply open the Umbraco back office and start adding con Allowed child node typesAllow content of the specified types to be created underneath content of this type.Choose child node - Inherit tabs and properties from an existing document type. New tabs will be added to the current document type or merged if a tab with an identical name exists. - This content type is used in a composition, and therefore cannot be composed itself. - There are no content types available to use as a composition. - Removing a composition will delete all the associated property data. Once you save the document type there's no way back. + Inherit tabs and properties from an existing Document Type. New tabs will be added to the current Document Type or merged if a tab with an identical name exists. + This Content Type is used in a composition, and therefore cannot be composed itself. + There are no Content Types available to use as a composition. + Removing a composition will delete all the associated property data. Once you save the Document Type there's no way back.Create newUse existingEditor settings @@ -1673,12 +1671,12 @@ To manage your website, simply open the Umbraco back office and start adding con Select the folder to moveSelect the folder to copyto in the tree structure below - All Document types + All Document TypesAll DocumentsAll media items - using this document type will be deleted permanently, please confirm you want to delete these as well. - using this media type will be deleted permanently, please confirm you want to delete these as well. - using this member type will be deleted permanently, please confirm you want to delete these as well + using this Document Type will be deleted permanently, please confirm you want to delete these as well. + using this Media Type will be deleted permanently, please confirm you want to delete these as well. + using this Member Type will be deleted permanently, please confirm you want to delete these as welland all documents using this typeand all media items using this typeand all members using this type @@ -1701,11 +1699,11 @@ To manage your website, simply open the Umbraco back office and start adding con Allow editors to create segments of this content.Allow varying by cultureAllow segmentation - Element type - Is an Element type - An Element type is meant to be used for instance in Nested Content, and not in the tree. - A document type cannot be changed to an Element type once it has been used to create one or more content items. - This is not applicable for an Element type + Element Type + Is an Element Type + An Element Type is meant to be used for instance in Nested Content, and not in the tree. + A document Type cannot be changed to an Element Type once it has been used to create one or more content items. + This is not applicable for an Element TypeYou have made changes to this property. Are you sure you want to discard them?AppearanceLabel above (full-width) @@ -1868,7 +1866,7 @@ To manage your website, simply open the Umbraco back office and start adding con hasn't been locked outThe password hasn't been changedConfirm new password - You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button + You can change your password for accessing the Umbraco backoffice by filling out the form below and click the 'Change Password' buttonContent ChannelCreate another userCreate new users to give them access to Umbraco. When a new user is created a password will be generated that you can share with the user. @@ -2074,7 +2072,11 @@ To manage your website, simply open the Umbraco back office and start adding con items selectedInvalid dateNot a number + Not a valid numeric step sizeInvalid email + Value cannot be null + Value cannot be empty + Value is invalid, it does not match the correct patternCustom validation%1% more.]]>%1% too many.]]> @@ -2234,7 +2236,7 @@ To manage your website, simply open the Umbraco back office and start adding con CreatedCommentName - No relations for this relation type. + No relations for this Relation TypeRelation TypeRelations @@ -2278,7 +2280,7 @@ To manage your website, simply open the Umbraco back office and start adding con Partial ViewPartial View MacroMember - Data type + Data TypeSearch the redirect dashboardSearch the user group sectionSearch the users section @@ -2504,7 +2506,7 @@ To manage your website, simply open the Umbraco back office and start adding con LabelCustom viewShow custom view description - Overwrite how this block appears in the BackOffice UI. Pick a .html file containing your presentation. + Overwrite how this block appears in the backoffice UI. Pick a .html file containing your presentation.Settings modelOverlay editor sizeAdd custom view @@ -2526,6 +2528,7 @@ To manage your website, simply open the Umbraco back office and start adding con Error!The ElementType of this block does not exist anymore + Property '%0%' uses editor '%1%' which is not supported in blocks.What are Content Templates? diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml index ad5992a195..622806d933 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml @@ -67,7 +67,7 @@ Allow access to assign culture and hostnamesAllow access to view a node's history logAllow access to view a node - Allow access to change document type for a node + Allow access to change Document Type for a nodeAllow access to copy a nodeAllow access to create nodesAllow access to delete nodes @@ -193,12 +193,12 @@ History (all variants) - To change the document type for the selected content, first select from the list of valid types for this location. + To change the Document Type for the selected content, first select from the list of valid types for this location.Then confirm and/or amend the mapping of properties from the current type to the new, and click Save.The content has been re-published.Current PropertyCurrent type - The document type cannot be changed, as there are no alternatives valid for this location. An alternative will be valid if it is allowed under the parent of the selected content item and that all existing child content items are allowed to be created under it. + The Document Type cannot be changed, as there are no alternatives valid for this location. An alternative will be valid if it is allowed under the parent of the selected content item and that all existing child content items are allowed to be created under it.Document Type ChangedMap PropertiesMap to Property @@ -207,7 +207,7 @@ noneContentSelect New Document Type - The document type of the selected content has been successfully changed to [new type] and the following properties mapped: + The Document Type of the selected content has been successfully changed to [new type] and the following properties mapped:toCould not complete property mapping as one or more properties have more than one mapping defined.Only alternate types valid for the current location are displayed. @@ -292,10 +292,10 @@ Are you sure you want to delete this item?Are you sure you want to delete all items?Property %0% uses editor %1% which is not supported by Nested Content. - No content types are configured for this property. - Add element type - Select element type - Select the group whose properties should be displayed. If left blank, the first group on the element type will be used. + No Content Types are configured for this property. + Add Element Type + Select Element Type + Select the group whose properties should be displayed. If left blank, the first group on the Element Type will be used.Enter an angular expression to evaluate against each item for its name. Useto display the item indexAdd another text box @@ -365,18 +365,18 @@ Where do you want to create the new %0%Create an item under - Select the document type you want to make a content template for + Select the Document Type you want to make a content template forEnter a folder nameChoose a type and a title - Document Types within the Settings section, by editing the Allowed child node types under Permissions.]]> - Document Types within the Settings section.]]> + Document Types within the Settings section, by editing the Allowed child node types under Permissions.]]> + Document Types within the Settings section.]]>The selected page in the content tree doesn't allow for any pages to be created below it. - Edit permissions for this document type - Create a new document type - Document Types within the Settings section, by changing the Allow as root option under Permissions.]]> - Media Types Types within the Settings section, by editing the Allowed child node types under Permissions.]]> + Edit permissions for this Document Type + Create a new Document Type + Document Types within the Settings section, by changing the Allow as root option under Permissions.]]> + Media Types Types within the Settings section, by editing the Allowed child node types under Permissions.]]>The selected media in the tree doesn't allow for any other media to be created below it. - Edit permissions for this media type + Edit permissions for this Media TypeDocument Type without a templateDocument Type with TemplateThe data definition for a content page that can be created by editors in the content tree and is directly accessible via a URL. @@ -389,7 +389,7 @@ FolderUsed to organise the Document Types, Compositions and Element Types created in this Document Type tree.New folder - New data type + New Data TypeNew JavaScript fileNew empty partial viewNew partial view macro @@ -572,7 +572,7 @@ Tools to manage the indexfieldsThe index cannot be read and will need to be rebuilt - The process is taking longer than expected, check the umbraco log to see if there have been any errors during this operation + The process is taking longer than expected, check the Umbraco log to see if there have been any errors during this operationThis index cannot be rebuilt because it has no assignedIIndexPopulator @@ -602,7 +602,7 @@ Create custom list viewRemove custom list view - A content type, media type or member type with this alias already exists + A Content Type, Media Type or Member Type with this alias already existsRenamed @@ -622,9 +622,9 @@ Show labelWidth and heightAll property types & property data - using this data type will be deleted permanently, please confirm you want to delete these as well + using this Data Type will be deleted permanently, please confirm you want to delete these as wellYes, delete - and all property types & property data using this data type + and all property types & property data using this Data TypeSelect the folder to moveto in the tree structure belowwas moved underneath @@ -660,7 +660,6 @@ Please place cursor at the left of the two cells you wish to mergeYou cannot split a cell that hasn't been merged.This property is invalid - Property '%0%' uses editor '%1%' which is not supported in Element Types.Options @@ -915,7 +914,7 @@ ]]>I want to start from scratchlearn how) You can still choose to install Runway later on. Please go to the Developer section and choose Packages. ]]> @@ -929,7 +928,7 @@ I want to start with a simple website - "Runway" is a simple website providing some basic document types and templates. The installer can set up Runway for you automatically, + "Runway" is a simple website providing some basic Document Types and templates. The installer can set up Runway for you automatically, but you can easily edit, extend or remove it. It's not necessary and you can perfectly use Umbraco without it. However, Runway offers an easy foundation based on best practices to get you started faster than ever. If you choose to install Runway, you can optionally select basic building blocks called Runway Modules to enhance your Runway pages. @@ -956,7 +955,7 @@ Get help from our award winning community, browse the documentation or watch som started instantly by clicking the "Launch Umbraco" button below.
If you are new to Umbraco, you can find plenty of resources on our getting started pages.]]>
Launch Umbraco -To manage your website, simply open the Umbraco back office and start adding content, updating the templates and stylesheets or add new functionality]]> +To manage your website, simply open the Umbraco backoffice and start adding content, updating the templates and stylesheets or add new functionality]]>
Connection to database failed.Umbraco Version 3Umbraco Version 4 @@ -1035,7 +1034,7 @@ To manage your website, simply open the Umbraco back office and start adding con Password reset requested

- Your username to login to the Umbraco back-office is: %0% + Your username to login to the Umbraco backoffice is: %0%

@@ -1403,7 +1402,7 @@ To manage your website, simply open the Umbraco back office and start adding con Default template - To import a document type, find the ".udt" file on your computer by clicking the "Browse" button and click "Import" (you'll be asked for confirmation on the next screen) + To import a Document Type, find the ".udt" file on your computer by clicking the "Browse" button and click "Import" (you'll be asked for confirmation on the next screen)New Tab TitleNode typeType @@ -1414,7 +1413,6 @@ To manage your website, simply open the Umbraco back office and start adding con TabsMaster Content Type enabledThis Content Type uses - as a Master Content Type. Tabs from Master Content Types are not shown and can only be edited on the Master Content Type itselfNo properties defined on this tab. Click on the "add a new property" link at the top to create a new property.Create matching templateAdd icon @@ -1510,8 +1508,8 @@ To manage your website, simply open the Umbraco back office and start adding con Invitation has been re-sent to %0%Cannot publish the document since the required '%0%' is not publishedValidation failed for language '%0%' - Document type was exported to file - An error occurred while exporting the document type + Document Type was exported to file + An error occurred while exporting the Document TypeThe release date cannot be in the pastCannot schedule the document for publishing since the required '%0%' is not publishedCannot schedule the document for publishing since the required '%0%' has a publish date later than a non mandatory language @@ -1677,10 +1675,10 @@ To manage your website, simply open the Umbraco back office and start adding con Allowed child node typesAllow content of the specified types to be created underneath content of this type.Choose child node - Inherit tabs and properties from an existing document type. New tabs will be added to the current document type or merged if a tab with an identical name exists. - This content type is used in a composition, and therefore cannot be composed itself. - There are no content types available to use as a composition. - Removing a composition will delete all the associated property data. Once you save the document type there's no way back. + Inherit tabs and properties from an existing Document Type. New tabs will be added to the current Document Type or merged if a tab with an identical name exists. + This Content Type is used in a composition, and therefore cannot be composed itself. + There are no Content Types available to use as a composition. + Removing a composition will delete all the associated property data. Once you save the Document Type there's no way back.Create newUse existingEditor settings @@ -1693,12 +1691,12 @@ To manage your website, simply open the Umbraco back office and start adding con Select the folder to moveSelect the folder to copyto in the tree structure below - All Document types + All Document TypesAll DocumentsAll media items - using this document type will be deleted permanently, please confirm you want to delete these as well. - using this media type will be deleted permanently, please confirm you want to delete these as well. - using this member type will be deleted permanently, please confirm you want to delete these as well + using this Document Type will be deleted permanently, please confirm you want to delete these as well. + using this Media Type will be deleted permanently, please confirm you want to delete these as well. + using this Member Type will be deleted permanently, please confirm you want to delete these as welland all documents using this typeand all media items using this typeand all members using this type @@ -1710,7 +1708,7 @@ To manage your website, simply open the Umbraco back office and start adding con Allow this property value to be displayed on the member profile pagetab has no sort orderWhere is this composition used? - This composition is currently used in the composition of the following content types: + This composition is currently used in the composition of the following Content Types:Allow variationsAllow vary by cultureAllow segmentation @@ -1721,11 +1719,11 @@ To manage your website, simply open the Umbraco back office and start adding con Allow editors to create segments of this content.Allow varying by cultureAllow segmentation - Element type - Is an element type - An element type is meant to be used for instance in Nested Content, and not in the tree. - A document type cannot be changed to an element type once it has been used to create one or more content items. - This is not applicable for an element type + Element Type + Is an Element Type + An Element Type is meant to be used for instance in Nested Content, and not in the tree. + A Document Type cannot be changed to an Element Type once it has been used to create one or more content items. + This is not applicable for an Element TypeYou have made changes to this property. Are you sure you want to discard them?AppearanceLabel above (full-width) @@ -1887,7 +1885,7 @@ To manage your website, simply open the Umbraco back office and start adding con hasn't been locked outThe password hasn't been changedConfirm new password - You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button + You can change your password for accessing the Umbraco backoffice by filling out the form below and click the 'Change Password' buttonContent ChannelCreate another userCreate new users to give them access to Umbraco. When a new user is created a password will be generated that you can share with the user. @@ -2092,6 +2090,7 @@ To manage your website, simply open the Umbraco back office and start adding con items selectedInvalid dateNot a number + Not a valid numeric step sizeInvalid emailValue cannot be nullValue cannot be empty @@ -2256,7 +2255,7 @@ To manage your website, simply open the Umbraco back office and start adding con CreatedCommentName - No relations for this relation type. + No relations for this Relation TypeRelation TypeRelations @@ -2300,7 +2299,7 @@ To manage your website, simply open the Umbraco back office and start adding con Partial ViewPartial View MacroMember - Data type + Data TypeSearch the redirect dashboardSearch the user group sectionSearch the users section @@ -2526,7 +2525,7 @@ To manage your website, simply open the Umbraco back office and start adding con LabelCustom viewShow custom view description - Overwrite how this block appears in the BackOffice UI. Pick a .html file containing your presentation. + Overwrite how this block appears in the backoffice UI. Pick a .html file containing your presentation.Settings modelOverlay editor sizeAdd custom view @@ -2548,6 +2547,7 @@ To manage your website, simply open the Umbraco back office and start adding con Error!The ElementType of this block does not exist anymore + Property '%0%' uses editor '%1%' which is not supported in blocks.What are Content Templates? diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/es.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/es.xml index 6d0fc7661a..fb11a8dd37 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/es.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/es.xml @@ -671,7 +671,7 @@ Umbraco %0% ha sido instalado y está listo para ser usadoarchivo /web.config y actualizar la clave del AppSetting UmbracoConfigurationStatus del final al valor '%0%'.]]>empezar inmediatamente pulsando el botón "Lanzar Umbraco" de debajo.
Si eres nuevo con Umbraco, puedes encontrar cantidad de recursos en nuestras páginas de cómo empezar.]]>
- Lanzar Umbraco Para administrar tu sitio web, simplemente abre el back office de Umbraco y empieza a añadir contenido, a actualizar plantillas y hojas de estilo o a añadir nueva funcionalidad]]> + Lanzar Umbraco Para administrar tu sitio web, simplemente abre el backoffice de Umbraco y empieza a añadir contenido, a actualizar plantillas y hojas de estilo o a añadir nueva funcionalidad]]>No se ha podido establecer la conexión con la base de datosUmbraco versión 3Umbraco versión 4 @@ -989,7 +989,6 @@ PestañasTipo de Contenido Maestro activadoEste Tipo de Contenido usa - como Tipo de Contenido Maestro. Las pestañas para los Tipos de Contenido Maestros no se muestran y solo se pueden modificar desde el Tipo de Contenido MaestroNo existen propiedades para esta pestaña. Haz clic en el enlace "añadir nueva propiedad" para crear una nueva propiedad.Añadir icono @@ -1284,7 +1283,7 @@ Este mail se ha generado automáticamente para informale que %2% has solicitado que el documento '%1%' sea traducido en '%5%'. - Para editarlo, vaya a la dirección http://%3%/translation/details.aspx?id=%4% o inicia sesión en umbraco y ve a http://%3% para ver las tareas pendientes de traducir. + Para editarlo, vaya a la dirección http://%3%/translation/details.aspx?id=%4% o inicia sesión en Umbraco y ve a http://%3% para ver las tareas pendientes de traducir. Espero que tenga un buen dia. diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/fr.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/fr.xml index 88c6458a31..596f51d49e 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/fr.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/fr.xml @@ -981,7 +981,7 @@ Pour gérer votre site, ouvrez simplement le backoffice Umbraco et commencez à Une réinitialisation de votre mot de passe a été demandée

- Votre nom d'utilisateur pour vous connecter au back-office Umbraco est : %0% + Votre nom d'utilisateur pour vous connecter au backoffice Umbraco est : %0%

@@ -1354,7 +1354,6 @@ Pour gérer votre site, ouvrez simplement le backoffice Umbraco et commencez à OngletsType de contenu de base activéCe type de contenu utilise - en tant que type de contenu de base. Les onglets du type de contenu de base ne sont pas affichés et peuvent seulement être modifiés à partir du type de contenu de base lui-même.Aucune propriété définie dans cet onglet. Cliquez sur le lien "Ajouter une nouvelle propriété" en-haut pour créer une nouvelle propriété.Créer le template correspondantAjouter une icône @@ -1805,7 +1804,7 @@ Pour gérer votre site, ouvrez simplement le backoffice Umbraco et commencez à n'a pas été bloquéLe mot de passe n'a pas été modifiéConfirmez votre nouveau mot de passe - Vous pouvez changer votre mot de passe d'accès au Back Office Umbraco en remplissant le formulaire ci-dessous puis en cliquant sur le bouton "Changer le mot de passe" + Vous pouvez changer votre mot de passe d'accès au backoffice Umbraco en remplissant le formulaire ci-dessous puis en cliquant sur le bouton "Changer le mot de passe"Canal de contenuCréer un autre utilisateurCréer de nouveaux utilisateurs pour leur donner accès à Umbraco. Lors de la création d'un nouvel utilisateur, un mot de passe est généré que vous pouvez partager avec ce dernier. diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/he.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/he.xml index fcc9cfb8ad..a307dc9e1a 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/he.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/he.xml @@ -449,7 +449,7 @@ Get help from our award winning community, browse the documentation or watch som started instantly by clicking the "Launch Umbraco" button below.
If you are new to Umbraco, you can find plenty of resources on our getting started pages.]]>
Launch Umbraco -To manage your website, simply open the Umbraco back office and start adding content, updating the templates and stylesheets or add new functionality]]> +To manage your website, simply open the Umbraco backoffice and start adding content, updating the templates and stylesheets or add new functionality]]>ההתחברות לבסיס הנתונים נכשלה.Umbraco גירסה 3Umbraco גירסה 4 diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/it.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/it.xml index 812da01703..835e49578b 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/it.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/it.xml @@ -422,7 +422,7 @@ Fatti aiutare dalla nostra community, consulta la documentazione o guarda alcuni /web.config e aggiornare la chiave AppSetting UmbracoConfigurationStatus impostando il valore '%0%'.]]>iniziare immediatamente cliccando sul bottone "Avvia Umbraco".
Se sei nuovo a Umbraco, si possono trovare un sacco di risorse sulle nostre pagine Getting Started.]]>
Avvia Umbraco -Per gestire il tuo sito web, è sufficiente aprire il back office di Umbraco e iniziare ad aggiungere i contenuti, aggiornando i modelli e i fogli di stile o aggiungere nuove funzionalità]]> +Per gestire il tuo sito web, è sufficiente aprire il backoffice di Umbraco e iniziare ad aggiungere i contenuti, aggiornando i modelli e i fogli di stile o aggiungere nuove funzionalità]]>Connessione al database non riuscita.Umbraco Versione 3Umbraco Versione 4 @@ -603,7 +603,6 @@ Per gestire il tuo sito web, è sufficiente aprire il back office di Umbraco e i Utenti - Tipo di contenuto master abilitatoQuesto tipo di contenuto usa @@ -820,7 +819,7 @@ Per gestire il tuo sito web, è sufficiente aprire il back office di Umbraco e i AmministratoreCampo CategoriaCambia la tua password - + Conferma la nuova passwordContenuto del canaleCampo Descrizione diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/ja.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/ja.xml index 80aad2c301..11cc67ec98 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/ja.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/ja.xml @@ -804,7 +804,6 @@ Runwayをインストールして作られた新しいウェブサイトがど タブマスターコンテンツタイプが有効このコンテンツタイプの使用 - マスターコンテンツタイプについては、マスターコンテンツタイプからのタブは表示されず、マスターコンテンツタイプでのみ編集することができます。このタブにはプロパティが定義されていません、上部のリンクから新しいプロパティを作成してくださいアイコンの追加 diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/ko.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/ko.xml index 02f50e73b2..1f7642036e 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/ko.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/ko.xml @@ -815,7 +815,7 @@ 관리자카테고리 필드Change Your Password - You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button + You can change your password for accessing the Umbraco backoffice by filling out the form below and click the 'Change Password' button컨텐츠 채널설명 필드사용자 비활성화 diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/nb.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/nb.xml index cc0b46f200..d5f22686fe 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/nb.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/nb.xml @@ -689,7 +689,6 @@ Vennlig hilsen Umbraco roboten ArkfanerHovedinnholdstype aktivertDenne dokumenttypen bruker - som hoveddokumenttype. Arkfaner fra hoveddokumenttyper vises ikke og kan kun endres på hoveddokumenttypen selv.Ingen egenskaper definert i denne arkfanen. Klikk på "legg til ny egenskap" lenken i toppen for å opprette en ny egenskap. diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/nl.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/nl.xml index 11049a279c..961dcaeb16 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/nl.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/nl.xml @@ -650,7 +650,6 @@ Plaats de cursor links van de twee cellen die je wilt samenvoegenJe kunt een cel die is samengevoegd niet delenDeze eigenschap is ongeldig - Eigenschap '%0%' gebruikt editor '%1%' die niet ondersteund wordt in Element Types.Opties @@ -903,7 +902,7 @@ Echter, Runway biedt een gemakkelijke basis om je snel op weg te helpen. Als je Umbraco %0% is geïnstalleerd en klaar voor gebruik./web.config bestand aanpassen, en de Appsetting key UmbracoConfigurationStatus onder in het bestand veranderen naar '%0%'.]]>meteen beginnen door de "Launch Umbraco" knop hieronder te klikken.
Als je een beginnende Umbraco gebruiker bent, dan kun je you can find veel informatie op onze "getting started" pagina's vinden.]]>
- Launch Umbraco Om je website te beheren open je simpelweg de Umbraco back office en begin je inhoud toe te voegen, templates en stylesheets aan te passen of nieuwe functionaliteit toe te voegen]]> + Launch Umbraco Om je website te beheren open je simpelweg de Umbraco backoffice en begin je inhoud toe te voegen, templates en stylesheets aan te passen of nieuwe functionaliteit toe te voegen]]>Verbinding met de database mislukt.Umbraco versie 3Umbraco versie 4 @@ -1230,7 +1229,6 @@ Echter, Runway biedt een gemakkelijke basis om je snel op weg te helpen. Als je TabsBasis inhoudstype ingeschakeldDit inhoudstype gebruikt - als basis inhoudstype. Tabs van basis inhoudstypes worden niet getoond en kunnen alleen worden aangepast op het basis inhoudstype zelfGeen eigenschappen gedefinieerd op dit tabblad. Klik op de link "voeg een nieuwe eigenschap" aan de bovenkant om een ​​nieuwe eigenschap te creëren.Maak een bijpassende sjabloonIcoon toevoegen @@ -2362,6 +2360,7 @@ Echter, Runway biedt een gemakkelijke basis om je snel op weg te helpen. Als je Fout!Het Elementtype van dit blok bestaat niet meer + Eigenschap '%0%' gebruikt editor '%1%' die niet ondersteund wordt in blokken.Wat zijn Inhoudssjablonen? diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/pl.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/pl.xml index 7b3e8f1b04..300b4dff76 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/pl.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/pl.xml @@ -737,7 +737,7 @@ Naciśnij przycisk instaluj, aby zainstalować bazę danych Umb Twoje hasło zostało zmienioneLink, na który kliknąłeś jest niewłaściwy lub wygasłUmbraco: Resetowanie hasła - Twoja nazwa użytkownika do zalogowania się w Umbraco back-office to: %0%

Kliknij tutaj, aby zresetować Twoje hasło lub kopiuj/wklej ten URL w przeglądarce:

%1%

]]>
+ Twoja nazwa użytkownika do zalogowania się w Umbraco backoffice to: %0%

Kliknij tutaj, aby zresetować Twoje hasło lub kopiuj/wklej ten URL w przeglądarce:

%1%

]]>
Panel zarządzania @@ -981,7 +981,6 @@ Naciśnij przycisk instaluj, aby zainstalować bazę danych Umb ZakładkiWłączono Główny Typ TreściTen Typ Treści używa - jako Główny Typ Treści. Zakładki Głównego Typu Treści nie są wyświetlone i mogą być edytowane jedynie w samym Głównym Typie TreściŻadne właściwości nie zostały zdefiniowane dla tej zakładki. Kliknij w link "dodaj nową właściwość", który znajduje się na górze strony, aby stworzyć nową właściwość.Dodaj ikonę @@ -1321,7 +1320,7 @@ Naciśnij przycisk instaluj, aby zainstalować bazę danych Umb Zmień hasło!Nowe hasłoPotwierdź nowe hasło - Możesz zmienić swoje hasło w Umbraco Back Office przez wypełnienie formularza poniżej i kliknięcie przycisku "Zmień hasło" + Możesz zmienić swoje hasło w Umbraco backoffice przez wypełnienie formularza poniżej i kliknięcie przycisku "Zmień hasło"Kanał zawartościOpisWyłącz użytkownika diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/ru.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/ru.xml index a430b53165..9ad4291c59 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/ru.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/ru.xml @@ -1327,7 +1327,6 @@ Добавить значок - в качестве родительского типа. Вкладки родительского типа не показаны и могут быть изменены непосредственно в родительском типеРодительский тип контента разрешенДанный тип контента используетШаблон по-умолчанию diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/sv.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/sv.xml index 511765e604..9c237815bf 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/sv.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/sv.xml @@ -243,10 +243,10 @@ Installera Umbraco Forms - Stanna - Ignorera ändringar - Du har ändringar som inte är sparade - Vill du verkligen lämna sidan? Du har ändringar som inte är sparade + Stay + Discard changes + You have unsaved changes + Are you sure you want to navigate away from this page? - you have unsaved changesKlar @@ -272,6 +272,8 @@ Kopierade %0% av %1% objekt + Länktitel + LänkNamnHantera domännamnStäng fönstret @@ -308,7 +310,9 @@ Cache för webbplatsen har uppdaterats. Allt publicerat innehåll är nu uppdaterat. Innehåll som inte har publicerats är fortfarande opublicerat.Webbplatsens cache kommer att uppdateras. Allt innehåll som är publicerat kommer att uppdateras. Innehåll som inte är publicerat kommer att förbli opublicerat.Välj startnod för innehåll + Välj mediaVälj ikon + Välj länkVälj startnod för mediaVälj användargrupperVälj sektioner @@ -318,6 +322,9 @@ Klicka på förhandsgranskningsbilden för att se bilden i full storlekVälj ett objektSe cachat objekt + Länk till sida + Öppnar länken i ett nytt fönster eller flik + Länk till mediaRedigera de olika översättningarna för ordboksinlägget %0% nedan. Du kan lägga till ytterligare språk under 'språk' i menyn till vänster. @@ -551,7 +558,7 @@ Umbraco %0% är installerat och klart för användning/web.config filen och ändra AppSettingsnyckeln UmbracoConfigurationStatus på slutet till %0%]]>börja omedelbart genom att klicka på "Starta Umbraco"-knappen nedan.
Om du är en ny Umbraco användarekan du hitta massor av resurser på våra kom igång sidor.]]>
- Starta Umbraco För att administrera din webbplats öppnar du bara Umbraco back office och börjar lägga till innehåll, uppdatera mallar och stilmallar eller lägga till nya funktioner.]]> + Starta Umbraco För att administrera din webbplats öppnar du bara Umbraco backoffice och börjar lägga till innehåll, uppdatera mallar och stilmallar eller lägga till nya funktioner.]]>Anslutningen till databasen misslyckades.SeUmbraco %0% antingen för en ny installation eller en uppgradering från version 3.0.

Tryck på "next" för att börja.]]>
@@ -725,7 +732,6 @@ Användare - som huvudinnehållstyp. Tabbar från huvudinnehållstyper visas inte och kan endast redigeras på själva huvudinnehållstypen.Huvudinnehållstyp påslagenDenna huvudinnehållstyp använderDefaultmall @@ -741,8 +747,8 @@ Flikar - Sortera ordningen - Skapandedatum + Sort order + Creation dateSortering klarVälj i vilken ordning du vill ha sidorna genom att dra dem upp eller ner i listan. Du kan också klicka på kolumnrubrikerna för att sortera grupper av sidor @@ -815,12 +821,12 @@ Bild - Makro + MacroLägg till - Välj utformning + Choose layoutLägg till rad - Lägg till innehåll - Släpp innehåll + Add content + Drop contentIndholdet er ikke tilladt herIndholdet er tilladt herKlicka för att lägga in @@ -847,7 +853,7 @@ Alternativt fältAlternativ text - Hölje + CasingVälj fältKonvertera radbrytningarByter radbrytningar mot html-taggen &lt;br&gt; @@ -940,7 +946,7 @@ Ändra lösenordÄndra bildBekräfta det nya lösenordet - Du kan byta ditt lösenord för Umbraco Back Office genom att fylla i nedanstående formulär och klicka på knappen "Ändra lösenord". + Du kan byta ditt lösenord för Umbraco backoffice genom att fylla i nedanstående formulär och klicka på knappen "Ändra lösenord".InnehållskanalSkapa en till användareSkapa nya användare för att ge dom åtkomst till Umbraco. När en ny användare skapas kommer ett lösenord genereras som du kan dela med användaren. @@ -963,7 +969,7 @@ Senast utlåstSenast inloggadLösenordet ändrades - Logga in + LoginStartnod i mediabiblioteketBegränsa media sectionen till en specifik startnodMedia startnoder diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/tr.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/tr.xml index fa0f909bfb..82ef1ba628 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/tr.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/tr.xml @@ -561,7 +561,7 @@ Dizini yönetmek için araçlaralanlarDizin okunamıyor ve yeniden oluşturulması gerekecek - İşlem beklenenden uzun sürüyor, bu işlem sırasında herhangi bir hata olup olmadığını görmek için umbraco günlüğünü kontrol edin + İşlem beklenenden uzun sürüyor, bu işlem sırasında herhangi bir hata olup olmadığını görmek için Umbraco günlüğünü kontrol edinBu dizin, atanmış olmadığı için yeniden oluşturulamazIIndexPopulator @@ -631,7 +631,6 @@ %0% zorunlu bir alandır%1% konumunda %0% doğru biçimde değil%0% doğru biçimde değil - '%0%' özelliği, Öğe Türlerinde desteklenmeyen '%1%' düzenleyicisini kullanıyor.Sunucudan bir hata aldı @@ -1469,7 +1468,6 @@ Web sitenizi yönetmek için, Umbraco'nun arka ofisini açın ve içerik eklemey SekmelerAna İçerik Türü etkinleştirildiBu İçerik Türü kullanır - Ana İçerik Türü olarak . Ana İçerik Türlerinden sekmeler gösterilmez ve yalnızca Ana İçerik Türünün kendisinde düzenlenebilirBu sekmede tanımlanmış özellik yok. Yeni bir mülk oluşturmak için üstteki "yeni mülk ekle" bağlantısını tıklayın.Eşleşen şablon oluşturSimge ekle @@ -2575,6 +2573,7 @@ Web sitenizi yönetmek için, Umbraco'nun arka ofisini açın ve içerik eklemey Hata!Bu bloğun ElementType'ı artık mevcut değil + '%0%' özelliği, bloklarda desteklenmeyen '%1%' düzenleyicisini kullanıyor.İçerik Şablonları Nedir? diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/zh.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/zh.xml index 6344efe0bc..916bca0dbd 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/zh.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/zh.xml @@ -847,7 +847,6 @@ 选项卡主控文档类型激活该文档类型使用 - 作为主控文档类型. 主控文档类型的标签只能在主控文档类型里修改。没有字段设置在该标签页添加图标 diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/zh_tw.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/zh_tw.xml index c912daa56e..23123f9bfa 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/zh_tw.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/zh_tw.xml @@ -834,7 +834,6 @@ 選項卡主控文件類型啟動該文檔類型使用 - 作為主控文件類型. 主控文件類型的標籤只能在主控文件類型裡修改。沒有欄位設置在該標籤頁增加圖示 diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3-Fluid.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3-Fluid.cshtml index 131b0515ae..bef1b88879 100644 --- a/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3-Fluid.cshtml +++ b/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3-Fluid.cshtml @@ -6,7 +6,7 @@ Razor helpers located at the bottom of this file *@ -@if (Model != null && Model.sections != null) +@if (Model != null && Model.GetType() == typeof(JObject) && Model.sections != null) { var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1; diff --git a/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3.cshtml b/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3.cshtml index c30feb2165..801526aaeb 100644 --- a/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3.cshtml +++ b/src/Umbraco.Web.UI/Views/Partials/Grid/Bootstrap3.cshtml @@ -2,7 +2,7 @@ @using Umbraco.Web.Templates @using Newtonsoft.Json.Linq -@if (Model != null && Model.sections != null) +@if (Model != null && Model.GetType() == typeof(JObject) && Model.sections != null) { var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1; diff --git a/src/Umbraco.Web/AspNetHttpContextAccessor.cs b/src/Umbraco.Web/AspNetHttpContextAccessor.cs index babd8dfcfa..147c37fe8c 100644 --- a/src/Umbraco.Web/AspNetHttpContextAccessor.cs +++ b/src/Umbraco.Web/AspNetHttpContextAccessor.cs @@ -7,14 +7,8 @@ namespace Umbraco.Web { public HttpContext HttpContext { - get - { - return HttpContext.Current; - } - set - { - throw new NotSupportedException(); - } + get => HttpContext.Current; + set => throw new NotSupportedException(); } } } diff --git a/src/Umbraco.Web/Cache/DistributedCacheBinder.cs b/src/Umbraco.Web/Cache/DistributedCacheBinder.cs index 5f8d77f3b2..3ee24a23bf 100644 --- a/src/Umbraco.Web/Cache/DistributedCacheBinder.cs +++ b/src/Umbraco.Web/Cache/DistributedCacheBinder.cs @@ -72,7 +72,7 @@ namespace Umbraco.Web.Cache { // TODO: should this be fatal (ie, an exception)? var name = e.Sender.GetType().Name + "_" + e.EventName; - _logger.Warn("Dropping event {EventName} because no corresponding handler was found.", name); + _logger.Warn("Dropping event {EventName} because no corresponding handler was found.", name); continue; } diff --git a/src/Umbraco.Web/ContentApps/ContentAppFactoryCollection.cs b/src/Umbraco.Web/ContentApps/ContentAppFactoryCollection.cs index 07987aea3e..da587f672a 100644 --- a/src/Umbraco.Web/ContentApps/ContentAppFactoryCollection.cs +++ b/src/Umbraco.Web/ContentApps/ContentAppFactoryCollection.cs @@ -50,7 +50,7 @@ namespace Umbraco.Web.ContentApps // dying is not user-friendly, so let's write to log instead, and wish people read logs... //throw new InvalidOperationException($"Duplicate content app aliases found: {string.Join(",", dups)}"); - _logger.Warn("Duplicate content app aliases found: {DuplicateAliases}", string.Join(",", dups)); + _logger.Warn("Duplicate content app aliases found: {DuplicateAliases}", string.Join(",", dups)); } return apps; diff --git a/src/Umbraco.Web/Editors/AuthenticationController.cs b/src/Umbraco.Web/Editors/AuthenticationController.cs index e2ab829427..c354dd25ef 100644 --- a/src/Umbraco.Web/Editors/AuthenticationController.cs +++ b/src/Umbraco.Web/Editors/AuthenticationController.cs @@ -433,19 +433,19 @@ namespace Umbraco.Web.Editors var lockedOut = await UserManager.IsLockedOutAsync(model.UserId); if (lockedOut) { - Logger.Info("User {UserId} is currently locked out, unlocking and resetting AccessFailedCount", model.UserId); + Logger.Info("User {UserId} is currently locked out, unlocking and resetting AccessFailedCount", model.UserId); //// var user = await UserManager.FindByIdAsync(model.UserId); var unlockResult = await UserManager.SetLockoutEndDateAsync(model.UserId, DateTimeOffset.Now); if (unlockResult.Succeeded == false) { - Logger.Warn("Could not unlock for user {UserId} - error {UnlockError}", model.UserId, unlockResult.Errors.First()); + Logger.Warn("Could not unlock for user {UserId} - error {UnlockError}", model.UserId, unlockResult.Errors.First()); } var resetAccessFailedCountResult = await UserManager.ResetAccessFailedCountAsync(model.UserId); if (resetAccessFailedCountResult.Succeeded == false) { - Logger.Warn("Could not reset access failed count {UserId} - error {UnlockError}", model.UserId, unlockResult.Errors.First()); + Logger.Warn("Could not reset access failed count {UserId} - error {UnlockError}", model.UserId, unlockResult.Errors.First()); } } @@ -499,7 +499,7 @@ namespace Umbraco.Web.Editors Core.Constants.Security.BackOfficeAuthenticationType, Core.Constants.Security.BackOfficeExternalAuthenticationType); - Logger.Info("User {UserName} from IP address {RemoteIpAddress} has logged out", User.Identity == null ? "UNKNOWN" : User.Identity.Name, owinContext.Request.RemoteIpAddress); + Logger.Info("User {UserName} from IP address {RemoteIpAddress} has logged out", User.Identity == null ? "UNKNOWN" : User.Identity.Name, owinContext.Request.RemoteIpAddress); if (UserManager != null) { diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index 92b67cbf1b..157a6e4735 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -1,4 +1,8 @@ -using System; +using Microsoft.AspNet.Identity; +using Microsoft.AspNet.Identity.Owin; +using Microsoft.Owin.Security; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -6,24 +10,19 @@ using System.Threading; using System.Threading.Tasks; using System.Web.Mvc; using System.Web.UI; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.Owin; -using Microsoft.Owin.Security; -using Newtonsoft.Json; using Umbraco.Core; using Umbraco.Core.Cache; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; using Umbraco.Core.Manifest; using Umbraco.Core.Models.Identity; -using Umbraco.Web.Models; -using Umbraco.Web.Mvc; using Umbraco.Core.Services; using Umbraco.Web.Composing; using Umbraco.Web.Features; using Umbraco.Web.JavaScript; +using Umbraco.Web.Models; +using Umbraco.Web.Mvc; using Umbraco.Web.Security; -using Umbraco.Web.Services; using Constants = Umbraco.Core.Constants; using JArray = Newtonsoft.Json.Linq.JArray; @@ -40,11 +39,9 @@ namespace Umbraco.Web.Editors private readonly ManifestParser _manifestParser; private readonly UmbracoFeatures _features; private readonly IRuntimeState _runtimeState; - private readonly IIconService _iconService; private BackOfficeUserManager _userManager; private BackOfficeSignInManager _signInManager; - [Obsolete("Use the constructor that injects IIconService.")] public BackOfficeController( ManifestParser manifestParser, UmbracoFeatures features, @@ -55,37 +52,11 @@ namespace Umbraco.Web.Editors IProfilingLogger profilingLogger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper) - : this(manifestParser, - features, - globalSettings, - umbracoContextAccessor, - services, - appCaches, - profilingLogger, - runtimeState, - umbracoHelper, - Current.IconService) - { - - } - - public BackOfficeController( - ManifestParser manifestParser, - UmbracoFeatures features, - IGlobalSettings globalSettings, - IUmbracoContextAccessor umbracoContextAccessor, - ServiceContext services, - AppCaches appCaches, - IProfilingLogger profilingLogger, - IRuntimeState runtimeState, - UmbracoHelper umbracoHelper, - IIconService iconService) : base(globalSettings, umbracoContextAccessor, services, appCaches, profilingLogger, umbracoHelper) { _manifestParser = manifestParser; _features = features; _runtimeState = runtimeState; - _iconService = iconService; } protected BackOfficeSignInManager SignInManager => _signInManager ?? (_signInManager = OwinContext.GetBackOfficeSignInManager()); @@ -100,7 +71,7 @@ namespace Umbraco.Web.Editors /// public async Task Default() { - var backofficeModel = new BackOfficeModel(_features, GlobalSettings, _iconService); + var backofficeModel = new BackOfficeModel(_features, GlobalSettings); return await RenderDefaultOrProcessExternalLoginAsync( () => View(GlobalSettings.Path.EnsureEndsWith('/') + "Views/Default.cshtml", backofficeModel), () => View(GlobalSettings.Path.EnsureEndsWith('/') + "Views/Default.cshtml", backofficeModel)); @@ -129,7 +100,7 @@ namespace Umbraco.Web.Editors if (parts.Length != 2) { - Logger.Warn("VerifyUser endpoint reached with invalid token: {Invite}", invite); + Logger.Warn("VerifyUser endpoint reached with invalid token: {Invite}", invite); return RedirectToAction("Default"); } @@ -138,7 +109,7 @@ namespace Umbraco.Web.Editors var decoded = token.FromUrlBase64(); if (decoded.IsNullOrWhiteSpace()) { - Logger.Warn("VerifyUser endpoint reached with invalid token: {Invite}", invite); + Logger.Warn("VerifyUser endpoint reached with invalid token: {Invite}", invite); return RedirectToAction("Default"); } @@ -146,14 +117,14 @@ namespace Umbraco.Web.Editors int intId; if (int.TryParse(id, out intId) == false) { - Logger.Warn("VerifyUser endpoint reached with invalid token: {Invite}", invite); + Logger.Warn("VerifyUser endpoint reached with invalid token: {Invite}", invite); return RedirectToAction("Default"); } var identityUser = await UserManager.FindByIdAsync(intId); if (identityUser == null) { - Logger.Warn("VerifyUser endpoint reached with non existing user: {UserId}", id); + Logger.Warn("VerifyUser endpoint reached with non existing user: {UserId}", id); return RedirectToAction("Default"); } @@ -161,7 +132,7 @@ namespace Umbraco.Web.Editors if (result.Succeeded == false) { - Logger.Warn("Could not verify email, Error: {Errors}, Token: {Invite}", string.Join(",", result.Errors), invite); + Logger.Warn("Could not verify email, Error: {Errors}, Token: {Invite}", string.Join(",", result.Errors), invite); return new RedirectResult(Url.Action("Default") + "#/login/false?invite=3"); } @@ -186,7 +157,7 @@ namespace Umbraco.Web.Editors { return await RenderDefaultOrProcessExternalLoginAsync( //The default view to render when there is no external login info or errors - () => View(GlobalSettings.Path.EnsureEndsWith('/') + "Views/AuthorizeUpgrade.cshtml", new BackOfficeModel(_features, GlobalSettings, _iconService)), + () => View(GlobalSettings.Path.EnsureEndsWith('/') + "Views/AuthorizeUpgrade.cshtml", new BackOfficeModel(_features, GlobalSettings)), //The ActionResult to perform if external login is successful () => Redirect("/")); } @@ -351,6 +322,7 @@ namespace Umbraco.Web.Editors return RedirectToLocal(Url.Action("Default", "BackOffice")); } + [UmbracoAuthorize] [HttpGet] public async Task ExternalLinkLoginCallback() { @@ -433,7 +405,7 @@ namespace Umbraco.Web.Editors var authType = OwinContext.Authentication.GetExternalAuthenticationTypes().FirstOrDefault(x => x.AuthenticationType == loginInfo.Login.LoginProvider); if (authType == null) { - Logger.Warn("Could not find external authentication provider registered: {LoginProvider}", loginInfo.Login.LoginProvider); + Logger.Warn("Could not find external authentication provider registered: {LoginProvider}", loginInfo.Login.LoginProvider); } else { @@ -450,7 +422,7 @@ namespace Umbraco.Web.Editors shouldSignIn = autoLinkOptions.OnExternalLogin(user, loginInfo); if (shouldSignIn == false) { - Logger.Warn("The AutoLinkOptions of the external authentication provider '{LoginProvider}' have refused the login based on the OnExternalLogin method. Affected user id: '{UserId}'", loginInfo.Login.LoginProvider, user.Id); + Logger.Warn("The AutoLinkOptions of the external authentication provider '{LoginProvider}' have refused the login based on the OnExternalLogin method. Affected user id: '{UserId}'", loginInfo.Login.LoginProvider, user.Id); } } diff --git a/src/Umbraco.Web/Editors/BackOfficeModel.cs b/src/Umbraco.Web/Editors/BackOfficeModel.cs index cbdafd2e94..d0d2e324f3 100644 --- a/src/Umbraco.Web/Editors/BackOfficeModel.cs +++ b/src/Umbraco.Web/Editors/BackOfficeModel.cs @@ -1,32 +1,19 @@ using System; using Umbraco.Core.Configuration; -using Umbraco.Core.Services; -using Umbraco.Web.Composing; using Umbraco.Web.Features; namespace Umbraco.Web.Editors { - public class BackOfficeModel { - - [Obsolete("Use the overload that injects IIconService.")] - public BackOfficeModel(UmbracoFeatures features, IGlobalSettings globalSettings) : this(features, globalSettings, Current.IconService) - { - - } - public BackOfficeModel(UmbracoFeatures features, IGlobalSettings globalSettings, IIconService iconService) + public BackOfficeModel(UmbracoFeatures features, IGlobalSettings globalSettings) { Features = features; GlobalSettings = globalSettings; - IconCheckData = iconService.GetIcon("icon-check")?.SvgString; - IconDeleteData = iconService.GetIcon("icon-delete")?.SvgString; } public UmbracoFeatures Features { get; } public IGlobalSettings GlobalSettings { get; } - public string IconCheckData { get; } - public string IconDeleteData { get; } } } diff --git a/src/Umbraco.Web/Editors/BackOfficePreviewModel.cs b/src/Umbraco.Web/Editors/BackOfficePreviewModel.cs index cc7356b687..6ace8e7198 100644 --- a/src/Umbraco.Web/Editors/BackOfficePreviewModel.cs +++ b/src/Umbraco.Web/Editors/BackOfficePreviewModel.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Core.Configuration; using Umbraco.Core.Models; -using Umbraco.Core.Services; -using Umbraco.Web.Composing; using Umbraco.Web.Features; namespace Umbraco.Web.Editors @@ -13,21 +10,11 @@ namespace Umbraco.Web.Editors private readonly UmbracoFeatures _features; public IEnumerable Languages { get; } - [Obsolete("Use the overload that injects IIconService.")] public BackOfficePreviewModel( UmbracoFeatures features, IGlobalSettings globalSettings, IEnumerable languages) - : this(features, globalSettings, languages, Current.IconService) - { - } - - public BackOfficePreviewModel( - UmbracoFeatures features, - IGlobalSettings globalSettings, - IEnumerable languages, - IIconService iconService) - : base(features, globalSettings, iconService) + : base(features, globalSettings) { _features = features; Languages = languages; diff --git a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs index dd4dd67681..42b5186c03 100644 --- a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs +++ b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs @@ -1,4 +1,6 @@ -using System; +using ClientDependency.Core.Config; +using Microsoft.Owin; +using System; using System.Collections; using System.Collections.Generic; using System.Configuration; @@ -7,15 +9,10 @@ using System.Runtime.Serialization; using System.Web; using System.Web.Configuration; using System.Web.Mvc; -using ClientDependency.Core.Config; -using Microsoft.Owin; -using Microsoft.Owin.Security; using Umbraco.Core; using Umbraco.Core.Composing; using Umbraco.Core.Configuration; -using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.IO; -using Umbraco.Web.Controllers; using Umbraco.Web.Features; using Umbraco.Web.HealthCheck; using Umbraco.Web.Models.ContentEditing; diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs index 7093edf23d..edc5077558 100644 --- a/src/Umbraco.Web/Editors/ContentController.cs +++ b/src/Umbraco.Web/Editors/ContentController.cs @@ -1978,7 +1978,7 @@ namespace Umbraco.Web.Editors if (template == null) { //ModelState.AddModelError("Template", "No template exists with the specified alias: " + contentItem.TemplateAlias); - Logger.Warn("No template exists with the specified alias: {TemplateAlias}", contentSave.TemplateAlias); + Logger.Warn("No template exists with the specified alias: {TemplateAlias}", contentSave.TemplateAlias); } else if (template.Id != contentSave.PersistedContent.TemplateId) { diff --git a/src/Umbraco.Web/Editors/ContentControllerBase.cs b/src/Umbraco.Web/Editors/ContentControllerBase.cs index 893c9f5941..d94ab8058f 100644 --- a/src/Umbraco.Web/Editors/ContentControllerBase.cs +++ b/src/Umbraco.Web/Editors/ContentControllerBase.cs @@ -62,7 +62,7 @@ namespace Umbraco.Web.Editors // get the property editor if (propertyDto.PropertyEditor == null) { - Logger.Warn("No property editor found for property {PropertyAlias}", propertyDto.Alias); + Logger.Warn("No property editor found for property {PropertyAlias}", propertyDto.Alias); continue; } diff --git a/src/Umbraco.Web/Editors/ContentTypeController.cs b/src/Umbraco.Web/Editors/ContentTypeController.cs index 5074a14782..a72e27b903 100644 --- a/src/Umbraco.Web/Editors/ContentTypeController.cs +++ b/src/Umbraco.Web/Editors/ContentTypeController.cs @@ -359,7 +359,7 @@ namespace Umbraco.Web.Editors var tryCreateTemplate = Services.FileService.CreateTemplateForContentType(contentTypeAlias, contentTypeName); if (tryCreateTemplate == false) { - Logger.Warn("Could not create a template for Content Type: \"{ContentTypeAlias}\", status: {Status}", + Logger.Warn("Could not create a template for Content Type: \"{ContentTypeAlias}\", status: {Status}", contentTypeAlias, tryCreateTemplate.Result.Result); } @@ -544,7 +544,7 @@ namespace Umbraco.Web.Editors } catch (Exception ex) { - Logger.Error(ex, "Error cleaning up temporary udt file in App_Data: {File}", filePath); + Logger.Error(ex, "Error cleaning up temporary udt file in App_Data: {File}", filePath); } return Request.CreateResponse(HttpStatusCode.OK); @@ -591,7 +591,7 @@ namespace Umbraco.Web.Editors } catch (Exception ex) { - Logger.Error(ex, "Error uploading udt file to App_Data: {File}", destFileName); + Logger.Error(ex, "Error uploading udt file to App_Data: {File}", destFileName); } if (ext.InvariantEquals("udt")) diff --git a/src/Umbraco.Web/Editors/DashboardController.cs b/src/Umbraco.Web/Editors/DashboardController.cs index eef0b5df93..da620eb5ac 100644 --- a/src/Umbraco.Web/Editors/DashboardController.cs +++ b/src/Umbraco.Web/Editors/DashboardController.cs @@ -76,7 +76,7 @@ namespace Umbraco.Web.Editors } catch (HttpRequestException ex) { - Logger.Error(ex.InnerException ?? ex, "Error getting dashboard content from {Url}", url); + Logger.Error(ex.InnerException ?? ex, "Error getting dashboard content from {Url}", url); //it's still new JObject() - we return it like this to avoid error codes which triggers UI warnings AppCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 5, 0)); @@ -114,7 +114,7 @@ namespace Umbraco.Web.Editors } catch (HttpRequestException ex) { - Logger.Error(ex.InnerException ?? ex, "Error getting dashboard CSS from {Url}", url); + Logger.Error(ex.InnerException ?? ex, "Error getting dashboard CSS from {Url}", url); //it's still string.Empty - we return it like this to avoid error codes which triggers UI warnings AppCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 5, 0)); @@ -178,7 +178,7 @@ namespace Umbraco.Web.Editors } catch (HttpRequestException ex) { - Logger.Error(ex.InnerException ?? ex, "Error getting remote dashboard data from {UrlPrefix}{Url}", urlPrefix, url); + Logger.Error(ex.InnerException ?? ex, "Error getting remote dashboard data from {UrlPrefix}{Url}", urlPrefix, url); //it's still string.Empty - we return it like this to avoid error codes which triggers UI warnings AppCaches.RuntimeCache.InsertCacheItem(key, () => result, new TimeSpan(0, 5, 0)); diff --git a/src/Umbraco.Web/Editors/DictionaryController.cs b/src/Umbraco.Web/Editors/DictionaryController.cs index f3246276b1..fcc2e2af02 100644 --- a/src/Umbraco.Web/Editors/DictionaryController.cs +++ b/src/Umbraco.Web/Editors/DictionaryController.cs @@ -124,7 +124,7 @@ namespace Umbraco.Web.Editors } catch (Exception ex) { - Logger.Error(GetType(), ex, "Error creating dictionary with {Name} under {ParentId}", key, parentId); + Logger.Error(GetType(), ex, "Error creating dictionary with {Name} under {ParentId}", key, parentId); return Request.CreateNotificationValidationErrorResponse("Error creating dictionary item"); } } @@ -254,7 +254,7 @@ namespace Umbraco.Web.Editors } catch (Exception ex) { - Logger.Error(GetType(), ex, "Error saving dictionary with {Name} under {ParentId}", dictionary.Name, dictionary.ParentId); + Logger.Error(GetType(), ex, "Error saving dictionary with {Name} under {ParentId}", dictionary.Name, dictionary.ParentId); throw new HttpResponseException(Request.CreateNotificationValidationErrorResponse("Something went wrong saving dictionary")); } } diff --git a/src/Umbraco.Web/Editors/ExamineManagementController.cs b/src/Umbraco.Web/Editors/ExamineManagementController.cs index cf1dfd5d5d..49599bc8b9 100644 --- a/src/Umbraco.Web/Editors/ExamineManagementController.cs +++ b/src/Umbraco.Web/Editors/ExamineManagementController.cs @@ -131,7 +131,7 @@ namespace Umbraco.Web.Editors if (!validate.IsSuccessStatusCode) return validate; - _logger.Info("Rebuilding index '{IndexName}'", indexName); + _logger.Info("Rebuilding index '{IndexName}'", indexName); //remove it in case there's a handler there already index.IndexOperationComplete -= Indexer_IndexOperationComplete; @@ -253,7 +253,7 @@ namespace Umbraco.Web.Editors { var indexer = (IIndex)sender; - _logger.Debug("Logging operation completed for index {IndexName}", indexer.Name); + _logger.Debug("Logging operation completed for index {IndexName}", indexer.Name); //ensure it's not listening anymore indexer.IndexOperationComplete -= Indexer_IndexOperationComplete; diff --git a/src/Umbraco.Web/Editors/IconController.cs b/src/Umbraco.Web/Editors/IconController.cs index 87303a4e62..2aac92088d 100644 --- a/src/Umbraco.Web/Editors/IconController.cs +++ b/src/Umbraco.Web/Editors/IconController.cs @@ -1,13 +1,20 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; using Umbraco.Core.Models; using Umbraco.Core.Services; using Umbraco.Web.Mvc; using Umbraco.Web.WebApi; +using Umbraco.Web.WebApi.Filters; namespace Umbraco.Web.Editors { [PluginController("UmbracoApi")] - public class IconController : UmbracoAuthorizedApiController + [IsBackOffice] + [UmbracoWebApiRequireHttps] + [UnhandedExceptionLoggerConfiguration] + [EnableDetailedErrors] + public class IconController : UmbracoApiController { private readonly IIconService _iconService; @@ -30,9 +37,22 @@ namespace Umbraco.Web.Editors /// Gets a list of all svg icons found at at the global icons path. /// /// + [Obsolete("This method should not be used - use GetIcons instead")] public IList GetAllIcons() { return _iconService.GetAllIcons(); } + + /// + /// Gets a list of all svg icons found at at the global icons path. + /// + /// + public JsonNetResult GetIcons() + { + return new JsonNetResult(JsonNetResult.DefaultJsonSerializerSettings) { + Data = _iconService.GetIcons(), + Formatting = Formatting.None + }; + } } } diff --git a/src/Umbraco.Web/Editors/PasswordChanger.cs b/src/Umbraco.Web/Editors/PasswordChanger.cs index 404ce27e39..f680245087 100644 --- a/src/Umbraco.Web/Editors/PasswordChanger.cs +++ b/src/Umbraco.Web/Editors/PasswordChanger.cs @@ -101,7 +101,7 @@ namespace Umbraco.Web.Editors if (resetResult.Succeeded == false) { var errors = string.Join(". ", resetResult.Errors); - _logger.Warn("Could not reset user password {PasswordErrors}", errors); + _logger.Warn("Could not reset user password {PasswordErrors}", errors); return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult(errors, new[] { "resetPassword" }) }); } @@ -142,7 +142,7 @@ namespace Umbraco.Web.Editors { //no, fail with error messages for "password" var errors = string.Join(". ", changeResult.Errors); - _logger.Warn("Could not change user password {PasswordErrors}", errors); + _logger.Warn("Could not change user password {PasswordErrors}", errors); return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult(errors, new[] { "password" }) }); } return Attempt.Succeed(new PasswordChangedModel()); @@ -203,7 +203,7 @@ namespace Umbraco.Web.Editors } catch (Exception ex) { - _logger.Warn("Could not change member password", ex); + _logger.Warn(ex,"Could not change member password"); return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Could not change password, error: " + ex.Message + " (see log for full details)", new[] { "value" }) }); } } diff --git a/src/Umbraco.Web/Editors/PreviewController.cs b/src/Umbraco.Web/Editors/PreviewController.cs index f00805d2dc..e2770b14ba 100644 --- a/src/Umbraco.Web/Editors/PreviewController.cs +++ b/src/Umbraco.Web/Editors/PreviewController.cs @@ -9,10 +9,8 @@ using Umbraco.Core.Services; using Umbraco.Web.Composing; using Umbraco.Web.Features; using Umbraco.Web.JavaScript; -using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Mvc; using Umbraco.Web.PublishedCache; -using Umbraco.Web.Services; using Constants = Umbraco.Core.Constants; namespace Umbraco.Web.Editors @@ -25,39 +23,19 @@ namespace Umbraco.Web.Editors private readonly IPublishedSnapshotService _publishedSnapshotService; private readonly IUmbracoContextAccessor _umbracoContextAccessor; private readonly ILocalizationService _localizationService; - private readonly IIconService _iconService; - [Obsolete("Use the constructor that injects IIconService.")] public PreviewController( UmbracoFeatures features, IGlobalSettings globalSettings, IPublishedSnapshotService publishedSnapshotService, IUmbracoContextAccessor umbracoContextAccessor, ILocalizationService localizationService) - :this(features, - globalSettings, - publishedSnapshotService, - umbracoContextAccessor, - localizationService, - Current.IconService) - { - - } - - public PreviewController( - UmbracoFeatures features, - IGlobalSettings globalSettings, - IPublishedSnapshotService publishedSnapshotService, - IUmbracoContextAccessor umbracoContextAccessor, - ILocalizationService localizationService, - IIconService iconService) { _features = features; _globalSettings = globalSettings; _publishedSnapshotService = publishedSnapshotService; _umbracoContextAccessor = umbracoContextAccessor; _localizationService = localizationService; - _iconService = iconService; } [UmbracoAuthorize(redirectToUmbracoLogin: true)] @@ -74,7 +52,7 @@ namespace Umbraco.Web.Editors availableLanguages = availableLanguages.Where(language => content.Cultures.ContainsKey(language.IsoCode)); } - var model = new BackOfficePreviewModel(_features, _globalSettings, availableLanguages, _iconService); + var model = new BackOfficePreviewModel(_features, _globalSettings, availableLanguages); if (model.PreviewExtendedHeaderView.IsNullOrWhiteSpace() == false) { diff --git a/src/Umbraco.Web/Editors/RelationTypeController.cs b/src/Umbraco.Web/Editors/RelationTypeController.cs index 3e45600be9..e56d856933 100644 --- a/src/Umbraco.Web/Editors/RelationTypeController.cs +++ b/src/Umbraco.Web/Editors/RelationTypeController.cs @@ -155,7 +155,7 @@ namespace Umbraco.Web.Editors } catch (Exception ex) { - Logger.Error(GetType(), ex, "Error creating relation type with {Name}", relationType.Name); + Logger.Error(GetType(), ex, "Error creating relation type with {Name}", relationType.Name); return Request.CreateNotificationValidationErrorResponse("Error creating relation type."); } } @@ -186,7 +186,7 @@ namespace Umbraco.Web.Editors } catch (Exception ex) { - Logger.Error(GetType(), ex, "Error saving relation type with {Id}", relationType.Id); + Logger.Error(GetType(), ex, "Error saving relation type with {Id}", relationType.Id); throw new HttpResponseException(Request.CreateNotificationValidationErrorResponse("Something went wrong when saving the relation type")); } } diff --git a/src/Umbraco.Web/Editors/TinyMceController.cs b/src/Umbraco.Web/Editors/TinyMceController.cs index 1d292c64fd..1ceb4f0a1f 100644 --- a/src/Umbraco.Web/Editors/TinyMceController.cs +++ b/src/Umbraco.Web/Editors/TinyMceController.cs @@ -100,7 +100,7 @@ namespace Umbraco.Web.Editors catch (Exception ex) { // IOException, PathTooLong, DirectoryNotFound, UnathorizedAccess - Logger.Error(ex, "Error when trying to move {CurrentFilePath} to {NewFilePath}", currentFile, newFilePath); + Logger.Error(ex, "Error when trying to move {CurrentFilePath} to {NewFilePath}", currentFile, newFilePath); return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, $"Error when trying to move {currentFile} to {newFilePath}", ex); } diff --git a/src/Umbraco.Web/FormDataCollectionExtensions.cs b/src/Umbraco.Web/FormDataCollectionExtensions.cs index aabf13ac9b..ebabaa74c7 100644 --- a/src/Umbraco.Web/FormDataCollectionExtensions.cs +++ b/src/Umbraco.Web/FormDataCollectionExtensions.cs @@ -23,9 +23,9 @@ namespace Umbraco.Web if (items.Any() == false) return ""; var builder = new StringBuilder(); - foreach (var i in items.Where(i => keysToIgnore.InvariantContains(i.Key) == false)) + foreach (var (key, value) in items.Where(i => keysToIgnore.InvariantContains(i.Key) == false)) { - builder.Append(string.Format("{0}={1}&", i.Key, i.Value)); + builder.Append($"{key}={value}&"); } return builder.ToString().TrimEnd(Constants.CharArrays.Ampersand); } diff --git a/src/Umbraco.Web/HealthCheck/HealthCheckController.cs b/src/Umbraco.Web/HealthCheck/HealthCheckController.cs index 2f72b946de..770b41c323 100644 --- a/src/Umbraco.Web/HealthCheck/HealthCheckController.cs +++ b/src/Umbraco.Web/HealthCheck/HealthCheckController.cs @@ -73,7 +73,7 @@ namespace Umbraco.Web.HealthCheck } catch (Exception ex) { - _logger.Error(ex, "Exception in health check: {HealthCheckName}", check.Name); + _logger.Error(ex, "Exception in health check: {HealthCheckName}", check.Name); throw; } } diff --git a/src/Umbraco.Web/HealthCheck/HealthCheckResults.cs b/src/Umbraco.Web/HealthCheck/HealthCheckResults.cs index 61028699f0..9f58e04f79 100644 --- a/src/Umbraco.Web/HealthCheck/HealthCheckResults.cs +++ b/src/Umbraco.Web/HealthCheck/HealthCheckResults.cs @@ -27,7 +27,7 @@ namespace Umbraco.Web.HealthCheck } catch (Exception ex) { - Logger.Error(ex, "Error running scheduled health check: {HealthCheckName}", t.Name); + Logger.Error(ex, "Error running scheduled health check: {HealthCheckName}", t.Name); var message = $"Health check failed with exception: {ex.Message}. See logs for details."; return new List { @@ -62,16 +62,16 @@ namespace Umbraco.Web.HealthCheck var checkIsSuccess = result.Value.All(x => x.ResultType == StatusResultType.Success); if (checkIsSuccess) { - Logger.Info("Checks for '{HealthCheckName}' all completed successfully.", checkName); + Logger.Info("Checks for '{HealthCheckName}' all completed successfully.", checkName); } else { - Logger.Warn("Checks for '{HealthCheckName}' completed with errors.", checkName); + Logger.Warn("Checks for '{HealthCheckName}' completed with errors.", checkName); } foreach (var checkResult in checkResults) { - Logger.Info("Result for {HealthCheckName}: {HealthCheckResult}, Message: '{HealthCheckMessage}'", checkName, checkResult.ResultType, checkResult.Message); + Logger.Info("Result for {HealthCheckName}: {HealthCheckResult}, Message: '{HealthCheckMessage}'", checkName, checkResult.ResultType, checkResult.Message); } } } diff --git a/src/Umbraco.Web/HtmlHelperRenderExtensions.cs b/src/Umbraco.Web/HtmlHelperRenderExtensions.cs index e19ae883e9..2f55f0a1b1 100644 --- a/src/Umbraco.Web/HtmlHelperRenderExtensions.cs +++ b/src/Umbraco.Web/HtmlHelperRenderExtensions.cs @@ -85,7 +85,7 @@ namespace Umbraco.Web var cacheKey = new StringBuilder(partialViewName); //let's always cache by the current culture to allow variants to have different cache results var cultureName = System.Threading.Thread.CurrentThread.CurrentUICulture.Name; - if (!String.IsNullOrEmpty(cultureName)) + if (!string.IsNullOrEmpty(cultureName)) { cacheKey.AppendFormat("{0}-", cultureName); } diff --git a/src/Umbraco.Web/HttpUrlHelperExtensions.cs b/src/Umbraco.Web/HttpUrlHelperExtensions.cs index 4e5533d327..9a2f394d90 100644 --- a/src/Umbraco.Web/HttpUrlHelperExtensions.cs +++ b/src/Umbraco.Web/HttpUrlHelperExtensions.cs @@ -103,7 +103,7 @@ namespace Umbraco.Web string routeName; if (area.IsNullOrWhiteSpace()) { - routeName = string.Format("umbraco-{0}-{1}", "api", controllerName); + routeName = $"umbraco-{"api"}-{controllerName}"; if (id == null) { return url.Route(routeName, new { controller = controllerName, action = actionName, httproute = "" }); @@ -115,7 +115,7 @@ namespace Umbraco.Web } else { - routeName = string.Format("umbraco-{0}-{1}-{2}", "api", area, controllerName); + routeName = $"umbraco-{"api"}-{area}-{controllerName}"; if (id == null) { return url.Route(routeName, new { controller = controllerName, action = actionName, httproute = "" }); diff --git a/src/Umbraco.Web/HybridEventMessagesAccessor.cs b/src/Umbraco.Web/HybridEventMessagesAccessor.cs index fddde403d8..ab67b4774f 100644 --- a/src/Umbraco.Web/HybridEventMessagesAccessor.cs +++ b/src/Umbraco.Web/HybridEventMessagesAccessor.cs @@ -12,8 +12,8 @@ namespace Umbraco.Web public EventMessages EventMessages { - get { return Value; } - set { Value = value; } + get => Value; + set => Value = value; } } } diff --git a/src/Umbraco.Web/ImageCropperTemplateExtensions.cs b/src/Umbraco.Web/ImageCropperTemplateExtensions.cs index 78b55a8930..dad2f9e3f3 100644 --- a/src/Umbraco.Web/ImageCropperTemplateExtensions.cs +++ b/src/Umbraco.Web/ImageCropperTemplateExtensions.cs @@ -9,6 +9,7 @@ using Umbraco.Core.Models; using Umbraco.Core.Models.PublishedContent; using Umbraco.Core.PropertyEditors.ValueConverters; using Umbraco.Web.Models; +using Umbraco.Core.Logging; namespace Umbraco.Web { @@ -270,7 +271,7 @@ namespace Umbraco.Web } catch (Exception ex) { - Current.Logger.Error(typeof(ImageCropperTemplateExtensions), ex, "Could not parse the json string: {Json}", json); + Current.Logger.Error(typeof(ImageCropperTemplateExtensions), ex, "Could not parse the json string: {Json}", json); } } diff --git a/src/Umbraco.Web/Install/Controllers/InstallApiController.cs b/src/Umbraco.Web/Install/Controllers/InstallApiController.cs index d151df46f7..924bd3ff99 100644 --- a/src/Umbraco.Web/Install/Controllers/InstallApiController.cs +++ b/src/Umbraco.Web/Install/Controllers/InstallApiController.cs @@ -120,7 +120,7 @@ namespace Umbraco.Web.Install.Controllers catch (Exception ex) { - _logger.Error(ex, "An error occurred during installation step {Step}", step.Name); + _logger.Error(ex, "An error occurred during installation step {Step}", step.Name); if (ex is TargetInvocationException && ex.InnerException != null) { @@ -210,7 +210,7 @@ namespace Umbraco.Web.Install.Controllers } catch (Exception ex) { - _logger.Error(ex, "Checking if step requires execution ({Step}) failed.", step.Name); + _logger.Error(ex, "Checking if step requires execution ({Step}) failed.", step.Name); throw; } } @@ -232,7 +232,7 @@ namespace Umbraco.Web.Install.Controllers } catch (Exception ex) { - _logger.Error(ex, "Installation step {Step} failed.", step.Name); + _logger.Error(ex, "Installation step {Step} failed.", step.Name); throw; } } diff --git a/src/Umbraco.Web/JavaScript/ClientDependencyConfiguration.cs b/src/Umbraco.Web/JavaScript/ClientDependencyConfiguration.cs index 2bf069b06d..019c7e29a6 100644 --- a/src/Umbraco.Web/JavaScript/ClientDependencyConfiguration.cs +++ b/src/Umbraco.Web/JavaScript/ClientDependencyConfiguration.cs @@ -79,7 +79,7 @@ namespace Umbraco.Web.JavaScript versionAttribute.SetValue(newVersion); clientDependencyConfigXml.Save(_fileName, SaveOptions.DisableFormatting); - _logger.Info("Updated version number from {OldVersion} to {NewVersion}", oldVersion, newVersion); + _logger.Info("Updated version number from {OldVersion} to {NewVersion}", oldVersion, newVersion); return true; } } diff --git a/src/Umbraco.Web/Macros/MacroRenderer.cs b/src/Umbraco.Web/Macros/MacroRenderer.cs index 54ce640855..e6c94ef3cf 100755 --- a/src/Umbraco.Web/Macros/MacroRenderer.cs +++ b/src/Umbraco.Web/Macros/MacroRenderer.cs @@ -89,7 +89,7 @@ namespace Umbraco.Web.Macros if (macroContent == null) return null; - _plogger.Debug("Macro content loaded from cache '{MacroCacheId}'", model.CacheIdentifier); + _plogger.Debug("Macro content loaded from cache '{MacroCacheId}'", model.CacheIdentifier); // ensure that the source has not changed // note: does not handle dependencies, and never has @@ -149,7 +149,7 @@ namespace Umbraco.Web.Macros priority: CacheItemPriority.NotRemovable ); - _plogger.Debug("Macro content saved to cache '{MacroCacheId}'", model.CacheIdentifier); + _plogger.Debug("Macro content saved to cache '{MacroCacheId}'", model.CacheIdentifier); } // gets the macro source file name @@ -284,7 +284,7 @@ namespace Umbraco.Web.Macros } catch (Exception e) { - _plogger.Warn(e, "Failed {MsgIn}", msgIn); + _plogger.Warn(e, "Failed {MsgIn}", msgIn); var macroErrorEventArgs = new MacroErrorEventArgs { diff --git a/src/Umbraco.Web/Media/UploadAutoFillProperties.cs b/src/Umbraco.Web/Media/UploadAutoFillProperties.cs index 60de03b450..4e0201ad99 100644 --- a/src/Umbraco.Web/Media/UploadAutoFillProperties.cs +++ b/src/Umbraco.Web/Media/UploadAutoFillProperties.cs @@ -74,7 +74,7 @@ namespace Umbraco.Web.Media } catch (Exception ex) { - _logger.Error(typeof(UploadAutoFillProperties), ex, "Could not populate upload auto-fill properties for file '{File}'.", filepath); + _logger.Error(typeof(UploadAutoFillProperties), ex, "Could not populate upload auto-fill properties for file '{File}'.", filepath); ResetProperties(content, autoFillConfig, culture, segment); } } diff --git a/src/Umbraco.Web/ModelStateExtensions.cs b/src/Umbraco.Web/ModelStateExtensions.cs index e224a6122b..2b0cd01e21 100644 --- a/src/Umbraco.Web/ModelStateExtensions.cs +++ b/src/Umbraco.Web/ModelStateExtensions.cs @@ -24,11 +24,11 @@ namespace Umbraco.Web { if (dictionary == null) return; - foreach (var keyValuePair in dictionary + foreach (var (key, value) in dictionary //It can either equal the prefix exactly (model level errors) or start with the prefix. (property level errors) .Where(keyValuePair => keyValuePair.Key == prefix || keyValuePair.Key.StartsWith(prefix + "."))) { - state[keyValuePair.Key] = keyValuePair.Value; + state[key] = value; } } diff --git a/src/Umbraco.Web/Models/Mapping/ContentPropertyBasicMapper.cs b/src/Umbraco.Web/Models/Mapping/ContentPropertyBasicMapper.cs index 2e035430df..bcfeb5e330 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentPropertyBasicMapper.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentPropertyBasicMapper.cs @@ -38,7 +38,7 @@ namespace Umbraco.Web.Models.Mapping var editor = _propertyEditors[property.PropertyType.PropertyEditorAlias]; if (editor == null) { - _logger.Error>( + _logger.Error, string>( new NullReferenceException("The property editor with alias " + property.PropertyType.PropertyEditorAlias + " does not exist"), "No property editor '{PropertyEditorAlias}' found, converting to a Label", property.PropertyType.PropertyEditorAlias); diff --git a/src/Umbraco.Web/Models/Mapping/DataTypeMapDefinition.cs b/src/Umbraco.Web/Models/Mapping/DataTypeMapDefinition.cs index 6b5797e05b..817d99c0fd 100644 --- a/src/Umbraco.Web/Models/Mapping/DataTypeMapDefinition.cs +++ b/src/Umbraco.Web/Models/Mapping/DataTypeMapDefinition.cs @@ -173,7 +173,7 @@ namespace Umbraco.Web.Models.Mapping else { // weird - just leave the field without a value - but warn - _logger.Warn("Could not find a value for configuration field '{ConfigField}'", field.Key); + _logger.Warn("Could not find a value for configuration field '{ConfigField}'", field.Key); } } } diff --git a/src/Umbraco.Web/Models/Mapping/MacroMapDefinition.cs b/src/Umbraco.Web/Models/Mapping/MacroMapDefinition.cs index e654fc16a1..216e1e100e 100644 --- a/src/Umbraco.Web/Models/Mapping/MacroMapDefinition.cs +++ b/src/Umbraco.Web/Models/Mapping/MacroMapDefinition.cs @@ -73,7 +73,7 @@ namespace Umbraco.Web.Models.Mapping { //we'll just map this to a text box paramEditor = _parameterEditors[Constants.PropertyEditors.Aliases.TextBox]; - _logger.Warn("Could not resolve a parameter editor with alias {PropertyEditorAlias}, a textbox will be rendered in it's place", source.EditorAlias); + _logger.Warn("Could not resolve a parameter editor with alias {PropertyEditorAlias}, a textbox will be rendered in it's place", source.EditorAlias); } target.View = paramEditor.GetValueEditor().View; diff --git a/src/Umbraco.Web/Mvc/RenderMvcController.cs b/src/Umbraco.Web/Mvc/RenderMvcController.cs index 64c9ad52c4..7c0345c300 100644 --- a/src/Umbraco.Web/Mvc/RenderMvcController.cs +++ b/src/Umbraco.Web/Mvc/RenderMvcController.cs @@ -68,7 +68,7 @@ namespace Umbraco.Web.Mvc var result = ViewEngines.Engines.FindView(ControllerContext, template, null); if (result.View != null) return true; - Logger.Warn("No physical template file was found for template {Template}", template); + Logger.Warn("No physical template file was found for template {Template}", template); return false; } diff --git a/src/Umbraco.Web/PropertyEditors/BlockEditorPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/BlockEditorPropertyEditor.cs index 8c4ebf49c3..9a3ec99fd4 100644 --- a/src/Umbraco.Web/PropertyEditors/BlockEditorPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/BlockEditorPropertyEditor.cs @@ -148,7 +148,7 @@ namespace Umbraco.Web.PropertyEditors { // deal with weird situations by ignoring them (no comment) row.PropertyValues.Remove(prop.Key); - _logger.Warn( + _logger.Warn( "ToEditor removed property value {PropertyKey} in row {RowId} for property type {PropertyTypeAlias}", prop.Key, row.Key, property.PropertyType.Alias); continue; diff --git a/src/Umbraco.Web/PropertyEditors/EyeDropperColorPickerConfigurationEditor.cs b/src/Umbraco.Web/PropertyEditors/EyeDropperColorPickerConfigurationEditor.cs new file mode 100644 index 0000000000..55867feddc --- /dev/null +++ b/src/Umbraco.Web/PropertyEditors/EyeDropperColorPickerConfigurationEditor.cs @@ -0,0 +1,53 @@ +using System.Collections.Generic; +using Umbraco.Core; +using Umbraco.Core.PropertyEditors; + +namespace Umbraco.Web.PropertyEditors +{ + internal class EyeDropperColorPickerConfigurationEditor : ConfigurationEditor + { + public EyeDropperColorPickerConfigurationEditor() + { + + } + + /// + public override Dictionary ToConfigurationEditor(EyeDropperColorPickerConfiguration configuration) + { + return new Dictionary + { + { "showAlpha", configuration.ShowAlpha }, + { "showPalette", configuration.ShowPalette } + }; + } + + /// + public override EyeDropperColorPickerConfiguration FromConfigurationEditor(IDictionary editorValues, EyeDropperColorPickerConfiguration configuration) + { + var output = new EyeDropperColorPickerConfiguration(); + + var showAlpha = true; + var showPalette = true; + + if (editorValues.TryGetValue("showAlpha", out var alpha)) + { + var attempt = alpha.TryConvertTo(); + if (attempt.Success) + showAlpha = attempt.Result; + } + + if (editorValues.TryGetValue("showPalette", out var palette)) + { + var attempt = palette.TryConvertTo(); + if (attempt.Success) + showPalette = attempt.Result; + } + + return new EyeDropperColorPickerConfiguration + { + ShowAlpha = showAlpha, + ShowPalette = showPalette + }; + } + } +} diff --git a/src/Umbraco.Web/PropertyEditors/EyeDropperColorPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/EyeDropperColorPickerPropertyEditor.cs new file mode 100644 index 0000000000..cf0d239523 --- /dev/null +++ b/src/Umbraco.Web/PropertyEditors/EyeDropperColorPickerPropertyEditor.cs @@ -0,0 +1,22 @@ +using Umbraco.Core; +using Umbraco.Core.Logging; +using Umbraco.Core.PropertyEditors; + +namespace Umbraco.Web.PropertyEditors +{ + [DataEditor( + Constants.PropertyEditors.Aliases.ColorPickerEyeDropper, + "Eye Dropper Color Picker", + "eyedropper", + Icon = "icon-colorpicker", + Group = Constants.PropertyEditors.Groups.Pickers)] + public class EyeDropperColorPickerPropertyEditor : DataEditor + { + public EyeDropperColorPickerPropertyEditor(ILogger logger) + : base(logger) + { } + + /// + protected override IConfigurationEditor CreateConfigurationEditor() => new EyeDropperColorPickerConfigurationEditor(); + } +} diff --git a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs index b0e5bf30bd..e66af480f8 100644 --- a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs @@ -91,7 +91,7 @@ namespace Umbraco.Web.PropertyEditors catch (Exception ex) { if (writeLog) - Logger.Error(ex, "Could not parse image cropper value '{Json}'", value); + Logger.Error(ex, "Could not parse image cropper value '{Json}'", value); return null; } } diff --git a/src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs b/src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs index 560275b29a..aae691f624 100644 --- a/src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs @@ -115,7 +115,7 @@ namespace Umbraco.Web.PropertyEditors } catch (Exception ex) { - _logger.Error("Error getting links", ex); + _logger.Error(ex, "Error getting links"); } return base.ToEditor(property, dataTypeService, culture, segment); @@ -151,7 +151,7 @@ namespace Umbraco.Web.PropertyEditors } catch (Exception ex) { - _logger.Error("Error saving links", ex); + _logger.Error(ex, "Error saving links"); } return base.FromEditor(editorValue, currentValue); diff --git a/src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs index ca3c5a2a04..1047c4317d 100644 --- a/src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs @@ -126,7 +126,7 @@ namespace Umbraco.Web.PropertyEditors { // deal with weird situations by ignoring them (no comment) row.RawPropertyValues.Remove(prop.Key); - _logger.Warn( + _logger.Warn( ex, "ConvertDbToString removed property value {PropertyKey} in row {RowId} for property type {PropertyTypeAlias}", prop.Key, row.Id, propertyType.Alias); @@ -195,7 +195,7 @@ namespace Umbraco.Web.PropertyEditors { // deal with weird situations by ignoring them (no comment) row.RawPropertyValues.Remove(prop.Key); - _logger.Warn( + _logger.Warn( ex, "ToEditor removed property value {PropertyKey} in row {RowId} for property type {PropertyTypeAlias}", prop.Key, row.Id, property.PropertyType.Alias); diff --git a/src/Umbraco.Web/PropertyEditors/RichTextEditorPastedImages.cs b/src/Umbraco.Web/PropertyEditors/RichTextEditorPastedImages.cs index 5a3334685c..c21e2dae20 100644 --- a/src/Umbraco.Web/PropertyEditors/RichTextEditorPastedImages.cs +++ b/src/Umbraco.Web/PropertyEditors/RichTextEditorPastedImages.cs @@ -132,7 +132,7 @@ namespace Umbraco.Web.PropertyEditors } catch (Exception ex) { - _logger.Error(typeof(HtmlImageSourceParser), ex, "Could not delete temp file or folder {FileName}", absoluteTempImagePath); + _logger.Error(typeof(HtmlImageSourceParser), ex, "Could not delete temp file or folder {FileName}", absoluteTempImagePath); } } } diff --git a/src/Umbraco.Web/PropertyEditors/RteEmbedController.cs b/src/Umbraco.Web/PropertyEditors/RteEmbedController.cs index ca3bd36374..9c9cd929bf 100644 --- a/src/Umbraco.Web/PropertyEditors/RteEmbedController.cs +++ b/src/Umbraco.Web/PropertyEditors/RteEmbedController.cs @@ -60,7 +60,7 @@ namespace Umbraco.Web.PropertyEditors } catch(Exception ex) { - Logger.Error(ex, "Error embedding URL {Url} - width: {Width} height: {Height}", url, width, height); + Logger.Error(ex, "Error embedding url {Url} - width: {Width} height: {Height}", url, width, height); result.OEmbedStatus = OEmbedStatus.Error; } diff --git a/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs b/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs index f25e7fa1c3..1de53e9c6e 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs @@ -598,7 +598,7 @@ namespace Umbraco.Web.PublishedCache.NuCache throw new ArgumentException("Kit content cannot have children.", nameof(kit)); // ReSharper restore LocalizableElement - _logger.Debug("Set content ID: {KitNodeId}", kit.Node.Id); + _logger.Debug("Set content ID: {KitNodeId}", kit.Node.Id); // get existing _contentNodes.TryGetValue(kit.Node.Id, out var link); @@ -863,7 +863,7 @@ namespace Umbraco.Web.PublishedCache.NuCache if (link?.Value == null) return false; var content = link.Value; - _logger.Debug("Clear content ID: {ContentId}", content.Id); + _logger.Debug("Clear content ID: {ContentId}", content.Id); // clear the entire branch ClearBranchLocked(content); @@ -1670,7 +1670,7 @@ namespace Umbraco.Web.PublishedCache.NuCache { if (_gen < 0) return; #if DEBUG - _logger.Debug("Dispose snapshot ({Snapshot})", _genRef?.GenObj.Count.ToString() ?? "live"); + _logger.Debug("Dispose snapshot ({Snapshot})", _genRef?.GenObj.Count.ToString() ?? "live"); #endif _gen = -1; if (_genRef != null) diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/DatabaseDataSource.cs b/src/Umbraco.Web/PublishedCache/NuCache/DataSource/DatabaseDataSource.cs index 9a28f1374c..c112cc6efa 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/DatabaseDataSource.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/DataSource/DatabaseDataSource.cs @@ -389,7 +389,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource { if (Debugger.IsAttached) throw new InvalidOperationException("Missing cmsContentNu edited content for node " + dto.Id + ", consider rebuilding."); - Current.Logger.Warn("Missing cmsContentNu edited content for node {NodeId}, consider rebuilding.", dto.Id); + Current.Logger.Warn("Missing cmsContentNu edited content for node {NodeId}, consider rebuilding.", dto.Id); } else { @@ -416,7 +416,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource { if (Debugger.IsAttached) throw new InvalidOperationException("Missing cmsContentNu published content for node " + dto.Id + ", consider rebuilding."); - Current.Logger.Warn("Missing cmsContentNu published content for node {NodeId}, consider rebuilding.", dto.Id); + Current.Logger.Warn("Missing cmsContentNu published content for node {NodeId}, consider rebuilding.", dto.Id); } else { diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs b/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs index d26e0c67f7..3a055223a5 100755 --- a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs @@ -132,9 +132,9 @@ namespace Umbraco.Web.PublishedCache.NuCache // stores need to be populated, happens in OnResolutionFrozen which uses _localDbExists to // figure out whether it can read the databases or it should populate them from sql - _logger.Info("Creating the content store, localContentDbExists? {LocalContentDbExists}", _localContentDbExists); + _logger.Info("Creating the content store, localContentDbExists? {LocalContentDbExists}", _localContentDbExists); _contentStore = new ContentStore(publishedSnapshotAccessor, variationContextAccessor, logger, _localContentDb); - _logger.Info("Creating the media store, localMediaDbExists? {LocalMediaDbExists}", _localMediaDbExists); + _logger.Info("Creating the media store, localMediaDbExists? {LocalMediaDbExists}", _localMediaDbExists); _mediaStore = new ContentStore(publishedSnapshotAccessor, variationContextAccessor, logger, _localMediaDb); } else @@ -183,7 +183,7 @@ namespace Umbraco.Web.PublishedCache.NuCache _localContentDb = BTree.GetTree(localContentDbPath, _localContentDbExists, _contentDataSerializer); _localMediaDb = BTree.GetTree(localMediaDbPath, _localMediaDbExists, _contentDataSerializer); - _logger.Info("Registered with MainDom, localContentDbExists? {LocalContentDbExists}, localMediaDbExists? {LocalMediaDbExists}", _localContentDbExists, _localMediaDbExists); + _logger.Info("Registered with MainDom, localContentDbExists? {LocalContentDbExists}, localMediaDbExists? {LocalMediaDbExists}", _localContentDbExists, _localMediaDbExists); } /// @@ -690,7 +690,7 @@ namespace Umbraco.Web.PublishedCache.NuCache foreach (var payload in payloads) { - _logger.Debug("Notified {ChangeTypes} for content {ContentId}", payload.ChangeTypes, payload.Id); + _logger.Debug("Notified {ChangeTypes} for content {ContentId}", payload.ChangeTypes, payload.Id); if (payload.ChangeTypes.HasType(TreeChangeTypes.RefreshAll)) { @@ -783,7 +783,7 @@ namespace Umbraco.Web.PublishedCache.NuCache foreach (var payload in payloads) { - _logger.Debug("Notified {ChangeTypes} for media {MediaId}", payload.ChangeTypes, payload.Id); + _logger.Debug("Notified {ChangeTypes} for media {MediaId}", payload.ChangeTypes, payload.Id); if (payload.ChangeTypes.HasType(TreeChangeTypes.RefreshAll)) { @@ -854,7 +854,7 @@ namespace Umbraco.Web.PublishedCache.NuCache return; foreach (var payload in payloads) - _logger.Debug("Notified {ChangeTypes} for {ItemType} {ItemId}", payload.ChangeTypes, payload.ItemType, payload.Id); + _logger.Debug("Notified {ChangeTypes} for {ItemType} {ItemId}", payload.ChangeTypes, payload.ItemType, payload.Id); Notify(_contentStore, payloads, RefreshContentTypesLocked); Notify(_mediaStore, payloads, RefreshMediaTypesLocked); @@ -938,7 +938,7 @@ namespace Umbraco.Web.PublishedCache.NuCache var idsA = payloads.Select(x => x.Id).ToArray(); foreach (var payload in payloads) - _logger.Debug("Notified {RemovedStatus} for data type {DataTypeId}", + _logger.Debug("Notified {RemovedStatus} for data type {DataTypeId}", payload.Removed ? "Removed" : "Refreshed", payload.Id); diff --git a/src/Umbraco.Web/PublishedCache/PublishedContentTypeCache.cs b/src/Umbraco.Web/PublishedCache/PublishedContentTypeCache.cs index 8eb50b0588..0f6e9af6bd 100644 --- a/src/Umbraco.Web/PublishedCache/PublishedContentTypeCache.cs +++ b/src/Umbraco.Web/PublishedCache/PublishedContentTypeCache.cs @@ -72,7 +72,7 @@ namespace Umbraco.Web.PublishedCache /// An identifier. public void ClearContentType(int id) { - _logger.Debug("Clear content type w/id {ContentTypeId}", id); + _logger.Debug("Clear content type w/id {ContentTypeId}", id); try { @@ -107,7 +107,7 @@ namespace Umbraco.Web.PublishedCache /// A data type identifier. public void ClearDataType(int id) { - _logger.Debug("Clear data type w/id {DataTypeId}.", id); + _logger.Debug("Clear data type w/id {DataTypeId}.", id); // there is no recursion to handle here because a PublishedContentType contains *all* its // properties ie both its own properties and those that were inherited (it's based upon an diff --git a/src/Umbraco.Web/PublishedContentExtensions.cs b/src/Umbraco.Web/PublishedContentExtensions.cs index f4c11977dc..8aa3b69fb4 100644 --- a/src/Umbraco.Web/PublishedContentExtensions.cs +++ b/src/Umbraco.Web/PublishedContentExtensions.cs @@ -173,8 +173,8 @@ namespace Umbraco.Web return value; // else... if we have a property, at least let the converter return its own - // vision of 'no value' (could be an empty enumerable) - otherwise, default - return property == null ? default : property.Value(culture, segment); + // vision of 'no value' (could be an empty enumerable) - otherwise, defaultValue + return property == null ? defaultValue : property.Value(culture, segment, defaultValue: defaultValue); } #endregion diff --git a/src/Umbraco.Web/PublishedPropertyExtension.cs b/src/Umbraco.Web/PublishedPropertyExtension.cs index b431f24828..0c3aa57cc2 100644 --- a/src/Umbraco.Web/PublishedPropertyExtension.cs +++ b/src/Umbraco.Web/PublishedPropertyExtension.cs @@ -41,24 +41,31 @@ namespace Umbraco.Web var valueConverted = value.TryConvertTo(); if (valueConverted) return valueConverted.Result; - // cannot cast nor convert the value, nothing we can return but 'default' + // cannot cast nor convert the value, nothing we can return but 'defaultValue' // note: we don't want to fallback in that case - would make little sense - return default; + return defaultValue; } // we don't have a value, try fallback if (PublishedValueFallback.TryGetValue(property, culture, segment, fallback, defaultValue, out var fallbackValue)) + { return fallbackValue; + } // we don't have a value - neither direct nor fallback // give a chance to the converter to return something (eg empty enumerable) var noValue = property.GetValue(culture, segment); + if (noValue == null) + { + return defaultValue; + } if (noValue is T noValueAsT) return noValueAsT; + var noValueConverted = noValue.TryConvertTo(); if (noValueConverted) return noValueConverted.Result; - // cannot cast noValue nor convert it, nothing we can return but 'default' - return default; + // cannot cast noValue nor convert it, nothing we can return but 'defaultValue' + return defaultValue; } #endregion diff --git a/src/Umbraco.Web/Routing/ContentFinderByConfigured404.cs b/src/Umbraco.Web/Routing/ContentFinderByConfigured404.cs index eae198bb59..5255da6521 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByConfigured404.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByConfigured404.cs @@ -69,7 +69,7 @@ namespace Umbraco.Web.Routing if (error404.HasValue) { - _logger.Debug("Got id={ErrorNodeId}.", error404.Value); + _logger.Debug("Got id={ErrorNodeId}.", error404.Value); content = frequest.UmbracoContext.Content.GetById(error404.Value); diff --git a/src/Umbraco.Web/Routing/ContentFinderByIdPath.cs b/src/Umbraco.Web/Routing/ContentFinderByIdPath.cs index b339198928..8cc52054f3 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByIdPath.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByIdPath.cs @@ -49,7 +49,7 @@ namespace Umbraco.Web.Routing if (nodeId > 0) { - _logger.Debug("Id={NodeId}", nodeId); + _logger.Debug("Id={NodeId}", nodeId); node = frequest.UmbracoContext.Content.GetById(nodeId); if (node != null) @@ -62,7 +62,7 @@ namespace Umbraco.Web.Routing } frequest.PublishedContent = node; - _logger.Debug("Found node with id={PublishedContentId}", frequest.PublishedContent.Id); + _logger.Debug("Found node with id={PublishedContentId}", frequest.PublishedContent.Id); } else { diff --git a/src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs b/src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs index 6c1195d222..265d6ff3a4 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs @@ -42,7 +42,7 @@ namespace Umbraco.Web.Routing if (redirectUrl == null) { - _logger.Debug("No match for route: {Route}", route); + _logger.Debug("No match for route: {Route}", route); return false; } @@ -50,14 +50,14 @@ namespace Umbraco.Web.Routing var url = content == null ? "#" : content.Url(redirectUrl.Culture); if (url.StartsWith("#")) { - _logger.Debug("Route {Route} matches content {ContentId} which has no URL.", route, redirectUrl.ContentId); + _logger.Debug("Route {Route} matches content {ContentId} which has no URL.", route, redirectUrl.ContentId); return false; } // Appending any querystring from the incoming request to the redirect URL url = string.IsNullOrEmpty(frequest.Uri.Query) ? url : url + frequest.Uri.Query; - _logger.Debug("Route {Route} matches content {ContentId} with URL '{Url}', redirecting.", route, content.Id, url); + _logger.Debug("Route {Route} matches content {ContentId} with url '{Url}', redirecting.", route, content.Id, url); frequest.SetRedirectPermanent(url); diff --git a/src/Umbraco.Web/Routing/ContentFinderByUrl.cs b/src/Umbraco.Web/Routing/ContentFinderByUrl.cs index 074193417a..571dfddd2e 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByUrl.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByUrl.cs @@ -46,13 +46,13 @@ namespace Umbraco.Web.Routing { if (docreq == null) throw new System.ArgumentNullException(nameof(docreq)); - Logger.Debug("Test route {Route}", route); + Logger.Debug("Test route {Route}", route); var node = docreq.UmbracoContext.Content.GetByRoute(docreq.UmbracoContext.InPreviewMode, route, culture: docreq.Culture?.Name); if (node != null) { docreq.PublishedContent = node; - Logger.Debug("Got content, id={NodeId}", node.Id); + Logger.Debug("Got content, id={NodeId}", node.Id); } else { diff --git a/src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs b/src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs index 0ee5f3d42d..9f470b83ac 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs @@ -44,7 +44,7 @@ namespace Umbraco.Web.Routing if (node != null) { frequest.PublishedContent = node; - Logger.Debug("Path '{UriAbsolutePath}' is an alias for id={PublishedContentId}", frequest.Uri.AbsolutePath, frequest.PublishedContent.Id); + Logger.Debug("Path '{UriAbsolutePath}' is an alias for id={PublishedContentId}", frequest.Uri.AbsolutePath, frequest.PublishedContent.Id); } } diff --git a/src/Umbraco.Web/Routing/ContentFinderByUrlAndTemplate.cs b/src/Umbraco.Web/Routing/ContentFinderByUrlAndTemplate.cs index a02ebbb2a8..bb5cea063a 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByUrlAndTemplate.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByUrlAndTemplate.cs @@ -56,11 +56,11 @@ namespace Umbraco.Web.Routing if (template == null) { - Logger.Debug("Not a valid template: '{TemplateAlias}'", templateAlias); + Logger.Debug("Not a valid template: '{TemplateAlias}'", templateAlias); return false; } - Logger.Debug("Valid template: '{TemplateAlias}'", templateAlias); + Logger.Debug("Valid template: '{TemplateAlias}'", templateAlias); // look for node corresponding to the rest of the route var route = frequest.HasDomain ? (frequest.Domain.ContentId + path) : path; @@ -68,14 +68,14 @@ namespace Umbraco.Web.Routing if (node == null) { - Logger.Debug("Not a valid route to node: '{Route}'", route); + Logger.Debug("Not a valid route to node: '{Route}'", route); return false; } // IsAllowedTemplate deals both with DisableAlternativeTemplates and ValidateAlternativeTemplates settings if (!node.IsAllowedTemplate(template.Id)) { - Logger.Warn("Alternative template '{TemplateAlias}' is not allowed on node {NodeId}.", template.Alias, node.Id); + Logger.Warn("Alternative template '{TemplateAlias}' is not allowed on node {NodeId}.", template.Alias, node.Id); frequest.PublishedContent = null; // clear return false; } diff --git a/src/Umbraco.Web/Routing/DefaultUrlProvider.cs b/src/Umbraco.Web/Routing/DefaultUrlProvider.cs index f26f05c36c..fdd76a9160 100644 --- a/src/Umbraco.Web/Routing/DefaultUrlProvider.cs +++ b/src/Umbraco.Web/Routing/DefaultUrlProvider.cs @@ -44,7 +44,7 @@ namespace Umbraco.Web.Routing { if (string.IsNullOrWhiteSpace(route)) { - _logger.Debug("Couldn't find any page with nodeId={NodeId}. This is most likely caused by the page not being published.", id); + _logger.Debug("Couldn't find any page with nodeId={NodeId}. This is most likely caused by the page not being published.", id); return null; } diff --git a/src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs b/src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs index 9fefeeb843..f2494696cf 100644 --- a/src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs +++ b/src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs @@ -107,7 +107,7 @@ namespace Umbraco.Web.Routing } catch (Exception ex) { - Current.Logger.Error(ex, "Could not parse xpath expression: {ContentXPath}", errorPage.ContentXPath); + Current.Logger.Error(ex, "Could not parse xpath expression: {ContentXPath}", errorPage.ContentXPath); return null; } } diff --git a/src/Umbraco.Web/Routing/PublishedRouter.cs b/src/Umbraco.Web/Routing/PublishedRouter.cs index 676b973271..a02fd5872a 100644 --- a/src/Umbraco.Web/Routing/PublishedRouter.cs +++ b/src/Umbraco.Web/Routing/PublishedRouter.cs @@ -253,7 +253,7 @@ namespace Umbraco.Web.Routing // note - we are not handling schemes nor ports here. - _logger.Debug("{TracePrefix}Uri={RequestUri}", tracePrefix, request.Uri); + _logger.Debug("{TracePrefix}Uri={RequestUri}", tracePrefix, request.Uri); var domainsCache = request.UmbracoContext.PublishedSnapshot.Domains; var domains = domainsCache.GetAll(includeWildcards: false).ToList(); @@ -305,12 +305,12 @@ namespace Umbraco.Web.Routing else { // not matching any existing domain - _logger.Debug("{TracePrefix}Matches no domain", tracePrefix); + _logger.Debug("{TracePrefix}Matches no domain", tracePrefix); request.Culture = defaultCulture == null ? CultureInfo.CurrentUICulture : new CultureInfo(defaultCulture); } - _logger.Debug("{TracePrefix}Culture={CultureName}", tracePrefix, request.Culture.Name); + _logger.Debug("{TracePrefix}Culture={CultureName}", tracePrefix, request.Culture.Name); return request.Domain != null; } @@ -326,7 +326,7 @@ namespace Umbraco.Web.Routing return; var nodePath = request.PublishedContent.Path; - _logger.Debug("{TracePrefix}Path={NodePath}", tracePrefix, nodePath); + _logger.Debug("{TracePrefix}Path={NodePath}", tracePrefix, nodePath); var rootNodeId = request.HasDomain ? request.Domain.ContentId : (int?)null; var domain = DomainUtilities.FindWildcardDomainInPath(request.UmbracoContext.PublishedSnapshot.Domains.GetAll(true), nodePath, rootNodeId); @@ -334,11 +334,11 @@ namespace Umbraco.Web.Routing if (domain != null) { request.Culture = domain.Culture; - _logger.Debug("{TracePrefix}Got domain on node {DomainContentId}, set culture to {CultureName}", tracePrefix, domain.ContentId, request.Culture.Name); + _logger.Debug("{TracePrefix}Got domain on node {DomainContentId}, set culture to {CultureName}", tracePrefix, domain.ContentId, request.Culture.Name); } else { - _logger.Debug("{TracePrefix}No match.", tracePrefix); + _logger.Debug("{TracePrefix}No match.", tracePrefix); } } @@ -380,7 +380,7 @@ namespace Umbraco.Web.Routing /// A value indicating whether a document and template were found. private void FindPublishedContentAndTemplate(PublishedRequest request) { - _logger.Debug("FindPublishedContentAndTemplate: Path={UriAbsolutePath}", request.Uri.AbsolutePath); + _logger.Debug("FindPublishedContentAndTemplate: Path={UriAbsolutePath}", request.Uri.AbsolutePath); // run the document finders FindPublishedContent(request); @@ -423,7 +423,7 @@ namespace Umbraco.Web.Routing //iterate but return on first one that finds it var found = _contentFinders.Any(finder => { - _logger.Debug("Finder {ContentFinderType}", finder.GetType().FullName); + _logger.Debug("Finder {ContentFinderType}", finder.GetType().FullName); return finder.TryFindContent(request); }); @@ -457,7 +457,7 @@ namespace Umbraco.Web.Routing const int maxLoop = 8; do { - _logger.Debug("HandlePublishedContent: Loop {LoopCounter}", i); + _logger.Debug("HandlePublishedContent: Loop {LoopCounter}", i); // handle not found if (request.HasPublishedContent == false) @@ -543,13 +543,13 @@ namespace Umbraco.Web.Routing if (valid == false) { // bad redirect - log and display the current page (legacy behavior) - _logger.Debug("FollowInternalRedirects: Failed to redirect to id={InternalRedirectId}: value is not an int nor a GuidUdi.", + _logger.Debug("FollowInternalRedirects: Failed to redirect to id={InternalRedirectId}: value is not an int nor a GuidUdi.", request.PublishedContent.GetProperty(Constants.Conventions.Content.InternalRedirectId).GetSourceValue()); } if (internalRedirectNode == null) { - _logger.Debug("FollowInternalRedirects: Failed to redirect to id={InternalRedirectId}: no such published document.", + _logger.Debug("FollowInternalRedirects: Failed to redirect to id={InternalRedirectId}: no such published document.", request.PublishedContent.GetProperty(Constants.Conventions.Content.InternalRedirectId).GetSourceValue()); } else if (internalRedirectId == request.PublishedContent.Id) @@ -561,7 +561,7 @@ namespace Umbraco.Web.Routing { request.SetInternalRedirectPublishedContent(internalRedirectNode); // don't use .PublishedContent here redirect = true; - _logger.Debug("FollowInternalRedirects: Redirecting to id={InternalRedirectId}", internalRedirectId); + _logger.Debug("FollowInternalRedirects: Redirecting to id={InternalRedirectId}", internalRedirectId); } return redirect; @@ -701,7 +701,7 @@ namespace Umbraco.Web.Routing if (request.HasTemplate) _logger.Debug("FindTemplate: Has a template already, but also an alternative template."); - _logger.Debug("FindTemplate: Look for alternative template alias={AltTemplate}", altTemplate); + _logger.Debug("FindTemplate: Look for alternative template alias={AltTemplate}", altTemplate); // IsAllowedTemplate deals both with DisableAlternativeTemplates and ValidateAlternativeTemplates settings if (request.PublishedContent.IsAllowedTemplate(altTemplate)) @@ -712,16 +712,16 @@ namespace Umbraco.Web.Routing if (template != null) { request.TemplateModel = template; - _logger.Debug("FindTemplate: Got alternative template id={TemplateId} alias={TemplateAlias}", template.Id, template.Alias); + _logger.Debug("FindTemplate: Got alternative template id={TemplateId} alias={TemplateAlias}", template.Id, template.Alias); } else { - _logger.Debug("FindTemplate: The alternative template with alias={AltTemplate} does not exist, ignoring.", altTemplate); + _logger.Debug("FindTemplate: The alternative template with alias={AltTemplate} does not exist, ignoring.", altTemplate); } } else { - _logger.Warn("FindTemplate: Alternative template {TemplateAlias} is not allowed on node {NodeId}, ignoring.", altTemplate, request.PublishedContent.Id); + _logger.Warn("FindTemplate: Alternative template {TemplateAlias} is not allowed on node {NodeId}, ignoring.", altTemplate, request.PublishedContent.Id); // no allowed, back to default var templateId = request.PublishedContent.TemplateId; @@ -744,7 +744,7 @@ namespace Umbraco.Web.Routing } else { - _logger.Debug("FindTemplate: Running with template id={TemplateId} alias={TemplateAlias}", request.TemplateModel.Id, request.TemplateModel.Alias); + _logger.Debug("FindTemplate: Running with template id={TemplateId} alias={TemplateAlias}", request.TemplateModel.Id, request.TemplateModel.Alias); } } @@ -756,7 +756,7 @@ namespace Umbraco.Web.Routing return null; } - _logger.Debug("GetTemplateModel: Get template id={TemplateId}", templateId); + _logger.Debug("GetTemplateModel: Get template id={TemplateId}", templateId); if (templateId == null) throw new InvalidOperationException("The template is not set, the page cannot render."); @@ -764,7 +764,7 @@ namespace Umbraco.Web.Routing var template = _services.FileService.GetTemplate(templateId.Value); if (template == null) throw new InvalidOperationException("The template with Id " + templateId + " does not exist, the page cannot render."); - _logger.Debug("GetTemplateModel: Got template id={TemplateId} alias={TemplateAlias}", template.Id, template.Alias); + _logger.Debug("GetTemplateModel: Got template id={TemplateId} alias={TemplateAlias}", template.Id, template.Alias); return template; } diff --git a/src/Umbraco.Web/Scheduling/BackgroundTaskRunner.cs b/src/Umbraco.Web/Scheduling/BackgroundTaskRunner.cs index 81bb45e270..a126592ffc 100644 --- a/src/Umbraco.Web/Scheduling/BackgroundTaskRunner.cs +++ b/src/Umbraco.Web/Scheduling/BackgroundTaskRunner.cs @@ -239,7 +239,7 @@ namespace Umbraco.Web.Scheduling throw new InvalidOperationException("The task runner has completed."); // add task - _logger.Debug("{LogPrefix} Task Added {TaskType}", _logPrefix , task.GetType().FullName); + _logger.Debug("{LogPrefix} Task Added {TaskType}", _logPrefix , task.GetType().FullName); _tasks.Post(task); // start @@ -259,12 +259,12 @@ namespace Umbraco.Web.Scheduling { if (_completed) { - _logger.Debug("{LogPrefix} Task cannot be added {TaskType}, the task runner has already shutdown", _logPrefix, task.GetType().FullName); + _logger.Debug("{LogPrefix} Task cannot be added {TaskType}, the task runner has already shutdown", _logPrefix, task.GetType().FullName); return false; } // add task - _logger.Debug("{LogPrefix} Task added {TaskType}", _logPrefix, task.GetType().FullName); + _logger.Debug("{LogPrefix} Task added {TaskType}", _logPrefix, task.GetType().FullName); _tasks.Post(task); // start @@ -321,7 +321,7 @@ namespace Umbraco.Web.Scheduling _shutdownToken = _shutdownTokenSource.Token; _runningTask = Task.Run(async () => await Pump().ConfigureAwait(false), _shutdownToken); - _logger.Debug("{LogPrefix} Starting", _logPrefix); + _logger.Debug("{LogPrefix} Starting", _logPrefix); } /// @@ -342,7 +342,7 @@ namespace Umbraco.Web.Scheduling var hasTasks = TaskCount > 0; if (!force && hasTasks) - _logger.Info("{LogPrefix} Waiting for tasks to complete", _logPrefix); + _logger.Info("{LogPrefix} Waiting for tasks to complete", _logPrefix); // complete the queue // will stop waiting on the queue or on a latch @@ -408,7 +408,7 @@ namespace Umbraco.Web.Scheduling } catch (Exception ex) { - _logger.Error(ex, "{LogPrefix} Task runner exception", _logPrefix); + _logger.Error(ex, "{LogPrefix} Task runner exception", _logPrefix); } } } @@ -440,7 +440,7 @@ namespace Umbraco.Web.Scheduling if (_shutdownToken.IsCancellationRequested == false && TaskCount > 0) continue; // if we really have nothing to do, stop - _logger.Debug("{LogPrefix} Stopping", _logPrefix); + _logger.Debug("{LogPrefix} Stopping", _logPrefix); if (_options.PreserveRunningTask == false) _runningTask = null; @@ -567,7 +567,7 @@ namespace Umbraco.Web.Scheduling catch (Exception ex) { - _logger.Error(ex, "{LogPrefix} Task has failed", _logPrefix); + _logger.Error(ex, "{LogPrefix} Task has failed", _logPrefix); } } @@ -601,7 +601,7 @@ namespace Umbraco.Web.Scheduling private void OnEvent(TypedEventHandler, TArgs> handler, string name, TArgs e) { - _logger.Debug("{LogPrefix} OnEvent {EventName}", _logPrefix, name); + _logger.Debug("{LogPrefix} OnEvent {EventName}", _logPrefix, name); if (handler == null) return; @@ -611,7 +611,7 @@ namespace Umbraco.Web.Scheduling } catch (Exception ex) { - _logger.Error(ex, "{LogPrefix} {Name} exception occurred", _logPrefix, name); + _logger.Error(ex, "{LogPrefix} {Name} exception occurred", _logPrefix, name); } } @@ -698,7 +698,7 @@ namespace Umbraco.Web.Scheduling if (_terminating == false) { _terminating = true; - _logger.Info("{LogPrefix} Terminating {Immediate}", _logPrefix, immediate ? immediate.ToString() : string.Empty); + _logger.Info("{LogPrefix} Terminating {Immediate}", _logPrefix, immediate ? immediate.ToString() : string.Empty); onTerminating = true; } } @@ -791,7 +791,7 @@ namespace Umbraco.Web.Scheduling /// private void StopImmediate() { - _logger.Info("{LogPrefix} Canceling tasks", _logPrefix); + _logger.Info("{LogPrefix} Canceling tasks", _logPrefix); try { Shutdown(true, true); // cancel all tasks, wait for the current one to end @@ -825,7 +825,7 @@ namespace Umbraco.Web.Scheduling terminatedSource = _terminatedSource; } - _logger.Info("{LogPrefix} Tasks {TaskStatus}, terminated", + _logger.Info("{LogPrefix} Tasks {TaskStatus}, terminated", _logPrefix, immediate ? "cancelled" : "completed"); diff --git a/src/Umbraco.Web/Scheduling/KeepAlive.cs b/src/Umbraco.Web/Scheduling/KeepAlive.cs index 2dcf9a24a7..5ee10e4c2a 100644 --- a/src/Umbraco.Web/Scheduling/KeepAlive.cs +++ b/src/Umbraco.Web/Scheduling/KeepAlive.cs @@ -70,7 +70,7 @@ namespace Umbraco.Web.Scheduling } catch (Exception ex) { - _logger.Error(ex, "Keep alive failed (at '{keepAlivePingUrl}').", keepAlivePingUrl); + _logger.Error(ex, "Keep alive failed (at '{keepAlivePingUrl}').", keepAlivePingUrl); } } diff --git a/src/Umbraco.Web/Scheduling/ScheduledPublishing.cs b/src/Umbraco.Web/Scheduling/ScheduledPublishing.cs index 97afe25e22..b7ec7ffc0e 100644 --- a/src/Umbraco.Web/Scheduling/ScheduledPublishing.cs +++ b/src/Umbraco.Web/Scheduling/ScheduledPublishing.cs @@ -67,7 +67,7 @@ namespace Umbraco.Web.Scheduling // run var result = _contentService.PerformScheduledPublish(DateTime.Now); foreach (var grouped in result.GroupBy(x => x.Result)) - _logger.Info("Scheduled publishing result: '{StatusCount}' items with status {Status}", grouped.Count(), grouped.Key); + _logger.Info("Scheduled publishing result: '{StatusCount}' items with status {Status}", grouped.Count(), grouped.Key); } finally { diff --git a/src/Umbraco.Web/Scheduling/TempFileCleanup.cs b/src/Umbraco.Web/Scheduling/TempFileCleanup.cs index d2a254dfd6..05f96f0e75 100644 --- a/src/Umbraco.Web/Scheduling/TempFileCleanup.cs +++ b/src/Umbraco.Web/Scheduling/TempFileCleanup.cs @@ -50,7 +50,7 @@ namespace Umbraco.Web.Scheduling dir.Refresh(); //in case it's changed during runtime if (!dir.Exists) { - _logger.Debug("The cleanup folder doesn't exist {Folder}", dir.FullName); + _logger.Debug("The cleanup folder doesn't exist {Folder}", dir.FullName); return; } @@ -66,7 +66,7 @@ namespace Umbraco.Web.Scheduling } catch (Exception ex) { - _logger.Error(ex, "Could not delete temp file {FileName}", file.FullName); + _logger.Error(ex, "Could not delete temp file {FileName}", file.FullName); } } } diff --git a/src/Umbraco.Web/Search/ExamineComponent.cs b/src/Umbraco.Web/Search/ExamineComponent.cs index d1b3a868d7..11778a64bb 100644 --- a/src/Umbraco.Web/Search/ExamineComponent.cs +++ b/src/Umbraco.Web/Search/ExamineComponent.cs @@ -107,7 +107,7 @@ namespace Umbraco.Web.Search var registeredIndexers = _examineManager.Indexes.OfType().Count(x => x.EnableDefaultEventHandler); - _logger.Info("Adding examine event handlers for {RegisteredIndexers} index providers.", registeredIndexers); + _logger.Info("Adding examine event handlers for {RegisteredIndexers} index providers.", registeredIndexers); // don't bind event handlers if we're not suppose to listen if (registeredIndexers == 0) diff --git a/src/Umbraco.Web/Security/MembershipHelper.cs b/src/Umbraco.Web/Security/MembershipHelper.cs index e655b87767..49ed6f6f99 100644 --- a/src/Umbraco.Web/Security/MembershipHelper.cs +++ b/src/Umbraco.Web/Security/MembershipHelper.cs @@ -315,7 +315,7 @@ namespace Umbraco.Web.Security if (member == null) { //this should not happen - Current.Logger.Warn("The member validated but then no member was returned with the username {Username}", username); + Current.Logger.Warn("The member validated but then no member was returned with the username {Username}", username); return false; } //Log them in diff --git a/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs b/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs index ad53949c28..0e2fd01106 100644 --- a/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs +++ b/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs @@ -147,7 +147,7 @@ namespace Umbraco.Web.Security.Providers if (MemberService.Exists(username)) { status = MembershipCreateStatus.DuplicateUserName; - Current.Logger.Warn>("Cannot create member as username already exists: {Username}", username); + Current.Logger.Warn, string>("Cannot create member as username already exists: {Username}", username); return null; } @@ -155,7 +155,7 @@ namespace Umbraco.Web.Security.Providers if (MemberService.GetByEmail(email) != null && RequiresUniqueEmail) { status = MembershipCreateStatus.DuplicateEmail; - Current.Logger.Warn>("Cannot create member as a member with the same email address exists: {Email}", email); + Current.Logger.Warn, string>("Cannot create member as a member with the same email address exists: {Email}", email); return null; } @@ -523,7 +523,7 @@ namespace Umbraco.Web.Security.Providers if (member == null) { - Current.Logger.Info("Login attempt failed for username {Username} from IP address {IpAddress}, the user does not exist", username, GetCurrentRequestIpAddress()); + Current.Logger.Info("Login attempt failed for username {Username} from IP address {IpAddress}, the user does not exist", username, GetCurrentRequestIpAddress()); return new ValidateUserResult { @@ -533,7 +533,7 @@ namespace Umbraco.Web.Security.Providers if (member.IsApproved == false) { - Current.Logger.Info("Login attempt failed for username {Username} from IP address {IpAddress}, the user is not approved", username, GetCurrentRequestIpAddress()); + Current.Logger.Info("Login attempt failed for username {Username} from IP address {IpAddress}, the user is not approved", username, GetCurrentRequestIpAddress()); return new ValidateUserResult { @@ -543,7 +543,7 @@ namespace Umbraco.Web.Security.Providers } if (member.IsLockedOut) { - Current.Logger.Info("Login attempt failed for username {Username} from IP address {IpAddress}, the user is locked", username, GetCurrentRequestIpAddress()); + Current.Logger.Info("Login attempt failed for username {Username} from IP address {IpAddress}, the user is locked", username, GetCurrentRequestIpAddress()); return new ValidateUserResult { @@ -569,11 +569,11 @@ namespace Umbraco.Web.Security.Providers member.IsLockedOut = true; member.LastLockoutDate = DateTime.Now; - Current.Logger.Info("Login attempt failed for username {Username} from IP address {IpAddress}, the user is now locked out, max invalid password attempts exceeded", username, GetCurrentRequestIpAddress()); + Current.Logger.Info("Login attempt failed for username {Username} from IP address {IpAddress}, the user is now locked out, max invalid password attempts exceeded", username, GetCurrentRequestIpAddress()); } else { - Current.Logger.Info("Login attempt failed for username {Username} from IP address {IpAddress}", username, GetCurrentRequestIpAddress()); + Current.Logger.Info("Login attempt failed for username {Username} from IP address {IpAddress}", username, GetCurrentRequestIpAddress()); } requiresFullSave = true; @@ -589,7 +589,7 @@ namespace Umbraco.Web.Security.Providers member.LastLoginDate = DateTime.Now; - Current.Logger.Info("Login attempt succeeded for username {Username} from IP address {IpAddress}", username, GetCurrentRequestIpAddress()); + Current.Logger.Info("Login attempt succeeded for username {Username} from IP address {IpAddress}", username, GetCurrentRequestIpAddress()); } // don't raise events for this! It just sets the member dates, if we do raise events this will diff --git a/src/Umbraco.Web/Services/IconService.cs b/src/Umbraco.Web/Services/IconService.cs index 175650fd12..15e673e6ba 100644 --- a/src/Umbraco.Web/Services/IconService.cs +++ b/src/Umbraco.Web/Services/IconService.cs @@ -1,8 +1,10 @@ +using System; using System.Collections.Generic; using System.IO; using System.Linq; using Ganss.XSS; using Umbraco.Core; +using Umbraco.Core.Cache; using Umbraco.Core.Configuration; using Umbraco.Core.IO; using Umbraco.Core.Models; @@ -14,31 +16,43 @@ namespace Umbraco.Web.Services { private readonly IGlobalSettings _globalSettings; private readonly IHtmlSanitizer _htmlSanitizer; + private readonly IAppPolicyCache _cache; - public IconService(IGlobalSettings globalSettings, IHtmlSanitizer htmlSanitizer) + public IconService(IGlobalSettings globalSettings, IHtmlSanitizer htmlSanitizer, AppCaches appCaches) { _globalSettings = globalSettings; _htmlSanitizer = htmlSanitizer; + _cache = appCaches.RuntimeCache; } - /// - public IList GetAllIcons() - { - var directory = new DirectoryInfo(IOHelper.MapPath($"{_globalSettings.IconsPath}/")); - var iconNames = directory.GetFiles("*.svg"); + public IReadOnlyDictionary GetIcons() => GetIconDictionary(); - return iconNames.OrderBy(f => f.Name) - .Select(iconInfo => GetIcon(iconInfo)).WhereNotNull().ToList(); - - } + /// + public IList GetAllIcons() => + GetIconDictionary() + .Select(x => new IconModel { Name = x.Key, SvgString = x.Value }) + .ToList(); /// public IconModel GetIcon(string iconName) { - return string.IsNullOrWhiteSpace(iconName) - ? null - : CreateIconModel(iconName.StripFileExtension(), IOHelper.MapPath($"{_globalSettings.IconsPath}/{iconName}.svg")); + if (iconName.IsNullOrWhiteSpace()) + { + return null; + } + + var allIconModels = GetIconDictionary(); + if (allIconModels.ContainsKey(iconName)) + { + return new IconModel + { + Name = iconName, + SvgString = allIconModels[iconName] + }; + } + + return null; } /// @@ -79,5 +93,52 @@ namespace Umbraco.Web.Services return null; } } + + private IEnumerable GetAllIconsFiles() + { + var icons = new HashSet(new CaseInsensitiveFileInfoComparer()); + + // add icons from plugins + var appPluginsDirectoryPath = IOHelper.MapPath(SystemDirectories.AppPlugins); + if (Directory.Exists(appPluginsDirectoryPath)) + { + var appPlugins = new DirectoryInfo(appPluginsDirectoryPath); + + // iterate sub directories of app plugins + foreach (var dir in appPlugins.EnumerateDirectories()) + { + var iconPath = IOHelper.MapPath($"{SystemDirectories.AppPlugins}/{dir.Name}{SystemDirectories.AppPluginIcons}"); + if (Directory.Exists(iconPath)) + { + var dirIcons = new DirectoryInfo(iconPath).EnumerateFiles("*.svg", SearchOption.TopDirectoryOnly); + icons.UnionWith(dirIcons); + } + } + } + + // add icons from IconsPath if not already added from plugins + var coreIconsDirectory = new DirectoryInfo(IOHelper.MapPath($"{_globalSettings.IconsPath}/")); + var coreIcons = coreIconsDirectory.GetFiles("*.svg"); + + icons.UnionWith(coreIcons); + + return icons; + } + + private class CaseInsensitiveFileInfoComparer : IEqualityComparer + { + public bool Equals(FileInfo one, FileInfo two) => StringComparer.InvariantCultureIgnoreCase.Equals(one.Name, two.Name); + + public int GetHashCode(FileInfo item) => StringComparer.InvariantCultureIgnoreCase.GetHashCode(item.Name); + } + + private IReadOnlyDictionary GetIconDictionary() => _cache.GetCacheItem( + $"{typeof(IconService).FullName}.{nameof(GetIconDictionary)}", + () => GetAllIconsFiles() + .Select(GetIcon) + .Where(i => i != null) + .GroupBy(i => i.Name, StringComparer.OrdinalIgnoreCase) + .ToDictionary(g => g.Key, g => g.First().SvgString, StringComparer.OrdinalIgnoreCase) + ); } } diff --git a/src/Umbraco.Web/Templates/HtmlUrlParser.cs b/src/Umbraco.Web/Templates/HtmlUrlParser.cs index 0692b75fa7..721e8c04f4 100644 --- a/src/Umbraco.Web/Templates/HtmlUrlParser.cs +++ b/src/Umbraco.Web/Templates/HtmlUrlParser.cs @@ -36,7 +36,7 @@ namespace Umbraco.Web.Templates { // find all relative URLs (ie. URLs that contain ~) var tags = ResolveUrlPattern.Matches(text); - _logger.Debug(typeof(IOHelper), "After regex: {Duration} matched: {TagsCount}", timer.Stopwatch.ElapsedMilliseconds, tags.Count); + _logger.Debug(typeof(IOHelper), "After regex: {Duration} matched: {TagsCount}", timer.Stopwatch.ElapsedMilliseconds, tags.Count); foreach (Match tag in tags) { var url = ""; diff --git a/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs b/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs index 57c7027598..ea78ef7aa0 100644 --- a/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs +++ b/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs @@ -175,7 +175,7 @@ namespace Umbraco.Web.Trees // TODO: in the future we could return a validation statement so we can have some UI to notify the user they don't have access if (ignoreUserStartNodes == false && HasPathAccess(id, queryStrings) == false) { - Logger.Warn("User {Username} does not have access to node with id {Id}", Security.CurrentUser.Username, id); + Logger.Warn("User {Username} does not have access to node with id {Id}", Security.CurrentUser.Username, id); return nodes; } diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 5d7d3f7c2c..a6096692b4 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -263,6 +263,8 @@ + + @@ -1315,8 +1317,7 @@ - - +