diff --git a/build/NuSpecs/UmbracoCms.Core.nuspec b/build/NuSpecs/UmbracoCms.Core.nuspec
index 8826705157..dc1224842e 100644
--- a/build/NuSpecs/UmbracoCms.Core.nuspec
+++ b/build/NuSpecs/UmbracoCms.Core.nuspec
@@ -35,6 +35,7 @@
+
diff --git a/build/NuSpecs/UmbracoCms.nuspec b/build/NuSpecs/UmbracoCms.nuspec
index 678037a84a..6681c97b49 100644
--- a/build/NuSpecs/UmbracoCms.nuspec
+++ b/build/NuSpecs/UmbracoCms.nuspec
@@ -22,7 +22,7 @@
not want this to happen as the alpha of the next major is, really, the next major already.
-->
-
+
@@ -52,9 +52,8 @@
-
-
+
diff --git a/build/NuSpecs/tools/Dashboard.config.install.xdt b/build/NuSpecs/tools/Dashboard.config.install.xdt
deleted file mode 100644
index a81af8c365..0000000000
--- a/build/NuSpecs/tools/Dashboard.config.install.xdt
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
-
- views/dashboard/settings/settingsdashboardintro.html
-
-
-
-
-
-
- forms
-
-
-
- views/dashboard/forms/formsdashboardintro.html
-
-
-
-
-
-
- developer
-
-
-
-
-
-
- views/dashboard/developer/developerdashboardvideos.html
-
-
-
-
-
-
-
-
- views/dashboard/developer/examinemanagement.html
-
-
-
-
-
-
-
-
-
- views/dashboard/media/mediafolderbrowser.html
-
-
-
-
-
-
-
-
- views/dashboard/members/membersdashboardvideos.html
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- content
-
-
-
- views/dashboard/developer/redirecturls.html
-
-
-
-
-
-
- developer
-
-
-
- views/dashboard/developer/healthcheck.html
-
-
-
-
diff --git a/build/build.ps1 b/build/build.ps1
index 65b4041e30..d811c2cc21 100644
--- a/build/build.ps1
+++ b/build/build.ps1
@@ -120,7 +120,7 @@
} finally {
Pop-Location
- # fixme - should we filter the log to find errors?
+ # FIXME: should we filter the log to find errors?
#get-content .\build.tmp\belle.log | %{ if ($_ -match "build") { write $_}}
# restore
@@ -177,7 +177,7 @@
{
Write-Host "Prepare Tests"
- # fixme - idea is to avoid rebuilding everything for tests
+ # FIXME: - idea is to avoid rebuilding everything for tests
# but because of our weird assembly versioning (with .* stuff)
# everything gets rebuilt all the time...
#Copy-Files "$tmp\bin" "." "$tmp\tests"
diff --git a/src/Umbraco.Core/Cache/CacheKeys.cs b/src/Umbraco.Core/Cache/CacheKeys.cs
index 50bd4ca0ac..e8f93d636a 100644
--- a/src/Umbraco.Core/Cache/CacheKeys.cs
+++ b/src/Umbraco.Core/Cache/CacheKeys.cs
@@ -7,7 +7,7 @@
{
public const string ApplicationsCacheKey = "ApplicationCache"; // used by SectionService
- // TODO this one can probably be removed
+ // TODO: this one can probably be removed
public const string TemplateFrontEndCacheKey = "template";
public const string MacroContentCacheKey = "macroContent_"; // used in MacroRenderers
diff --git a/src/Umbraco.Core/Cache/HttpRequestAppCache.cs b/src/Umbraco.Core/Cache/HttpRequestAppCache.cs
index 0fdf70ac27..f1932f97ce 100644
--- a/src/Umbraco.Core/Cache/HttpRequestAppCache.cs
+++ b/src/Umbraco.Core/Cache/HttpRequestAppCache.cs
@@ -31,7 +31,7 @@ namespace Umbraco.Core.Cache
///
///
/// Will use HttpContext.Current.
- /// TODO - https://github.com/umbraco/Umbraco-CMS/issues/4239 - use IHttpContextAccessor NOT HttpContext.Current
+ /// TODO: https://github.com/umbraco/Umbraco-CMS/issues/4239 - use IHttpContextAccessor NOT HttpContext.Current
///
public HttpRequestAppCache()
{ }
diff --git a/src/Umbraco.Core/Components/CompositionExtensions.cs b/src/Umbraco.Core/Components/CompositionExtensions.cs
index 2aef865994..8810213421 100644
--- a/src/Umbraco.Core/Components/CompositionExtensions.cs
+++ b/src/Umbraco.Core/Components/CompositionExtensions.cs
@@ -9,7 +9,8 @@ using Umbraco.Core.Persistence.Mappers;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Strings;
using Umbraco.Core.Sync;
-using Umbraco.Core._Legacy.PackageActions;
+using Umbraco.Core.Logging.Viewer;
+using Umbraco.Core.PackageActions;
namespace Umbraco.Core.Components
{
@@ -297,6 +298,37 @@ namespace Umbraco.Core.Components
public static void SetMediaFileSystem(this Composition composition, Func filesystemFactory)
=> composition.RegisterUniqueFor(_ => filesystemFactory());
+ ///
+ /// Sets the log viewer.
+ ///
+ /// The type of the log viewer.
+ /// The composition.
+ public static void SetLogViewer(this Composition composition)
+ where T : ILogViewer
+ {
+ composition.RegisterUnique();
+ }
+
+ ///
+ /// Sets the log viewer.
+ ///
+ /// The composition.
+ /// A function creating a log viewer.
+ public static void SetLogViewer(this Composition composition, Func factory)
+ {
+ composition.RegisterUnique(factory);
+ }
+
+ ///
+ /// Sets the log viewer.
+ ///
+ /// A composition.
+ /// A log viewer.
+ public static void SetLogViewer(this Composition composition, ILogViewer viewer)
+ {
+ composition.RegisterUnique(_ => viewer);
+ }
+
#endregion
}
}
diff --git a/src/Umbraco.Core/Components/RelateOnCopyComponent.cs b/src/Umbraco.Core/Components/RelateOnCopyComponent.cs
index 404d385680..d38406f970 100644
--- a/src/Umbraco.Core/Components/RelateOnCopyComponent.cs
+++ b/src/Umbraco.Core/Components/RelateOnCopyComponent.cs
@@ -5,7 +5,7 @@ using Umbraco.Core.Services.Implement;
namespace Umbraco.Core.Components
{
- //TODO: This should just exist in the content service/repo!
+ // TODO: This should just exist in the content service/repo!
public sealed class RelateOnCopyComponent : IComponent
{
public void Initialize()
diff --git a/src/Umbraco.Core/Composing/Current.cs b/src/Umbraco.Core/Composing/Current.cs
index 12672bcc9a..1b16ad2b8e 100644
--- a/src/Umbraco.Core/Composing/Current.cs
+++ b/src/Umbraco.Core/Composing/Current.cs
@@ -5,6 +5,7 @@ using Umbraco.Core.Dictionary;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.PublishedContent;
+using Umbraco.Core.PackageActions;
using Umbraco.Core.Packaging;
using Umbraco.Core.Persistence;
using Umbraco.Core.PropertyEditors;
@@ -12,7 +13,6 @@ using Umbraco.Core.Scoping;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using Umbraco.Core.Sync;
-using Umbraco.Core._Legacy.PackageActions;
namespace Umbraco.Core.Composing
{
diff --git a/src/Umbraco.Core/Composing/Lifetime.cs b/src/Umbraco.Core/Composing/Lifetime.cs
index a35d4d9ecf..1a2cc3119a 100644
--- a/src/Umbraco.Core/Composing/Lifetime.cs
+++ b/src/Umbraco.Core/Composing/Lifetime.cs
@@ -15,7 +15,7 @@
///
/// One unique instance per request.
///
- // TODO - review lifetimes for LightInject vs other containers
+ // TODO: review lifetimes for LightInject vs other containers
// currently, corresponds to 'Request' in LightInject which is 'Transient + disposed by Scope'
// but NOT (in LightInject) a per-web-request lifetime, more a TransientScoped
//
diff --git a/src/Umbraco.Core/Composing/TypeFinder.cs b/src/Umbraco.Core/Composing/TypeFinder.cs
index 4086eb394b..308d0ecfd7 100644
--- a/src/Umbraco.Core/Composing/TypeFinder.cs
+++ b/src/Umbraco.Core/Composing/TypeFinder.cs
@@ -614,7 +614,7 @@ namespace Umbraco.Core.Composing
var type = BuildManager.GetType(typeName, false);
if (type != null) return type;
- //TODO: This isn't very elegant, and will have issues since the AppDomain.CurrentDomain
+ // TODO: This isn't very elegant, and will have issues since the AppDomain.CurrentDomain
// doesn't actualy load in all assemblies, only the types that have been referenced so far.
// However, in a web context, the BuildManager will have executed which will force all assemblies
// to be loaded so it's fine for now.
diff --git a/src/Umbraco.Core/Composing/TypeHelper.cs b/src/Umbraco.Core/Composing/TypeHelper.cs
index c2746bef96..2f29ee09bc 100644
--- a/src/Umbraco.Core/Composing/TypeHelper.cs
+++ b/src/Umbraco.Core/Composing/TypeHelper.cs
@@ -278,7 +278,7 @@ namespace Umbraco.Core.Composing
#region Match Type
- //TODO: Need to determine if these methods should replace/combine/merge etc with IsTypeAssignableFrom, IsAssignableFromGeneric
+ // TODO: Need to determine if these methods should replace/combine/merge etc with IsTypeAssignableFrom, IsAssignableFromGeneric
// readings:
// http://stackoverflow.com/questions/2033912/c-sharp-variance-problem-assigning-listderived-as-listbase
diff --git a/src/Umbraco.Core/Composing/TypeLoaderExtensions.cs b/src/Umbraco.Core/Composing/TypeLoaderExtensions.cs
index ba57243071..5d17b0f53c 100644
--- a/src/Umbraco.Core/Composing/TypeLoaderExtensions.cs
+++ b/src/Umbraco.Core/Composing/TypeLoaderExtensions.cs
@@ -2,10 +2,10 @@
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Cache;
+using Umbraco.Core.PackageActions;
using Umbraco.Core.Persistence.Mappers;
using Umbraco.Core.Persistence.SqlSyntax;
using Umbraco.Core.PropertyEditors;
-using Umbraco.Core._Legacy.PackageActions;
namespace Umbraco.Core.Composing
{
diff --git a/src/Umbraco.Core/Composing/WeightedCollectionBuilderBase.cs b/src/Umbraco.Core/Composing/WeightedCollectionBuilderBase.cs
index f8ecc11d98..88eb61de76 100644
--- a/src/Umbraco.Core/Composing/WeightedCollectionBuilderBase.cs
+++ b/src/Umbraco.Core/Composing/WeightedCollectionBuilderBase.cs
@@ -114,7 +114,7 @@ namespace Umbraco.Core.Composing
return list;
}
- protected virtual int DefaultWeight { get; set; } = 10;
+ public virtual int DefaultWeight { get; set; } = 100;
protected virtual int GetWeight(Type type)
{
diff --git a/src/Umbraco.Core/ConfigsExtensions.cs b/src/Umbraco.Core/ConfigsExtensions.cs
index 0fcea5f430..6fdf7ea3b9 100644
--- a/src/Umbraco.Core/ConfigsExtensions.cs
+++ b/src/Umbraco.Core/ConfigsExtensions.cs
@@ -2,7 +2,6 @@
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
-using Umbraco.Core.Configuration.Dashboard;
using Umbraco.Core.Configuration.Grid;
using Umbraco.Core.Configuration.HealthChecks;
using Umbraco.Core.Configuration.UmbracoSettings;
@@ -22,9 +21,6 @@ namespace Umbraco.Core
public static IUmbracoSettingsSection Settings(this Configs configs)
=> configs.GetConfig();
- public static IDashboardSection Dashboards(this Configs configs)
- => configs.GetConfig();
-
public static IHealthChecks HealthChecks(this Configs configs)
=> configs.GetConfig();
@@ -40,7 +36,6 @@ namespace Umbraco.Core
configs.Add(() => new GlobalSettings());
configs.Add("umbracoConfiguration/settings");
- configs.Add("umbracoConfiguration/dashBoard");
configs.Add("umbracoConfiguration/HealthChecks");
configs.Add(() => new CoreDebug());
diff --git a/src/Umbraco.Core/Configuration/Dashboard/AccessElement.cs b/src/Umbraco.Core/Configuration/Dashboard/AccessElement.cs
deleted file mode 100644
index 01538c8e0b..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/AccessElement.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using System.Xml.Linq;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class AccessElement : RawXmlConfigurationElement, IAccess
- {
- public AccessElement()
- { }
-
- public AccessElement(XElement rawXml)
- : base(rawXml)
- { }
-
- public IEnumerable Rules
- {
- get
- {
- var result = new List();
- if (RawXml == null) return result;
-
- result.AddRange(RawXml.Elements("deny").Select(x => new AccessRule {Type = AccessRuleType.Deny, Value = x.Value }));
- result.AddRange(RawXml.Elements("grant").Select(x => new AccessRule { Type = AccessRuleType.Grant, Value = x.Value }));
- result.AddRange(RawXml.Elements("grantBySection").Select(x => new AccessRule { Type = AccessRuleType.GrantBySection, Value = x.Value }));
- return result;
- }
- }
- }
-}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/AreaCollection.cs b/src/Umbraco.Core/Configuration/Dashboard/AreaCollection.cs
deleted file mode 100644
index 31cc3eaec8..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/AreaCollection.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class AreaCollection : ConfigurationElementCollection, IEnumerable
- {
- protected override ConfigurationElement CreateNewElement()
- {
- return new AreaElement();
- }
-
- protected override object GetElementKey(ConfigurationElement element)
- {
- return ((AreaElement) element).Value;
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (var i = 0; i < Count; i++)
- {
- yield return BaseGet(i) as IArea;
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
-}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/AreaElement.cs b/src/Umbraco.Core/Configuration/Dashboard/AreaElement.cs
deleted file mode 100644
index 20393f89d8..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/AreaElement.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class AreaElement : InnerTextConfigurationElement, IArea
- {
- string IArea.AreaName
- {
- get { return Value; }
- }
- }
-}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/AreasElement.cs b/src/Umbraco.Core/Configuration/Dashboard/AreasElement.cs
deleted file mode 100644
index 92e51c9b73..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/AreasElement.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class AreasElement : ConfigurationElement
- {
- [ConfigurationCollection(typeof(SectionCollection), AddItemName = "area")]
- [ConfigurationProperty("", IsDefaultCollection = true)]
- public AreaCollection AreaCollection
- {
- get { return (AreaCollection)base[""]; }
- set { base[""] = value; }
- }
- }
-}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/ControlCollection.cs b/src/Umbraco.Core/Configuration/Dashboard/ControlCollection.cs
deleted file mode 100644
index b8aa40da7f..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/ControlCollection.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class ControlCollection : ConfigurationElementCollection, IEnumerable
- {
- internal void Add(ControlElement c)
- {
- BaseAdd(c);
- }
-
- protected override ConfigurationElement CreateNewElement()
- {
- return new ControlElement();
- }
-
- protected override object GetElementKey(ConfigurationElement element)
- {
- return ((ControlElement)element).ControlPath;
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (var i = 0; i < Count; i++)
- {
- yield return BaseGet(i) as IDashboardControl;
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
-}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/ControlElement.cs b/src/Umbraco.Core/Configuration/Dashboard/ControlElement.cs
deleted file mode 100644
index 20dac7460e..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/ControlElement.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-using System.Configuration;
-using System.Linq;
-using System.Xml.Linq;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
-
- internal class ControlElement : RawXmlConfigurationElement, IDashboardControl
- {
- public string PanelCaption
- {
- get
- {
- var panelCaption = RawXml.Attribute("panelCaption");
- return panelCaption == null ? "" : panelCaption.Value;
- }
- }
-
- public AccessElement Access
- {
- get
- {
- var access = RawXml.Element("access");
- return access == null ? new AccessElement() : new AccessElement(access);
- }
- }
-
- public string ControlPath
- {
- get
- {
- //we need to return the first (and only) text element of the children (wtf... who designed this configuration ! :P )
- var txt = RawXml.Nodes().OfType().FirstOrDefault();
- if (txt == null)
- {
- throw new ConfigurationErrorsException("The control element must contain a text node indicating the control path");
- }
- return txt.Value.Trim();
- }
- }
-
- IAccess IDashboardControl.AccessRights => Access;
- }
-}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/DashboardSection.cs b/src/Umbraco.Core/Configuration/Dashboard/DashboardSection.cs
deleted file mode 100644
index 12bf0522e0..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/DashboardSection.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class DashboardSection : ConfigurationSection, IDashboardSection
- {
- [ConfigurationCollection(typeof(SectionCollection), AddItemName = "section")]
- [ConfigurationProperty("", IsDefaultCollection = true)]
- public SectionCollection SectionCollection
- {
- get { return (SectionCollection)base[""]; }
- set { base[""] = value; }
- }
-
- IEnumerable IDashboardSection.Sections
- {
- get { return SectionCollection; }
- }
- }
-}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/IAccess.cs b/src/Umbraco.Core/Configuration/Dashboard/IAccess.cs
deleted file mode 100644
index 8ac1b18cca..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/IAccess.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- public interface IAccess
- {
- IEnumerable Rules { get; }
- }
-}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/IArea.cs b/src/Umbraco.Core/Configuration/Dashboard/IArea.cs
deleted file mode 100644
index 25401db408..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/IArea.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace Umbraco.Core.Configuration.Dashboard
-{
- public interface IArea
- {
- string AreaName { get; }
- }
-}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/IDashboardControl.cs b/src/Umbraco.Core/Configuration/Dashboard/IDashboardControl.cs
deleted file mode 100644
index cdf05af1ec..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/IDashboardControl.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace Umbraco.Core.Configuration.Dashboard
-{
- public interface IDashboardControl
- {
- string PanelCaption { get; }
-
- string ControlPath { get; }
-
- IAccess AccessRights { get; }
- }
-}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/IDashboardSection.cs b/src/Umbraco.Core/Configuration/Dashboard/IDashboardSection.cs
deleted file mode 100644
index 32dfc6653d..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/IDashboardSection.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- public interface IDashboardSection
- {
- IEnumerable Sections { get; }
- }
-}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/IDashboardTab.cs b/src/Umbraco.Core/Configuration/Dashboard/IDashboardTab.cs
deleted file mode 100644
index 914b226265..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/IDashboardTab.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- public interface IDashboardTab
- {
- string Caption { get; }
-
- IEnumerable Controls { get; }
-
- IAccess AccessRights { get; }
- }
-}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/ISection.cs b/src/Umbraco.Core/Configuration/Dashboard/ISection.cs
deleted file mode 100644
index 1005c0750d..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/ISection.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- public interface ISection
- {
- string Alias { get; }
-
- IEnumerable Areas { get; }
-
- IEnumerable Tabs { get; }
-
- IAccess AccessRights { get; }
- }
-}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/SectionCollection.cs b/src/Umbraco.Core/Configuration/Dashboard/SectionCollection.cs
deleted file mode 100644
index 5717bd28c3..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/SectionCollection.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class SectionCollection : ConfigurationElementCollection, IEnumerable
- {
- internal void Add(SectionElement c)
- {
- BaseAdd(c);
- }
-
- protected override ConfigurationElement CreateNewElement()
- {
- return new SectionElement();
- }
-
- protected override object GetElementKey(ConfigurationElement element)
- {
- return ((SectionElement)element).Alias;
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (var i = 0; i < Count; i++)
- {
- yield return BaseGet(i) as ISection;
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
-}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/SectionElement.cs b/src/Umbraco.Core/Configuration/Dashboard/SectionElement.cs
deleted file mode 100644
index 09049c13db..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/SectionElement.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System.Collections.Generic;
-using System.Configuration;
-using System.Linq;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class SectionElement : ConfigurationElement, ISection
- {
- [ConfigurationProperty("alias", IsRequired = true)]
- public string Alias
- {
- get { return (string) this["alias"]; }
- }
-
- [ConfigurationProperty("areas", IsRequired = true)]
- public AreasElement Areas
- {
- get { return (AreasElement)this["areas"]; }
- }
-
- [ConfigurationProperty("access")]
- public AccessElement Access
- {
- get { return (AccessElement)this["access"]; }
- }
-
- [ConfigurationCollection(typeof(SectionCollection), AddItemName = "tab")]
- [ConfigurationProperty("", IsDefaultCollection = true)]
- public TabCollection TabCollection
- {
- get { return (TabCollection)base[""]; }
- set { base[""] = value; }
- }
-
- IEnumerable ISection.Tabs
- {
- get { return TabCollection; }
- }
-
- IEnumerable ISection.Areas
- {
- get { return Areas.AreaCollection.Cast().Select(x => x.Value); }
- }
-
- IAccess ISection.AccessRights
- {
- get { return Access; }
- }
- }
-}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/TabCollection.cs b/src/Umbraco.Core/Configuration/Dashboard/TabCollection.cs
deleted file mode 100644
index 1b77ffd3fb..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/TabCollection.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class TabCollection : ConfigurationElementCollection, IEnumerable
- {
- internal void Add(TabElement c)
- {
- BaseAdd(c);
- }
-
- protected override ConfigurationElement CreateNewElement()
- {
- return new TabElement();
- }
-
- protected override object GetElementKey(ConfigurationElement element)
- {
- return ((TabElement)element).Caption;
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (var i = 0; i < Count; i++)
- {
- yield return BaseGet(i) as IDashboardTab;
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
-}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/TabElement.cs b/src/Umbraco.Core/Configuration/Dashboard/TabElement.cs
deleted file mode 100644
index b92394596e..0000000000
--- a/src/Umbraco.Core/Configuration/Dashboard/TabElement.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System.Collections.Generic;
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class TabElement : ConfigurationElement, IDashboardTab
- {
- [ConfigurationProperty("caption", IsRequired = true)]
- public string Caption
- {
- get { return (string)this["caption"]; }
- }
-
- [ConfigurationProperty("access")]
- public AccessElement Access
- {
- get { return (AccessElement)this["access"]; }
- }
-
- [ConfigurationCollection(typeof(ControlCollection), AddItemName = "control")]
- [ConfigurationProperty("", IsDefaultCollection = true)]
- public ControlCollection ControlCollection
- {
- get { return (ControlCollection)base[""]; }
- set { base[""] = value; }
- }
-
- IEnumerable IDashboardTab.Controls
- {
- get { return ControlCollection; }
- }
-
- IAccess IDashboardTab.AccessRights
- {
- get { return Access; }
- }
- }
-}
diff --git a/src/Umbraco.Core/Configuration/GlobalSettings.cs b/src/Umbraco.Core/Configuration/GlobalSettings.cs
index 4b449decff..b89a4d1daf 100644
--- a/src/Umbraco.Core/Configuration/GlobalSettings.cs
+++ b/src/Umbraco.Core/Configuration/GlobalSettings.cs
@@ -31,8 +31,8 @@ namespace Umbraco.Core.Configuration
private static string _reservedPaths;
private static string _reservedUrls;
//ensure the built on (non-changeable) reserved paths are there at all times
- internal const string StaticReservedPaths = "~/app_plugins/,~/install/,";
- internal const string StaticReservedUrls = "~/config/splashes/booting.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd,";
+ internal const string StaticReservedPaths = "~/app_plugins/,~/install/,"; //must end with a comma!
+ internal const string StaticReservedUrls = "~/config/splashes/noNodes.aspx,~/.well-known,"; //must end with a comma!
#endregion
///
@@ -82,19 +82,18 @@ namespace Umbraco.Core.Configuration
public string ReservedUrls
{
get
- {
- if (_reservedUrls == null)
- {
- var urls = ConfigurationManager.AppSettings.ContainsKey("umbracoReservedUrls")
- ? ConfigurationManager.AppSettings["umbracoReservedUrls"]
- : string.Empty;
+ {
+ if (_reservedUrls != null) return _reservedUrls;
- //ensure the built on (non-changeable) reserved paths are there at all times
- _reservedUrls = StaticReservedUrls + urls;
- }
+ var urls = ConfigurationManager.AppSettings.ContainsKey("umbracoReservedUrls")
+ ? ConfigurationManager.AppSettings["umbracoReservedUrls"]
+ : string.Empty;
+
+ //ensure the built on (non-changeable) reserved paths are there at all times
+ _reservedUrls = StaticReservedUrls + urls;
return _reservedUrls;
}
- internal set { _reservedUrls = value; }
+ internal set => _reservedUrls = value;
}
///
@@ -105,22 +104,20 @@ namespace Umbraco.Core.Configuration
{
get
{
- if (_reservedPaths == null)
- {
- var reservedPaths = StaticReservedPaths;
- //always add the umbraco path to the list
- if (ConfigurationManager.AppSettings.ContainsKey("umbracoPath")
- && !ConfigurationManager.AppSettings["umbracoPath"].IsNullOrWhiteSpace())
- {
- reservedPaths += ConfigurationManager.AppSettings["umbracoPath"].EnsureEndsWith(',');
- }
+ if (_reservedPaths != null) return _reservedPaths;
- var allPaths = ConfigurationManager.AppSettings.ContainsKey("umbracoReservedPaths")
- ? ConfigurationManager.AppSettings["umbracoReservedPaths"]
- : string.Empty;
+ var reservedPaths = StaticReservedPaths;
+ var umbPath = ConfigurationManager.AppSettings.ContainsKey("umbracoPath") && !ConfigurationManager.AppSettings["umbracoPath"].IsNullOrWhiteSpace()
+ ? ConfigurationManager.AppSettings["umbracoPath"]
+ : "~/umbraco";
+ //always add the umbraco path to the list
+ reservedPaths += umbPath.EnsureEndsWith(',');
- _reservedPaths = reservedPaths + allPaths;
- }
+ var allPaths = ConfigurationManager.AppSettings.ContainsKey("umbracoReservedPaths")
+ ? ConfigurationManager.AppSettings["umbracoReservedPaths"]
+ : string.Empty;
+
+ _reservedPaths = reservedPaths + allPaths;
return _reservedPaths;
}
}
@@ -260,26 +257,7 @@ namespace Umbraco.Core.Configuration
}
}
}
-
- ///
- /// Gets a value indicating whether umbraco uses directory urls.
- ///
- /// true if umbraco uses directory urls; otherwise, false.
- public bool UseDirectoryUrls
- {
- get
- {
- try
- {
- return bool.Parse(ConfigurationManager.AppSettings["umbracoUseDirectoryUrls"]);
- }
- catch
- {
- return false;
- }
- }
- }
-
+
///
/// Returns the number of days that should take place between version checks.
///
diff --git a/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs b/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs
index 2862a98a0e..0e7ef62c58 100644
--- a/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs
+++ b/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs
@@ -31,7 +31,7 @@ namespace Umbraco.Core.Configuration.Grid
{
List GetResult()
{
- // TODO should use the common one somehow! + ignoring _appPlugins here!
+ // TODO: should use the common one somehow! + ignoring _appPlugins here!
var parser = new ManifestParser(_appCaches, Current.ManifestValidators, _logger);
var editors = new List();
diff --git a/src/Umbraco.Core/Configuration/IGlobalSettings.cs b/src/Umbraco.Core/Configuration/IGlobalSettings.cs
index 157103be9e..b3c8ded1c0 100644
--- a/src/Umbraco.Core/Configuration/IGlobalSettings.cs
+++ b/src/Umbraco.Core/Configuration/IGlobalSettings.cs
@@ -34,12 +34,6 @@ namespace Umbraco.Core.Configuration
///
int TimeOutInMinutes { get; }
- ///
- /// Gets a value indicating whether umbraco uses directory urls.
- ///
- /// true if umbraco uses directory urls; otherwise, false.
- bool UseDirectoryUrls { get; }
-
///
/// Gets the default UI language.
///
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs
index 91627edb8b..abeaa8542a 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs
@@ -40,9 +40,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
[ConfigurationProperty("XmlContentCheckForDiskChanges")]
internal InnerTextConfigurationElement XmlContentCheckForDiskChanges => GetOptionalTextElement("XmlContentCheckForDiskChanges", false);
- [ConfigurationProperty("EnableSplashWhileLoading")]
- internal InnerTextConfigurationElement EnableSplashWhileLoading => GetOptionalTextElement("EnableSplashWhileLoading", false);
-
[ConfigurationProperty("PropertyContextHelpOption")]
internal InnerTextConfigurationElement PropertyContextHelpOption => GetOptionalTextElement("PropertyContextHelpOption", "text");
@@ -110,8 +107,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
bool IContentSection.XmlContentCheckForDiskChanges => XmlContentCheckForDiskChanges;
- bool IContentSection.EnableSplashWhileLoading => EnableSplashWhileLoading;
-
string IContentSection.PropertyContextHelpOption => PropertyContextHelpOption;
bool IContentSection.ForceSafeAliases => ForceSafeAliases;
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs
index fe2eea5d91..00dc7f073d 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs
@@ -35,8 +35,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
bool XmlContentCheckForDiskChanges { get; }
- bool EnableSplashWhileLoading { get; }
-
string PropertyContextHelpOption { get; }
bool ForceSafeAliases { get; }
@@ -67,4 +65,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
string LoginBackgroundImage { get; }
}
-}
\ No newline at end of file
+}
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/TourConfigElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/TourConfigElement.cs
index ebb649ca3b..fb231ec0cf 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/TourConfigElement.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/TourConfigElement.cs
@@ -5,13 +5,13 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
internal class TourConfigElement : UmbracoConfigurationElement, ITourSection
{
//disabled by default so that upgraders don't get it enabled by default
- //TODO: we probably just want to disable the initial one from automatically loading ?
+ // TODO: we probably just want to disable the initial one from automatically loading ?
[ConfigurationProperty("enable", DefaultValue = false)]
public bool EnableTours
{
get { return (bool)this["enable"]; }
}
- //TODO: We could have additional filters, etc... defined here
+ // TODO: We could have additional filters, etc... defined here
}
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoVersion.cs b/src/Umbraco.Core/Configuration/UmbracoVersion.cs
index bc5b6993e3..7ab97500f0 100644
--- a/src/Umbraco.Core/Configuration/UmbracoVersion.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoVersion.cs
@@ -31,7 +31,7 @@ namespace Umbraco.Core.Configuration
///
/// Gets the non-semantic version of the Umbraco code.
///
- // TODO rename to Version
+ // TODO: rename to Version
public static Version Current { get; }
///
@@ -81,7 +81,7 @@ namespace Umbraco.Core.Configuration
{
try
{
- // TODO - https://github.com/umbraco/Umbraco-CMS/issues/4238 - stop having version in web.config appSettings
+ // TODO: https://github.com/umbraco/Umbraco-CMS/issues/4238 - stop having version in web.config appSettings
var value = ConfigurationManager.AppSettings["umbracoConfigurationStatus"];
return value.IsNullOrWhiteSpace() ? null : SemVersion.TryParse(value, out var semver) ? semver : null;
}
diff --git a/src/Umbraco.Core/Constants-Applications.cs b/src/Umbraco.Core/Constants-Applications.cs
index 415357aab3..2d4042fad0 100644
--- a/src/Umbraco.Core/Constants-Applications.cs
+++ b/src/Umbraco.Core/Constants-Applications.cs
@@ -156,7 +156,7 @@
public const string ThirdParty = "thirdPartyGroup";
}
- //TODO: Fill in the rest!
+ // TODO: Fill in the rest!
}
}
}
diff --git a/src/Umbraco.Core/Constants-PropertyEditors.cs b/src/Umbraco.Core/Constants-PropertyEditors.cs
index b9f20fb449..8b637fe90e 100644
--- a/src/Umbraco.Core/Constants-PropertyEditors.cs
+++ b/src/Umbraco.Core/Constants-PropertyEditors.cs
@@ -118,12 +118,7 @@ namespace Umbraco.Core
/// RadioButton list.
///
public const string RadioButtonList = "Umbraco.RadioButtonList";
-
- ///
- /// Related Links.
- ///
- public const string RelatedLinks = "Umbraco.RelatedLinks";
-
+
///
/// Slider.
///
diff --git a/src/Umbraco.Core/Configuration/Dashboard/AccessRule.cs b/src/Umbraco.Core/Dashboards/AccessRule.cs
similarity index 72%
rename from src/Umbraco.Core/Configuration/Dashboard/AccessRule.cs
rename to src/Umbraco.Core/Dashboards/AccessRule.cs
index fe6840ff64..4f725e32f0 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/AccessRule.cs
+++ b/src/Umbraco.Core/Dashboards/AccessRule.cs
@@ -1,9 +1,9 @@
-namespace Umbraco.Core.Configuration.Dashboard
+namespace Umbraco.Core.Dashboards
{
///
/// Implements .
///
- internal class AccessRule : IAccessRule
+ public class AccessRule : IAccessRule
{
///
public AccessRuleType Type { get; set; }
diff --git a/src/Umbraco.Core/Configuration/Dashboard/AccessRuleType.cs b/src/Umbraco.Core/Dashboards/AccessRuleType.cs
similarity index 93%
rename from src/Umbraco.Core/Configuration/Dashboard/AccessRuleType.cs
rename to src/Umbraco.Core/Dashboards/AccessRuleType.cs
index cb9ce983fe..efed361f6c 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/AccessRuleType.cs
+++ b/src/Umbraco.Core/Dashboards/AccessRuleType.cs
@@ -1,4 +1,4 @@
-namespace Umbraco.Core.Configuration.Dashboard
+namespace Umbraco.Core.Dashboards
{
///
/// Defines dashboard access rules type.
diff --git a/src/Umbraco.Core/Dashboards/DashboardSlim.cs b/src/Umbraco.Core/Dashboards/DashboardSlim.cs
new file mode 100644
index 0000000000..a2869a90a2
--- /dev/null
+++ b/src/Umbraco.Core/Dashboards/DashboardSlim.cs
@@ -0,0 +1,12 @@
+using System.Runtime.Serialization;
+
+namespace Umbraco.Core.Dashboards
+{
+ [DataContract(IsReference = true)]
+ public class DashboardSlim : IDashboardSlim
+ {
+ public string Alias { get; set; }
+
+ public string View { get; set; }
+ }
+}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/IAccessRule.cs b/src/Umbraco.Core/Dashboards/IAccessRule.cs
similarity index 80%
rename from src/Umbraco.Core/Configuration/Dashboard/IAccessRule.cs
rename to src/Umbraco.Core/Dashboards/IAccessRule.cs
index 8b51b1b73a..e3ac583379 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/IAccessRule.cs
+++ b/src/Umbraco.Core/Dashboards/IAccessRule.cs
@@ -1,4 +1,7 @@
-namespace Umbraco.Core.Configuration.Dashboard
+using Newtonsoft.Json;
+using Umbraco.Core.Manifest;
+
+namespace Umbraco.Core.Dashboards
{
///
/// Represents an access rule.
diff --git a/src/Umbraco.Core/Dashboards/IDashboard.cs b/src/Umbraco.Core/Dashboards/IDashboard.cs
new file mode 100644
index 0000000000..c990e2ba61
--- /dev/null
+++ b/src/Umbraco.Core/Dashboards/IDashboard.cs
@@ -0,0 +1,38 @@
+using System.Runtime.Serialization;
+using Umbraco.Core.Composing;
+
+namespace Umbraco.Core.Dashboards
+{
+ ///
+ /// Represents a dashboard.
+ ///
+ public interface IDashboard : IDashboardSlim, IDiscoverable
+ {
+ ///
+ /// Gets the aliases of sections/applications where this dashboard appears.
+ ///
+ ///
+ /// This field is *not* needed by the UI and therefore we want to exclude
+ /// it from serialization, but it is deserialized as part of the manifest,
+ /// therefore we cannot plainly ignore it.
+ /// So, it has to remain a data member, plus we use our special
+ /// JsonDontSerialize attribute (see attribute for more details).
+ ///
+ [DataMember(Name = "sections")]
+ string[] Sections { get; }
+
+
+ ///
+ /// Gets the access rule determining the visibility of the dashboard.
+ ///
+ ///
+ /// This field is *not* needed by the UI and therefore we want to exclude
+ /// it from serialization, but it is deserialized as part of the manifest,
+ /// therefore we cannot plainly ignore it.
+ /// So, it has to remain a data member, plus we use our special
+ /// JsonDontSerialize attribute (see attribute for more details).
+ ///
+ [DataMember(Name = "access")]
+ IAccessRule[] AccessRules { get; }
+ }
+}
diff --git a/src/Umbraco.Core/Dashboards/IDashboardSlim.cs b/src/Umbraco.Core/Dashboards/IDashboardSlim.cs
new file mode 100644
index 0000000000..655f56dfd9
--- /dev/null
+++ b/src/Umbraco.Core/Dashboards/IDashboardSlim.cs
@@ -0,0 +1,22 @@
+using System.Runtime.Serialization;
+
+namespace Umbraco.Core.Dashboards
+{
+ ///
+ /// Represents a dashboard with only minimal data.
+ ///
+ public interface IDashboardSlim
+ {
+ ///
+ /// Gets the alias of the dashboard.
+ ///
+ [DataMember(Name = "alias")]
+ string Alias { get; }
+
+ ///
+ /// Gets the view used to render the dashboard.
+ ///
+ [DataMember(Name = "view")]
+ string View { get; }
+ }
+}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Deploy/IDataTypeConfigurationConnector.cs b/src/Umbraco.Core/Deploy/IDataTypeConfigurationConnector.cs
index f2a08575b5..3a673e92a2 100644
--- a/src/Umbraco.Core/Deploy/IDataTypeConfigurationConnector.cs
+++ b/src/Umbraco.Core/Deploy/IDataTypeConfigurationConnector.cs
@@ -1,14 +1,15 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
+using Umbraco.Core.Models;
namespace Umbraco.Core.Deploy
{
///
- /// Defines methods that can convert a data type configurations to / from an environment-agnostic string.
+ /// Defines methods that can convert data type configuration to / from an environment-agnostic string.
///
- /// Configurations may contain values such as content identifiers, that would be local
+ /// Configuration may contain values such as content identifiers, that would be local
/// to one environment, and need to be converted in order to be deployed.
- [SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "This is actual only used by Deploy, but we dont want third parties to have references on deploy, thats why this interface is part of core.")]
+ [SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "This is actual only used by Deploy, but we don't want third parties to have references on deploy, that's why this interface is part of core.")]
public interface IDataTypeConfigurationConnector
{
///
@@ -17,18 +18,17 @@ namespace Umbraco.Core.Deploy
IEnumerable PropertyEditorAliases { get; }
///
- /// Gets the environment-agnostic data type configurations corresponding to environment-specific configurations.
+ /// Gets the artifact datatype configuration corresponding to the actual datatype configuration.
///
- /// The environment-specific configuration.
+ /// The datatype.
/// The dependencies.
- ///
- IDictionary ConvertToDeploy(IDictionary configuration, ICollection dependencies);
+ string ToArtifact(IDataType dataType, ICollection dependencies);
///
- /// Gets the environment-specific data type configurations corresponding to environment-agnostic configurations.
+ /// Gets the actual datatype configuration corresponding to the artifact configuration.
///
- /// The environment-agnostic configuration.
- ///
- IDictionary ConvertToLocalEnvironment(IDictionary configuration);
+ /// The datatype.
+ /// The artifact configuration.
+ object FromArtifact(IDataType dataType, string configuration);
}
}
diff --git a/src/Umbraco.Core/EmailSender.cs b/src/Umbraco.Core/EmailSender.cs
index 1f2c6d8653..0fda5c40a4 100644
--- a/src/Umbraco.Core/EmailSender.cs
+++ b/src/Umbraco.Core/EmailSender.cs
@@ -17,7 +17,7 @@ namespace Umbraco.Core
///
public class EmailSender : IEmailSender
{
- //TODO: This should encapsulate a BackgroundTaskRunner with a queue to send these emails!
+ // TODO: This should encapsulate a BackgroundTaskRunner with a queue to send these emails!
private readonly bool _enableEvents;
diff --git a/src/Umbraco.Core/EnumExtensions.cs b/src/Umbraco.Core/EnumExtensions.cs
new file mode 100644
index 0000000000..1443a27876
--- /dev/null
+++ b/src/Umbraco.Core/EnumExtensions.cs
@@ -0,0 +1,45 @@
+using System;
+
+namespace Umbraco.Core
+{
+ ///
+ /// Provides extension methods to enums.
+ ///
+ public static class EnumExtensions
+ {
+ // note:
+ // - no need to HasFlagExact, that's basically an == test
+ // - HasFlagAll cannot be named HasFlag because ext. methods never take priority over instance methods
+
+ ///
+ /// Determines whether a flag enum has all the specified values.
+ ///
+ ///
+ /// True when all bits set in are set in , though other bits may be set too.
+ /// This is the behavior of the original method.
+ ///
+ public static bool HasFlagAll(this T use, T uses)
+ where T : Enum
+ {
+ var num = Convert.ToUInt64(use);
+ var nums = Convert.ToUInt64(uses);
+
+ return (num & nums) == nums;
+ }
+
+ ///
+ /// Determines whether a flag enum has any of the specified values.
+ ///
+ ///
+ /// True when at least one of the bits set in is set in .
+ ///
+ public static bool HasFlagAny(this T use, T uses)
+ where T : Enum
+ {
+ var num = Convert.ToUInt64(use);
+ var nums = Convert.ToUInt64(uses);
+
+ return (num & nums) > 0;
+ }
+ }
+}
diff --git a/src/Umbraco.Core/Events/ImportPackageEventArgs.cs b/src/Umbraco.Core/Events/ImportPackageEventArgs.cs
index 61369af59d..a044cd71b3 100644
--- a/src/Umbraco.Core/Events/ImportPackageEventArgs.cs
+++ b/src/Umbraco.Core/Events/ImportPackageEventArgs.cs
@@ -27,7 +27,7 @@ namespace Umbraco.Core.Events
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
- //TODO: MetaData for package metadata has no equality operators :/
+ // TODO: MetaData for package metadata has no equality operators :/
return base.Equals(other) && PackageMetaData.Equals(other.PackageMetaData);
}
diff --git a/src/Umbraco.Core/Events/QueuingEventDispatcher.cs b/src/Umbraco.Core/Events/QueuingEventDispatcher.cs
index 164b452f2c..88b527e753 100644
--- a/src/Umbraco.Core/Events/QueuingEventDispatcher.cs
+++ b/src/Umbraco.Core/Events/QueuingEventDispatcher.cs
@@ -34,7 +34,7 @@ namespace Umbraco.Core.Events
private IMediaFileSystem _mediaFileSystem;
- // todo: inject
+ // TODO: inject
private IMediaFileSystem MediaFileSystem => _mediaFileSystem ?? (_mediaFileSystem = Current.MediaFileSystem);
}
}
diff --git a/src/Umbraco.Core/IO/FileSystemExtensions.cs b/src/Umbraco.Core/IO/FileSystemExtensions.cs
index ade2c58b38..e0f5af75c5 100644
--- a/src/Umbraco.Core/IO/FileSystemExtensions.cs
+++ b/src/Umbraco.Core/IO/FileSystemExtensions.cs
@@ -54,7 +54,7 @@ namespace Umbraco.Core.IO
return Path.GetFileName(fs.GetFullPath(path));
}
- //TODO: Currently this is the only way to do this
+ // TODO: Currently this is the only way to do this
internal static void CreateFolder(this IFileSystem fs, string folderPath)
{
var path = fs.GetRelativePath(folderPath);
diff --git a/src/Umbraco.Core/IO/FileSystems.cs b/src/Umbraco.Core/IO/FileSystems.cs
index 38cb7df824..19d29e14ba 100644
--- a/src/Umbraco.Core/IO/FileSystems.cs
+++ b/src/Umbraco.Core/IO/FileSystems.cs
@@ -132,7 +132,7 @@ namespace Umbraco.Core.IO
_scriptsFileSystem = new ShadowWrapper(scriptsFileSystem, "scripts", IsScoped);
_mvcViewsFileSystem = new ShadowWrapper(mvcViewsFileSystem, "Views", IsScoped);
- // todo - do we need a lock here?
+ // TODO: do we need a lock here?
_shadowWrappers.Add(_macroPartialFileSystem);
_shadowWrappers.Add(_partialViewsFileSystem);
_shadowWrappers.Add(_stylesheetsFileSystem);
diff --git a/src/Umbraco.Core/IO/IOHelper.cs b/src/Umbraco.Core/IO/IOHelper.cs
index 76e7631482..a92b556240 100644
--- a/src/Umbraco.Core/IO/IOHelper.cs
+++ b/src/Umbraco.Core/IO/IOHelper.cs
@@ -155,8 +155,7 @@ namespace Umbraco.Core.IO
//
// except that for templates, filePath actually is a virtual path
- //TODO
- // what's below is dirty, there are too many ways to get the root dir, etc.
+ // TODO: what's below is dirty, there are too many ways to get the root dir, etc.
// not going to fix everything today
var mappedRoot = MapPath(SystemDirectories.Root);
diff --git a/src/Umbraco.Core/IO/PhysicalFileSystem.cs b/src/Umbraco.Core/IO/PhysicalFileSystem.cs
index 80f4c57ee3..66ef095b04 100644
--- a/src/Umbraco.Core/IO/PhysicalFileSystem.cs
+++ b/src/Umbraco.Core/IO/PhysicalFileSystem.cs
@@ -153,7 +153,7 @@ namespace Umbraco.Core.IO
if (directory == null) throw new InvalidOperationException("Could not get directory.");
Directory.CreateDirectory(directory); // ensure it exists
- if (stream.CanSeek) // todo - what if we cannot?
+ if (stream.CanSeek) // TODO: what if we cannot?
stream.Seek(0, 0);
using (var destination = (Stream) File.Create(fullPath))
@@ -284,7 +284,7 @@ namespace Umbraco.Core.IO
var opath = path;
path = EnsureDirectorySeparatorChar(path);
- // fixme - this part should go!
+ // FIXME: this part should go!
// not sure what we are doing here - so if input starts with a (back) slash,
// we assume it's not a FS relative path and we try to convert it... but it
// really makes little sense?
diff --git a/src/Umbraco.Core/IO/SystemDirectories.cs b/src/Umbraco.Core/IO/SystemDirectories.cs
index 5bbf325c8c..100dbc265e 100644
--- a/src/Umbraco.Core/IO/SystemDirectories.cs
+++ b/src/Umbraco.Core/IO/SystemDirectories.cs
@@ -39,9 +39,6 @@ namespace Umbraco.Core.IO
[Obsolete("Usercontrols are obsolete and code should be removed")]
public static string UserControls => "~/usercontrols";
- [Obsolete("Only used by legacy load balancing which is obsolete and should be removed")]
- public static string WebServices => IOHelper.ReturnPath("umbracoWebservicesPath", Umbraco.EnsureEndsWith("/") + "webservices");
-
public static string Packages => Data + "/packages";
public static string Preview => Data + "/preview";
diff --git a/src/Umbraco.Core/Logging/Viewer/LogViewerComposer.cs b/src/Umbraco.Core/Logging/Viewer/LogViewerComposer.cs
index f3d1b5137f..5ddcb01078 100644
--- a/src/Umbraco.Core/Logging/Viewer/LogViewerComposer.cs
+++ b/src/Umbraco.Core/Logging/Viewer/LogViewerComposer.cs
@@ -8,7 +8,7 @@ namespace Umbraco.Core.Logging.Viewer
{
public void Compose(Composition composition)
{
- composition.RegisterUnique(_ => new JsonLogViewer());
+ composition.SetLogViewer(_ => new JsonLogViewer());
}
}
}
diff --git a/src/Umbraco.Core/Manifest/DashboardAccessRuleConverter.cs b/src/Umbraco.Core/Manifest/DashboardAccessRuleConverter.cs
index c627728a32..67c5a5824e 100644
--- a/src/Umbraco.Core/Manifest/DashboardAccessRuleConverter.cs
+++ b/src/Umbraco.Core/Manifest/DashboardAccessRuleConverter.cs
@@ -1,7 +1,7 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
-using Umbraco.Core.Configuration.Dashboard;
+using Umbraco.Core.Dashboards;
using Umbraco.Core.Serialization;
namespace Umbraco.Core.Manifest
diff --git a/src/Umbraco.Core/Manifest/ManifestContentAppDefinition.cs b/src/Umbraco.Core/Manifest/ManifestContentAppDefinition.cs
index 0667f11aab..af66bfc544 100644
--- a/src/Umbraco.Core/Manifest/ManifestContentAppDefinition.cs
+++ b/src/Umbraco.Core/Manifest/ManifestContentAppDefinition.cs
@@ -1,12 +1,6 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
using System.Runtime.Serialization;
-using System.Text.RegularExpressions;
using Umbraco.Core.IO;
-using Umbraco.Core.Models;
-using Umbraco.Core.Models.ContentEditing;
-using Umbraco.Core.Models.Membership;
namespace Umbraco.Core.Manifest
{
@@ -30,6 +24,7 @@ namespace Umbraco.Core.Manifest
///
/// Represents a content app definition, parsed from a manifest.
///
+ /// Is used to create an actual .
[DataContract(Name = "appdef", Namespace = "")]
public class ManifestContentAppDefinition
{
diff --git a/src/Umbraco.Core/Manifest/ManifestDashboardDefinition.cs b/src/Umbraco.Core/Manifest/ManifestDashboard.cs
similarity index 79%
rename from src/Umbraco.Core/Manifest/ManifestDashboardDefinition.cs
rename to src/Umbraco.Core/Manifest/ManifestDashboard.cs
index 83f047b264..e790655221 100644
--- a/src/Umbraco.Core/Manifest/ManifestDashboardDefinition.cs
+++ b/src/Umbraco.Core/Manifest/ManifestDashboard.cs
@@ -1,23 +1,20 @@
using System;
using System.ComponentModel;
using Newtonsoft.Json;
-using Umbraco.Core.Configuration.Dashboard;
+using Umbraco.Core.Dashboards;
using Umbraco.Core.IO;
namespace Umbraco.Core.Manifest
{
- public class ManifestDashboardDefinition
+ public class ManifestDashboard : IDashboard
{
private string _view;
- [JsonProperty("name", Required = Required.Always)]
- public string Name { get; set; }
-
[JsonProperty("alias", Required = Required.Always)]
public string Alias { get; set; }
[JsonProperty("weight", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
- [DefaultValue(100)]
+ [DefaultValue(100)] // must be equal to DashboardCollectionBuilder.DefaultWeight
public int Weight { get; set; }
[JsonProperty("view", Required = Required.Always)]
diff --git a/src/Umbraco.Core/Manifest/ManifestParser.cs b/src/Umbraco.Core/Manifest/ManifestParser.cs
index 01bc0b1983..6ca3b916ea 100644
--- a/src/Umbraco.Core/Manifest/ManifestParser.cs
+++ b/src/Umbraco.Core/Manifest/ManifestParser.cs
@@ -1,184 +1,182 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-using Newtonsoft.Json;
-using Umbraco.Core.Cache;
-using Umbraco.Core.Exceptions;
-using Umbraco.Core.IO;
-using Umbraco.Core.Logging;
-using Umbraco.Core.Models.ContentEditing;
-using Umbraco.Core.Models.Trees;
-using Umbraco.Core.PropertyEditors;
-
-namespace Umbraco.Core.Manifest
-{
- ///
- /// Parses the Main.js file and replaces all tokens accordingly.
- ///
- public class ManifestParser
- {
- private static readonly string Utf8Preamble = Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble());
-
- private readonly IAppPolicyCache _cache;
- private readonly ILogger _logger;
- private readonly ManifestValueValidatorCollection _validators;
-
- private string _path;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public ManifestParser(AppCaches appCaches, ManifestValueValidatorCollection validators, ILogger logger)
- : this(appCaches, validators, "~/App_Plugins", logger)
- { }
-
- ///
- /// Initializes a new instance of the class.
- ///
- private ManifestParser(AppCaches appCaches, ManifestValueValidatorCollection validators, string path, ILogger logger)
- {
- if (appCaches == null) throw new ArgumentNullException(nameof(appCaches));
- _cache = appCaches.RuntimeCache;
- _validators = validators ?? throw new ArgumentNullException(nameof(validators));
- if (string.IsNullOrWhiteSpace(path)) throw new ArgumentNullOrEmptyException(nameof(path));
- Path = path;
- _logger = logger ?? throw new ArgumentNullException(nameof(logger));
- }
-
- public string Path
- {
- get => _path;
- set => _path = value.StartsWith("~/") ? IOHelper.MapPath(value) : value;
- }
-
- ///
- /// Gets all manifests, merged into a single manifest object.
- ///
- ///
- public PackageManifest Manifest
- => _cache.GetCacheItem("Umbraco.Core.Manifest.ManifestParser::Manifests", () =>
- {
- var manifests = GetManifests();
- return MergeManifests(manifests);
- }, new TimeSpan(0, 4, 0));
-
- ///
- /// Gets all manifests.
- ///
- private IEnumerable GetManifests()
- {
- var manifests = new List();
-
- foreach (var path in GetManifestFiles())
- {
- try
- {
- var text = File.ReadAllText(path);
- text = TrimPreamble(text);
- if (string.IsNullOrWhiteSpace(text))
- continue;
- var manifest = ParseManifest(text);
- manifests.Add(manifest);
- }
- catch (Exception e)
- {
- _logger.Error(e, "Failed to parse manifest at '{Path}', ignoring.", path);
- }
- }
-
- return manifests;
- }
-
- ///
- /// Merges all manifests into one.
- ///
- private static PackageManifest MergeManifests(IEnumerable manifests)
- {
- var scripts = new HashSet();
- var stylesheets = new HashSet();
- var propertyEditors = new List();
- var parameterEditors = new List();
- var gridEditors = new List();
- var contentApps = new List();
- var dashboards = new List();
- var sections = new List();
-
- foreach (var manifest in manifests)
- {
- if (manifest.Scripts != null) foreach (var script in manifest.Scripts) scripts.Add(script);
- if (manifest.Stylesheets != null) foreach (var stylesheet in manifest.Stylesheets) stylesheets.Add(stylesheet);
- if (manifest.PropertyEditors != null) propertyEditors.AddRange(manifest.PropertyEditors);
- if (manifest.ParameterEditors != null) parameterEditors.AddRange(manifest.ParameterEditors);
- if (manifest.GridEditors != null) gridEditors.AddRange(manifest.GridEditors);
- if (manifest.ContentApps != null) contentApps.AddRange(manifest.ContentApps);
- if (manifest.Dashboards != null) dashboards.AddRange(manifest.Dashboards);
- if (manifest.Sections != null) sections.AddRange(manifest.Sections.DistinctBy(x => x.Alias.ToLowerInvariant()));
- }
-
- return new PackageManifest
- {
- Scripts = scripts.ToArray(),
- Stylesheets = stylesheets.ToArray(),
- PropertyEditors = propertyEditors.ToArray(),
- ParameterEditors = parameterEditors.ToArray(),
- GridEditors = gridEditors.ToArray(),
- ContentApps = contentApps.ToArray(),
- Dashboards = dashboards.ToArray(),
- Sections = sections.ToArray()
- };
- }
-
- // gets all manifest files (recursively)
- private IEnumerable GetManifestFiles()
- {
- if (Directory.Exists(_path) == false)
- return new string[0];
- return Directory.GetFiles(_path, "package.manifest", SearchOption.AllDirectories);
- }
-
- private static string TrimPreamble(string text)
- {
- // strangely StartsWith(preamble) would always return true
- if (text.Substring(0, 1) == Utf8Preamble)
- text = text.Remove(0, Utf8Preamble.Length);
-
- return text;
- }
-
- ///
- /// Parses a manifest.
- ///
- internal PackageManifest ParseManifest(string text)
- {
- if (string.IsNullOrWhiteSpace(text))
- throw new ArgumentNullOrEmptyException(nameof(text));
-
- var manifest = JsonConvert.DeserializeObject(text,
- new DataEditorConverter(_logger),
- new ValueValidatorConverter(_validators),
- new DashboardAccessRuleConverter());
-
- // scripts and stylesheets are raw string, must process here
- for (var i = 0; i < manifest.Scripts.Length; i++)
- manifest.Scripts[i] = IOHelper.ResolveVirtualUrl(manifest.Scripts[i]);
- for (var i = 0; i < manifest.Stylesheets.Length; i++)
- manifest.Stylesheets[i] = IOHelper.ResolveVirtualUrl(manifest.Stylesheets[i]);
-
- // add property editors that are also parameter editors, to the parameter editors list
- // (the manifest format is kinda legacy)
- var ppEditors = manifest.PropertyEditors.Where(x => (x.Type & EditorType.MacroParameter) > 0).ToList();
- if (ppEditors.Count > 0)
- manifest.ParameterEditors = manifest.ParameterEditors.Union(ppEditors).ToArray();
-
- return manifest;
- }
-
- // purely for tests
- internal IEnumerable ParseGridEditors(string text)
- {
- return JsonConvert.DeserializeObject>(text);
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using Newtonsoft.Json;
+using Umbraco.Core.Cache;
+using Umbraco.Core.Exceptions;
+using Umbraco.Core.IO;
+using Umbraco.Core.Logging;
+using Umbraco.Core.PropertyEditors;
+
+namespace Umbraco.Core.Manifest
+{
+ ///
+ /// Parses the Main.js file and replaces all tokens accordingly.
+ ///
+ public class ManifestParser
+ {
+ private static readonly string Utf8Preamble = Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble());
+
+ private readonly IAppPolicyCache _cache;
+ private readonly ILogger _logger;
+ private readonly ManifestValueValidatorCollection _validators;
+
+ private string _path;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public ManifestParser(AppCaches appCaches, ManifestValueValidatorCollection validators, ILogger logger)
+ : this(appCaches, validators, "~/App_Plugins", logger)
+ { }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ private ManifestParser(AppCaches appCaches, ManifestValueValidatorCollection validators, string path, ILogger logger)
+ {
+ if (appCaches == null) throw new ArgumentNullException(nameof(appCaches));
+ _cache = appCaches.RuntimeCache;
+ _validators = validators ?? throw new ArgumentNullException(nameof(validators));
+ if (string.IsNullOrWhiteSpace(path)) throw new ArgumentNullOrEmptyException(nameof(path));
+ Path = path;
+ _logger = logger ?? throw new ArgumentNullException(nameof(logger));
+ }
+
+ public string Path
+ {
+ get => _path;
+ set => _path = value.StartsWith("~/") ? IOHelper.MapPath(value) : value;
+ }
+
+ ///
+ /// Gets all manifests, merged into a single manifest object.
+ ///
+ ///
+ public PackageManifest Manifest
+ => _cache.GetCacheItem("Umbraco.Core.Manifest.ManifestParser::Manifests", () =>
+ {
+ var manifests = GetManifests();
+ return MergeManifests(manifests);
+ }, new TimeSpan(0, 4, 0));
+
+ ///
+ /// Gets all manifests.
+ ///
+ private IEnumerable GetManifests()
+ {
+ var manifests = new List();
+
+ foreach (var path in GetManifestFiles())
+ {
+ try
+ {
+ var text = File.ReadAllText(path);
+ text = TrimPreamble(text);
+ if (string.IsNullOrWhiteSpace(text))
+ continue;
+ var manifest = ParseManifest(text);
+ manifests.Add(manifest);
+ }
+ catch (Exception e)
+ {
+ _logger.Error(e, "Failed to parse manifest at '{Path}', ignoring.", path);
+ }
+ }
+
+ return manifests;
+ }
+
+ ///
+ /// Merges all manifests into one.
+ ///
+ private static PackageManifest MergeManifests(IEnumerable manifests)
+ {
+ var scripts = new HashSet();
+ var stylesheets = new HashSet();
+ var propertyEditors = new List();
+ var parameterEditors = new List();
+ var gridEditors = new List();
+ var contentApps = new List();
+ var dashboards = new List();
+ var sections = new List();
+
+ foreach (var manifest in manifests)
+ {
+ if (manifest.Scripts != null) foreach (var script in manifest.Scripts) scripts.Add(script);
+ if (manifest.Stylesheets != null) foreach (var stylesheet in manifest.Stylesheets) stylesheets.Add(stylesheet);
+ if (manifest.PropertyEditors != null) propertyEditors.AddRange(manifest.PropertyEditors);
+ if (manifest.ParameterEditors != null) parameterEditors.AddRange(manifest.ParameterEditors);
+ if (manifest.GridEditors != null) gridEditors.AddRange(manifest.GridEditors);
+ if (manifest.ContentApps != null) contentApps.AddRange(manifest.ContentApps);
+ if (manifest.Dashboards != null) dashboards.AddRange(manifest.Dashboards);
+ if (manifest.Sections != null) sections.AddRange(manifest.Sections.DistinctBy(x => x.Alias.ToLowerInvariant()));
+ }
+
+ return new PackageManifest
+ {
+ Scripts = scripts.ToArray(),
+ Stylesheets = stylesheets.ToArray(),
+ PropertyEditors = propertyEditors.ToArray(),
+ ParameterEditors = parameterEditors.ToArray(),
+ GridEditors = gridEditors.ToArray(),
+ ContentApps = contentApps.ToArray(),
+ Dashboards = dashboards.ToArray(),
+ Sections = sections.ToArray()
+ };
+ }
+
+ // gets all manifest files (recursively)
+ private IEnumerable GetManifestFiles()
+ {
+ if (Directory.Exists(_path) == false)
+ return new string[0];
+ return Directory.GetFiles(_path, "package.manifest", SearchOption.AllDirectories);
+ }
+
+ private static string TrimPreamble(string text)
+ {
+ // strangely StartsWith(preamble) would always return true
+ if (text.Substring(0, 1) == Utf8Preamble)
+ text = text.Remove(0, Utf8Preamble.Length);
+
+ return text;
+ }
+
+ ///
+ /// Parses a manifest.
+ ///
+ internal PackageManifest ParseManifest(string text)
+ {
+ if (string.IsNullOrWhiteSpace(text))
+ throw new ArgumentNullOrEmptyException(nameof(text));
+
+ var manifest = JsonConvert.DeserializeObject(text,
+ new DataEditorConverter(_logger),
+ new ValueValidatorConverter(_validators),
+ new DashboardAccessRuleConverter());
+
+ // scripts and stylesheets are raw string, must process here
+ for (var i = 0; i < manifest.Scripts.Length; i++)
+ manifest.Scripts[i] = IOHelper.ResolveVirtualUrl(manifest.Scripts[i]);
+ for (var i = 0; i < manifest.Stylesheets.Length; i++)
+ manifest.Stylesheets[i] = IOHelper.ResolveVirtualUrl(manifest.Stylesheets[i]);
+
+ // add property editors that are also parameter editors, to the parameter editors list
+ // (the manifest format is kinda legacy)
+ var ppEditors = manifest.PropertyEditors.Where(x => (x.Type & EditorType.MacroParameter) > 0).ToList();
+ if (ppEditors.Count > 0)
+ manifest.ParameterEditors = manifest.ParameterEditors.Union(ppEditors).ToArray();
+
+ return manifest;
+ }
+
+ // purely for tests
+ internal IEnumerable ParseGridEditors(string text)
+ {
+ return JsonConvert.DeserializeObject>(text);
+ }
+ }
+}
diff --git a/src/Umbraco.Core/Manifest/PackageManifest.cs b/src/Umbraco.Core/Manifest/PackageManifest.cs
index b29a28ab06..c272449509 100644
--- a/src/Umbraco.Core/Manifest/PackageManifest.cs
+++ b/src/Umbraco.Core/Manifest/PackageManifest.cs
@@ -49,7 +49,7 @@ namespace Umbraco.Core.Manifest
/// Gets or sets the dashboards listed in the manifest.
///
[JsonProperty("dashboards")]
- public ManifestDashboardDefinition[] Dashboards { get; set; } = Array.Empty();
+ public ManifestDashboard[] Dashboards { get; set; } = Array.Empty();
///
/// Gets or sets the sections listed in the manifest.
diff --git a/src/Umbraco.Core/Media/Result.cs b/src/Umbraco.Core/Media/Result.cs
index 82894a5ef5..a8683d03d5 100644
--- a/src/Umbraco.Core/Media/Result.cs
+++ b/src/Umbraco.Core/Media/Result.cs
@@ -1,7 +1,7 @@
namespace Umbraco.Core.Media
{
- //TODO: Could definitely have done with a better name
+ // TODO: Could definitely have done with a better name
public class Result
{
public Status Status { get; set; }
diff --git a/src/Umbraco.Core/Migrations/IMigrationExpression.cs b/src/Umbraco.Core/Migrations/IMigrationExpression.cs
index 81063bd2da..c60126f63c 100644
--- a/src/Umbraco.Core/Migrations/IMigrationExpression.cs
+++ b/src/Umbraco.Core/Migrations/IMigrationExpression.cs
@@ -5,7 +5,7 @@
///
public interface IMigrationExpression
{
- string Process(IMigrationContext context); // todo: remove that one?
+ string Process(IMigrationContext context); // TODO: remove that one?
void Execute();
}
}
diff --git a/src/Umbraco.Core/Migrations/Install/DatabaseBuilder.cs b/src/Umbraco.Core/Migrations/Install/DatabaseBuilder.cs
index e73fc7453f..9c6ff208f8 100644
--- a/src/Umbraco.Core/Migrations/Install/DatabaseBuilder.cs
+++ b/src/Umbraco.Core/Migrations/Install/DatabaseBuilder.cs
@@ -284,7 +284,7 @@ namespace Umbraco.Core.Migrations.Install
if (string.IsNullOrWhiteSpace(providerName)) throw new ArgumentNullOrEmptyException(nameof(providerName));
var fileSource = "web.config";
- var fileName = IOHelper.MapPath(Path.Combine(SystemDirectories.Root, fileSource));
+ var fileName = IOHelper.MapPath(SystemDirectories.Root +"/" + fileSource);
var xml = XDocument.Load(fileName, LoadOptions.PreserveWhitespace);
if (xml.Root == null) throw new Exception($"Invalid {fileSource} file (no root).");
@@ -297,7 +297,7 @@ namespace Umbraco.Core.Migrations.Install
if (configSourceAttribute != null)
{
fileSource = configSourceAttribute.Value;
- fileName = IOHelper.MapPath(Path.Combine(SystemDirectories.Root, fileSource));
+ fileName = IOHelper.MapPath(SystemDirectories.Root + "/" + fileSource);
if (!File.Exists(fileName))
throw new Exception($"Invalid configSource \"{fileSource}\" (no such file).");
diff --git a/src/Umbraco.Core/Migrations/Install/DatabaseDataCreator.cs b/src/Umbraco.Core/Migrations/Install/DatabaseDataCreator.cs
index f32ea1cb6f..7e9df321c3 100644
--- a/src/Umbraco.Core/Migrations/Install/DatabaseDataCreator.cs
+++ b/src/Umbraco.Core/Migrations/Install/DatabaseDataCreator.cs
@@ -135,7 +135,7 @@ namespace Umbraco.Core.Migrations.Install
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1047, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1047", SortOrder = 2, UniqueId = new Guid("1EA2E01F-EBD8-4CE1-8D71-6B1149E63548"), Text = "Member Picker", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1048, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1048", SortOrder = 2, UniqueId = new Guid("135D60E0-64D9-49ED-AB08-893C9BA44AE5"), Text = "Media Picker", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1049, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1049", SortOrder = 2, UniqueId = new Guid("9DBBCBBB-2327-434A-B355-AF1B84E5010A"), Text = "Multiple Media Picker", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
- _database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1050, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1050", SortOrder = 2, UniqueId = new Guid("B4E3535A-1753-47E2-8568-602CF8CFEE6F"), Text = "Related Links", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
+ _database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1050, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1050", SortOrder = 2, UniqueId = new Guid("B4E3535A-1753-47E2-8568-602CF8CFEE6F"), Text = "Multi URL Picker", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
}
private void CreateLockData()
@@ -263,7 +263,7 @@ namespace Umbraco.Core.Migrations.Install
const string listLayout = "{\"name\": \"List\",\"path\": \"views/propertyeditors/listview/layouts/list/list.html\",\"icon\": \"icon-list\", \"isSystem\": 1,\"selected\": true}";
const string layouts = "[" + cardLayout + "," + listLayout + "]";
- //TODO Check which of the DataTypeIds below doesn't exist in umbracoNode, which results in a foreign key constraint errors.
+ // TODO: Check which of the DataTypeIds below doesn't exist in umbracoNode, which results in a foreign key constraint errors.
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -49, EditorAlias = Constants.PropertyEditors.Aliases.Boolean, DbType = "Integer" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -51, EditorAlias = Constants.PropertyEditors.Aliases.Integer, DbType = "Integer" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -87, EditorAlias = Constants.PropertyEditors.Aliases.TinyMce, DbType = "Ntext",
@@ -301,7 +301,7 @@ namespace Umbraco.Core.Migrations.Install
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1048, EditorAlias = Constants.PropertyEditors.Aliases.MediaPicker, DbType = "Ntext" });
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1049, EditorAlias = Constants.PropertyEditors.Aliases.MediaPicker, DbType = "Ntext",
Configuration = "{\"multiPicker\":1}" });
- _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1050, EditorAlias = Constants.PropertyEditors.Aliases.RelatedLinks, DbType = "Ntext" });
+ _database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1050, EditorAlias = Constants.PropertyEditors.Aliases.MultiUrlPicker, DbType = "Ntext" });
}
private void CreateRelationTypeData()
diff --git a/src/Umbraco.Core/Migrations/Install/DatabaseSchemaResult.cs b/src/Umbraco.Core/Migrations/Install/DatabaseSchemaResult.cs
index d3f6937834..f21216fde3 100644
--- a/src/Umbraco.Core/Migrations/Install/DatabaseSchemaResult.cs
+++ b/src/Umbraco.Core/Migrations/Install/DatabaseSchemaResult.cs
@@ -27,7 +27,7 @@ namespace Umbraco.Core.Migrations.Install
public List TableDefinitions { get; }
- // todo what are these exactly? TableDefinitions are those that should be there, IndexDefinitions are those that... are in DB?
+ // TODO: what are these exactly? TableDefinitions are those that should be there, IndexDefinitions are those that... are in DB?
internal List IndexDefinitions { get; }
public List ValidTables { get; }
diff --git a/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs b/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs
index 833955ee6a..9bf58c8d2f 100644
--- a/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs
+++ b/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs
@@ -124,6 +124,8 @@ namespace Umbraco.Core.Migrations.Upgrade
To("{64EBCE53-E1F0-463A-B40B-E98EFCCA8AE2}");
To("{0009109C-A0B8-4F3F-8FEB-C137BBDDA268}");
To("{8A027815-D5CD-4872-8B88-9A51AB5986A6}"); // from 7.14.0
+ To("{ED28B66A-E248-4D94-8CDB-9BDF574023F0}");
+ To("{38C809D5-6C34-426B-9BEA-EFD39162595C}");
//FINAL
diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/ConvertRelatedLinksToMultiUrlPicker.cs b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/ConvertRelatedLinksToMultiUrlPicker.cs
new file mode 100644
index 0000000000..ed1c08f0f8
--- /dev/null
+++ b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/ConvertRelatedLinksToMultiUrlPicker.cs
@@ -0,0 +1,139 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Umbraco.Core.Logging;
+using Umbraco.Core.Models.PublishedContent;
+using Umbraco.Core.Persistence;
+using Umbraco.Core.Persistence.Dtos;
+
+namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
+{
+ public class ConvertRelatedLinksToMultiUrlPicker : MigrationBase
+ {
+ public ConvertRelatedLinksToMultiUrlPicker(IMigrationContext context) : base(context)
+ { }
+
+ public override void Migrate()
+ {
+ var sqlDataTypes = Sql()
+ .Select()
+ .From()
+ .Where(x => x.EditorAlias == "Umbraco.RelatedLinks"
+ || x.EditorAlias == "Umbraco.RelatedLinks2");
+
+ var dataTypes = Database.Fetch(sqlDataTypes);
+ var dataTypeIds = dataTypes.Select(x => x.NodeId).ToList();
+
+ if (dataTypeIds.Count == 0) return;
+
+ foreach (var dataType in dataTypes)
+ {
+ dataType.EditorAlias = Constants.PropertyEditors.Aliases.MultiUrlPicker;
+ Database.Update(dataType);
+ }
+
+ var sqlPropertyTpes = Sql()
+ .Select()
+ .From()
+ .Where(x => dataTypeIds.Contains(x.DataTypeId));
+
+ var propertyTypeIds = Database.Fetch(sqlPropertyTpes).Select(x => x.Id).ToList();
+
+ if (propertyTypeIds.Count == 0) return;
+
+ var sqlPropertyData = Sql()
+ .Select()
+ .From()
+ .Where(x => propertyTypeIds.Contains(x.PropertyTypeId));
+
+ var properties = Database.Fetch(sqlPropertyData);
+
+ // Create a Multi URL Picker datatype for the converted RelatedLinks data
+
+ foreach (var property in properties)
+ {
+ var value = property.Value.ToString();
+ if (string.IsNullOrWhiteSpace(value))
+ continue;
+
+ var relatedLinks = JsonConvert.DeserializeObject>(value);
+ var links = new List();
+ foreach (var relatedLink in relatedLinks)
+ {
+ GuidUdi udi = null;
+ if (relatedLink.IsInternal)
+ {
+ var linkIsUdi = GuidUdi.TryParse(relatedLink.Link, out udi);
+ if (linkIsUdi == false)
+ {
+ // oh no.. probably an integer, yikes!
+ if (int.TryParse(relatedLink.Link, out var intId))
+ {
+ var sqlNodeData = Sql()
+ .Select()
+ .Where(x => x.NodeId == intId);
+
+ var node = Database.Fetch(sqlNodeData).FirstOrDefault();
+ if (node != null)
+ // Note: RelatedLinks did not allow for picking media items,
+ // so if there's a value this will be a content item - hence
+ // the hardcoded "document" here
+ udi = new GuidUdi("document", node.UniqueId);
+ }
+ }
+ }
+
+ var link = new LinkDto
+ {
+ Name = relatedLink.Caption,
+ Target = relatedLink.NewWindow ? "_blank" : null,
+ Udi = udi,
+ // Should only have a URL if it's an external link otherwise it wil be a UDI
+ Url = relatedLink.IsInternal == false ? relatedLink.Link : null
+ };
+
+ links.Add(link);
+ }
+
+ var json = JsonConvert.SerializeObject(links);
+
+ // Update existing data
+ property.TextValue = json;
+ Database.Update(property);
+ }
+
+
+ }
+ }
+
+ internal class RelatedLink
+ {
+ public int? Id { get; internal set; }
+ internal bool IsDeleted { get; set; }
+ [JsonProperty("caption")]
+ public string Caption { get; set; }
+ [JsonProperty("link")]
+ public string Link { get; set; }
+ [JsonProperty("newWindow")]
+ public bool NewWindow { get; set; }
+ [JsonProperty("isInternal")]
+ public bool IsInternal { get; set; }
+ }
+
+ [DataContract]
+ internal class LinkDto
+ {
+ [DataMember(Name = "name")]
+ public string Name { get; set; }
+
+ [DataMember(Name = "target")]
+ public string Target { get; set; }
+
+ [DataMember(Name = "udi")]
+ public GuidUdi Udi { get; set; }
+
+ [DataMember(Name = "url")]
+ public string Url { get; set; }
+ }
+}
diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/PropertyEditorsMigration.cs b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/PropertyEditorsMigration.cs
index ee439088be..064ffc7228 100644
--- a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/PropertyEditorsMigration.cs
+++ b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/PropertyEditorsMigration.cs
@@ -16,7 +16,6 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
RenameDataType(Constants.PropertyEditors.Aliases.MediaPicker + "2", Constants.PropertyEditors.Aliases.MediaPicker);
RenameDataType(Constants.PropertyEditors.Aliases.MemberPicker + "2", Constants.PropertyEditors.Aliases.MemberPicker);
RenameDataType(Constants.PropertyEditors.Aliases.MultiNodeTreePicker + "2", Constants.PropertyEditors.Aliases.MultiNodeTreePicker);
- RenameDataType(Constants.PropertyEditors.Aliases.RelatedLinks + "2", Constants.PropertyEditors.Aliases.RelatedLinks);
RenameDataType("Umbraco.TextboxMultiple", Constants.PropertyEditors.Aliases.TextArea, false);
RenameDataType("Umbraco.Textbox", Constants.PropertyEditors.Aliases.TextBox, false);
}
diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/UpdatePickerIntegerValuesToUdi.cs b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/UpdatePickerIntegerValuesToUdi.cs
new file mode 100644
index 0000000000..2e37c79632
--- /dev/null
+++ b/src/Umbraco.Core/Migrations/Upgrade/V_8_0_0/UpdatePickerIntegerValuesToUdi.cs
@@ -0,0 +1,108 @@
+using System;
+using System.Linq;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using Umbraco.Core.Persistence;
+using Umbraco.Core.Persistence.Dtos;
+
+namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
+{
+ public class UpdatePickerIntegerValuesToUdi : MigrationBase
+ {
+ public UpdatePickerIntegerValuesToUdi(IMigrationContext context) : base(context)
+ { }
+
+ public override void Migrate()
+ {
+ var sqlDataTypes = Sql()
+ .Select()
+ .From()
+ .Where(x => x.EditorAlias == Constants.PropertyEditors.Aliases.ContentPicker
+ || x.EditorAlias == Constants.PropertyEditors.Aliases.MediaPicker
+ || x.EditorAlias == Constants.PropertyEditors.Aliases.MultiNodeTreePicker);
+
+ var dataTypes = Database.Fetch(sqlDataTypes).ToList();
+
+ foreach (var datatype in dataTypes.Where(x => !x.Configuration.IsNullOrWhiteSpace()))
+ {
+ switch (datatype.EditorAlias)
+ {
+ case Constants.PropertyEditors.Aliases.ContentPicker:
+ case Constants.PropertyEditors.Aliases.MediaPicker:
+ {
+ var config = JsonConvert.DeserializeObject(datatype.Configuration);
+ var startNodeId = config.Value("startNodeId");
+ if (!startNodeId.IsNullOrWhiteSpace() && int.TryParse(startNodeId, out var intStartNode))
+ {
+ var guid = intStartNode <= 0
+ ? null
+ : Context.Database.ExecuteScalar(
+ Sql().Select(x => x.UniqueId).From().Where(x => x.NodeId == intStartNode));
+ if (guid.HasValue)
+ {
+ var udi = new GuidUdi(datatype.EditorAlias == Constants.PropertyEditors.Aliases.MediaPicker
+ ? Constants.UdiEntityType.Media
+ : Constants.UdiEntityType.Document, guid.Value);
+ config["startNodeId"] = new JValue(udi.ToString());
+ }
+ else
+ config.Remove("startNodeId");
+
+ datatype.Configuration = JsonConvert.SerializeObject(config);
+ Database.Update(datatype);
+ }
+
+ break;
+ }
+ case Constants.PropertyEditors.Aliases.MultiNodeTreePicker:
+ {
+ var config = JsonConvert.DeserializeObject(datatype.Configuration);
+ var startNodeConfig = config.Value("startNode");
+ if (startNodeConfig != null)
+ {
+ var startNodeId = startNodeConfig.Value("id");
+ var objectType = startNodeConfig.Value("type");
+ if (!objectType.IsNullOrWhiteSpace()
+ && !startNodeId.IsNullOrWhiteSpace()
+ && int.TryParse(startNodeId, out var intStartNode))
+ {
+ var guid = intStartNode <= 0
+ ? null
+ : Context.Database.ExecuteScalar(
+ Sql().Select(x => x.UniqueId).From().Where(x => x.NodeId == intStartNode));
+
+ string entityType = null;
+ switch (objectType.ToLowerInvariant())
+ {
+ case "content":
+ entityType = Constants.UdiEntityType.Document;
+ break;
+ case "media":
+ entityType = Constants.UdiEntityType.Media;
+ break;
+ case "member":
+ entityType = Constants.UdiEntityType.Member;
+ break;
+ }
+
+ if (entityType != null && guid.HasValue)
+ {
+ var udi = new GuidUdi(entityType, guid.Value);
+ startNodeConfig["id"] = new JValue(udi.ToString());
+ }
+ else
+ startNodeConfig.Remove("id");
+
+ datatype.Configuration = JsonConvert.SerializeObject(config);
+ Database.Update(datatype);
+ }
+ }
+
+ break;
+ }
+ }
+ }
+
+ }
+ }
+}
diff --git a/src/Umbraco.Core/Models/ContentBase.cs b/src/Umbraco.Core/Models/ContentBase.cs
index 0d4e9ce789..ca1152a9a4 100644
--- a/src/Umbraco.Core/Models/ContentBase.cs
+++ b/src/Umbraco.Core/Models/ContentBase.cs
@@ -128,14 +128,14 @@ namespace Umbraco.Core.Models
///
/// Gets the enumeration of property groups for the entity.
- /// todo - remove this proxy method
+ /// TODO: remove this proxy method
///
[IgnoreDataMember]
public IEnumerable PropertyGroups => ContentTypeBase.CompositionPropertyGroups;
///
/// Gets the numeration of property types for the entity.
- /// todo - remove this proxy method
+ /// TODO: remove this proxy method
///
[IgnoreDataMember]
public IEnumerable PropertyTypes => ContentTypeBase.CompositionPropertyTypes;
diff --git a/src/Umbraco.Core/Models/ContentScheduleCollection.cs b/src/Umbraco.Core/Models/ContentScheduleCollection.cs
index 4c06f8927d..6c7dd79312 100644
--- a/src/Umbraco.Core/Models/ContentScheduleCollection.cs
+++ b/src/Umbraco.Core/Models/ContentScheduleCollection.cs
@@ -31,7 +31,7 @@ namespace Umbraco.Core.Models
_schedule[schedule.Culture] = changes;
}
- //TODO: Below will throw if there are duplicate dates added, validate/return bool?
+ // TODO: Below will throw if there are duplicate dates added, validate/return bool?
changes.Add(schedule.Date, schedule);
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, schedule));
@@ -62,7 +62,7 @@ namespace Umbraco.Core.Models
if (!releaseDate.HasValue && !expireDate.HasValue) return false;
- //TODO: Do we allow passing in a release or expiry date that is before now?
+ // TODO: Do we allow passing in a release or expiry date that is before now?
if (!_schedule.TryGetValue(culture, out var changes))
{
@@ -70,7 +70,7 @@ namespace Umbraco.Core.Models
_schedule[culture] = changes;
}
- //TODO: Below will throw if there are duplicate dates added, should validate/return bool?
+ // TODO: Below will throw if there are duplicate dates added, should validate/return bool?
// but the bool won't indicate which date was in error, maybe have 2 diff methods to schedule start/end?
if (releaseDate.HasValue)
diff --git a/src/Umbraco.Core/Models/ContentTypeBase.cs b/src/Umbraco.Core/Models/ContentTypeBase.cs
index dadc3870b0..064bdd3d4a 100644
--- a/src/Umbraco.Core/Models/ContentTypeBase.cs
+++ b/src/Umbraco.Core/Models/ContentTypeBase.cs
@@ -431,7 +431,7 @@ namespace Umbraco.Core.Models
/// PropertyTypes that are not part of a PropertyGroup
///
[IgnoreDataMember]
- //todo should we mark this as EditorBrowsable hidden since it really isn't ever used?
+ // TODO: should we mark this as EditorBrowsable hidden since it really isn't ever used?
internal PropertyTypeCollection PropertyTypeCollection => _noGroupPropertyTypes;
///
diff --git a/src/Umbraco.Core/Models/ContentTypeBaseExtensions.cs b/src/Umbraco.Core/Models/ContentTypeBaseExtensions.cs
index adbc3de54f..51c642c20d 100644
--- a/src/Umbraco.Core/Models/ContentTypeBaseExtensions.cs
+++ b/src/Umbraco.Core/Models/ContentTypeBaseExtensions.cs
@@ -48,7 +48,7 @@ namespace Umbraco.Core.Models
throw new Exception("oops");
// skip new properties
- //TODO: This used to be WasPropertyDirty("HasIdentity") but i don't think that actually worked for detecting new entities this does seem to work properly
+ // TODO: This used to be WasPropertyDirty("HasIdentity") but i don't think that actually worked for detecting new entities this does seem to work properly
var isNewProperty = dirtyProperty.WasPropertyDirty("Id");
if (isNewProperty) return false;
diff --git a/src/Umbraco.Core/Models/GridValue.cs b/src/Umbraco.Core/Models/GridValue.cs
index c4a8b85b00..157304463f 100644
--- a/src/Umbraco.Core/Models/GridValue.cs
+++ b/src/Umbraco.Core/Models/GridValue.cs
@@ -5,7 +5,7 @@ using Newtonsoft.Json.Linq;
namespace Umbraco.Core.Models
{
- //TODO: Make a property value converter for this!
+ // TODO: Make a property value converter for this!
///
/// A model representing the value saved for the grid
@@ -21,7 +21,7 @@ namespace Umbraco.Core.Models
public class GridSection
{
[JsonProperty("grid")]
- public string Grid { get; set; } //todo: what is this?
+ public string Grid { get; set; } // TODO: what is this?
[JsonProperty("rows")]
public IEnumerable Rows { get; set; }
@@ -48,7 +48,7 @@ namespace Umbraco.Core.Models
public class GridArea
{
[JsonProperty("grid")]
- public string Grid { get; set; } //todo: what is this?
+ public string Grid { get; set; } // TODO: what is this?
[JsonProperty("controls")]
public IEnumerable Controls { get; set; }
diff --git a/src/Umbraco.Core/Models/IContent.cs b/src/Umbraco.Core/Models/IContent.cs
index b3b4e03783..4363324c8d 100644
--- a/src/Umbraco.Core/Models/IContent.cs
+++ b/src/Umbraco.Core/Models/IContent.cs
@@ -137,7 +137,7 @@ namespace Umbraco.Core.Models
///
IEnumerable EditedCultures { get; }
- // todo - these two should move to some kind of service
+ // TODO: these two should move to some kind of service
///
/// Changes the for the current content object
diff --git a/src/Umbraco.Core/Models/IContentTypeComposition.cs b/src/Umbraco.Core/Models/IContentTypeComposition.cs
index 84e436e46f..675d3cd268 100644
--- a/src/Umbraco.Core/Models/IContentTypeComposition.cs
+++ b/src/Umbraco.Core/Models/IContentTypeComposition.cs
@@ -10,7 +10,7 @@ namespace Umbraco.Core.Models
///
/// Gets or sets the content types that compose this content type.
///
- //todo: we should be storing key references, not the object else we are caching way too much
+ // TODO: we should be storing key references, not the object else we are caching way too much
IEnumerable ContentTypeComposition { get; set; }
///
diff --git a/src/Umbraco.Core/Models/Identity/BackOfficeIdentityUser.cs b/src/Umbraco.Core/Models/Identity/BackOfficeIdentityUser.cs
index d118cd526e..f5c21a3a74 100644
--- a/src/Umbraco.Core/Models/Identity/BackOfficeIdentityUser.cs
+++ b/src/Umbraco.Core/Models/Identity/BackOfficeIdentityUser.cs
@@ -67,7 +67,7 @@ namespace Umbraco.Core.Models.Identity
_startContentIds = new int[] { };
_groups = new IReadOnlyUserGroup[] { };
_allowedSections = new string[] { };
- _culture = Current.Configs.Global().DefaultUILanguage; //todo inject
+ _culture = Current.Configs.Global().DefaultUILanguage; // TODO: inject
_groups = new IReadOnlyUserGroup[0];
_roles = new ObservableCollection>();
_roles.CollectionChanged += _roles_CollectionChanged;
@@ -84,7 +84,7 @@ namespace Umbraco.Core.Models.Identity
_startContentIds = new int[] { };
_groups = new IReadOnlyUserGroup[] { };
_allowedSections = new string[] { };
- _culture = Current.Configs.Global().DefaultUILanguage; //todo inject
+ _culture = Current.Configs.Global().DefaultUILanguage; // TODO: inject
_groups = groups.ToArray();
_roles = new ObservableCollection>(_groups.Select(x => new IdentityUserRole
{
diff --git a/src/Umbraco.Core/Models/MediaExtensions.cs b/src/Umbraco.Core/Models/MediaExtensions.cs
index 2945856817..e281aaf5ab 100644
--- a/src/Umbraco.Core/Models/MediaExtensions.cs
+++ b/src/Umbraco.Core/Models/MediaExtensions.cs
@@ -21,7 +21,7 @@ namespace Umbraco.Core.Models
var val = media.Properties[propertyType];
if (val == null) return string.Empty;
- //todo would need to be adjusted to variations, when media become variants
+ // TODO: would need to be adjusted to variations, when media become variants
var jsonString = val.GetValue() as string;
if (jsonString == null) return string.Empty;
diff --git a/src/Umbraco.Core/Models/Member.cs b/src/Umbraco.Core/Models/Member.cs
index c47f68c930..0ef15ee413 100644
--- a/src/Umbraco.Core/Models/Member.cs
+++ b/src/Umbraco.Core/Models/Member.cs
@@ -189,7 +189,7 @@ namespace Umbraco.Core.Models
[DataMember]
public IEnumerable Groups { get; set; }
- //TODO: When get/setting all of these properties we MUST:
+ // TODO: When get/setting all of these properties we MUST:
// * Check if we are using the umbraco membership provider, if so then we need to use the configured fields - not the explicit fields below
// * If any of the fields don't exist, what should we do? Currently it will throw an exception!
@@ -338,7 +338,7 @@ namespace Umbraco.Core.Models
return tryConvert.Result;
}
return false;
- //TODO: Use TryConvertTo instead
+ // TODO: Use TryConvertTo instead
}
set
{
@@ -371,7 +371,7 @@ namespace Umbraco.Core.Models
return tryConvert.Result;
}
return default(DateTime);
- //TODO: Use TryConvertTo instead
+ // TODO: Use TryConvertTo instead
}
set
{
@@ -404,7 +404,7 @@ namespace Umbraco.Core.Models
return tryConvert.Result;
}
return default(DateTime);
- //TODO: Use TryConvertTo instead
+ // TODO: Use TryConvertTo instead
}
set
{
@@ -437,7 +437,7 @@ namespace Umbraco.Core.Models
return tryConvert.Result;
}
return default(DateTime);
- //TODO: Use TryConvertTo instead
+ // TODO: Use TryConvertTo instead
}
set
{
@@ -471,7 +471,7 @@ namespace Umbraco.Core.Models
return tryConvert.Result;
}
return default(int);
- //TODO: Use TryConvertTo instead
+ // TODO: Use TryConvertTo instead
}
set
{
diff --git a/src/Umbraco.Core/Models/MemberType.cs b/src/Umbraco.Core/Models/MemberType.cs
index bcc7e14fd7..1ce883d9a7 100644
--- a/src/Umbraco.Core/Models/MemberType.cs
+++ b/src/Umbraco.Core/Models/MemberType.cs
@@ -66,7 +66,7 @@ namespace Umbraco.Core.Models
// leading underscores which we don't want in this case.
// see : http://issues.umbraco.org/issue/U4-3968
- //TODO: BUT, I'm pretty sure we could do this with regards to underscores now:
+ // TODO: BUT, I'm pretty sure we could do this with regards to underscores now:
// .ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase)
// Need to ask Stephen
diff --git a/src/Umbraco.Core/Models/Membership/UmbracoMembershipMember.cs b/src/Umbraco.Core/Models/Membership/UmbracoMembershipMember.cs
index ed3422d4f9..debce3afe5 100644
--- a/src/Umbraco.Core/Models/Membership/UmbracoMembershipMember.cs
+++ b/src/Umbraco.Core/Models/Membership/UmbracoMembershipMember.cs
@@ -44,7 +44,7 @@ namespace Umbraco.Core.Models.Membership
_isLockedOut = member.IsLockedOut;
_creationDate = member.CreateDate.ToUniversalTime();
_lastLoginDate = member.LastLoginDate.ToUniversalTime();
- //TODO: We currently don't really have any place to store this data!!
+ // TODO: We currently don't really have any place to store this data!!
_lastActivityDate = member.LastLoginDate.ToUniversalTime();
_lastPasswordChangedDate = member.LastPasswordChangeDate.ToUniversalTime();
_lastLockoutDate = member.LastLockoutDate.ToUniversalTime();
diff --git a/src/Umbraco.Core/Models/Membership/User.cs b/src/Umbraco.Core/Models/Membership/User.cs
index 942c71f0c6..7832390b92 100644
--- a/src/Umbraco.Core/Models/Membership/User.cs
+++ b/src/Umbraco.Core/Models/Membership/User.cs
@@ -27,7 +27,7 @@ namespace Umbraco.Core.Models.Membership
{
SessionTimeout = 60;
_userGroups = new HashSet();
- _language = Current.Configs.Global().DefaultUILanguage; //todo inject
+ _language = Current.Configs.Global().DefaultUILanguage; // TODO: inject
_isApproved = true;
_isLockedOut = false;
_startContentIds = new int[] { };
@@ -242,7 +242,7 @@ namespace Umbraco.Core.Models.Membership
set { SetPropertyValueAndDetectChanges(value, ref _failedLoginAttempts, Ps.Value.FailedPasswordAttemptsSelector); }
}
- //TODO: Figure out how to support all of this! - we cannot have NotImplementedExceptions because these get used by the IMembershipMemberService service so
+ // TODO: Figure out how to support all of this! - we cannot have NotImplementedExceptions because these get used by the IMembershipMemberService service so
// we'll just have them as generic get/set which don't interact with the db.
[IgnoreDataMember]
diff --git a/src/Umbraco.Core/Models/Packaging/CompiledPackage.cs b/src/Umbraco.Core/Models/Packaging/CompiledPackage.cs
index ac460ca34c..f4ed11e09e 100644
--- a/src/Umbraco.Core/Models/Packaging/CompiledPackage.cs
+++ b/src/Umbraco.Core/Models/Packaging/CompiledPackage.cs
@@ -26,19 +26,19 @@ namespace Umbraco.Core.Models.Packaging
public string PackageView { get; set; }
public string IconUrl { get; set; }
- public string Actions { get; set; } //todo: Should we make this strongly typed to IEnumerable ?
+ public string Actions { get; set; } // TODO: Should we make this strongly typed to IEnumerable ?
public PreInstallWarnings Warnings { get; set; } = new PreInstallWarnings();
public List Files { get; set; } = new List();
- public IEnumerable Macros { get; set; } //todo: make strongly typed
- public IEnumerable Templates { get; set; } //todo: make strongly typed
- public IEnumerable Stylesheets { get; set; } //todo: make strongly typed
- public IEnumerable DataTypes { get; set; } //todo: make strongly typed
- public IEnumerable Languages { get; set; } //todo: make strongly typed
- public IEnumerable DictionaryItems { get; set; } //todo: make strongly typed
- public IEnumerable DocumentTypes { get; set; } //todo: make strongly typed
+ public IEnumerable Macros { get; set; } // TODO: make strongly typed
+ public IEnumerable Templates { get; set; } // TODO: make strongly typed
+ public IEnumerable Stylesheets { get; set; } // TODO: make strongly typed
+ public IEnumerable DataTypes { get; set; } // TODO: make strongly typed
+ public IEnumerable Languages { get; set; } // TODO: make strongly typed
+ public IEnumerable DictionaryItems { get; set; } // TODO: make strongly typed
+ public IEnumerable DocumentTypes { get; set; } // TODO: make strongly typed
public IEnumerable Documents { get; set; }
}
}
diff --git a/src/Umbraco.Core/Models/Packaging/PreInstallWarnings.cs b/src/Umbraco.Core/Models/Packaging/PreInstallWarnings.cs
index f0acb2a46b..69c7a5641d 100644
--- a/src/Umbraco.Core/Models/Packaging/PreInstallWarnings.cs
+++ b/src/Umbraco.Core/Models/Packaging/PreInstallWarnings.cs
@@ -10,7 +10,7 @@ namespace Umbraco.Core.Models.Packaging
public IEnumerable UnsecureFiles { get; set; } = Enumerable.Empty();
public IEnumerable FilesReplaced { get; set; } = Enumerable.Empty();
- //TODO: Shouldn't we detect other conflicting entities too ?
+ // TODO: Shouldn't we detect other conflicting entities too ?
public IEnumerable ConflictingMacros { get; set; } = Enumerable.Empty();
public IEnumerable ConflictingTemplates { get; set; } = Enumerable.Empty();
public IEnumerable ConflictingStylesheets { get; set; } = Enumerable.Empty();
diff --git a/src/Umbraco.Core/Models/Property.cs b/src/Umbraco.Core/Models/Property.cs
index 5e45475dd2..11b5239a70 100644
--- a/src/Umbraco.Core/Models/Property.cs
+++ b/src/Umbraco.Core/Models/Property.cs
@@ -55,7 +55,7 @@ namespace Umbraco.Core.Models
///
public class PropertyValue
{
- //TODO: Either we allow change tracking at this class level, or we add some special change tracking collections to the Property
+ // TODO: Either we allow change tracking at this class level, or we add some special change tracking collections to the Property
// class to deal with change tracking which variants have changed
private string _culture;
@@ -103,7 +103,7 @@ namespace Umbraco.Core.Models
// ReSharper disable once ClassNeverInstantiated.Local
private class PropertySelectors
{
- //TODO: This allows us to track changes for an entire Property, but doesn't allow us to track changes at the variant level
+ // TODO: This allows us to track changes for an entire Property, but doesn't allow us to track changes at the variant level
public readonly PropertyInfo ValuesSelector = ExpressionHelper.GetPropertyInfo(x => x.Values);
public readonly DelegateEqualityComparer
internal bool IsValid(string culture = "*", string segment = "*")
{
- //todo - validating values shouldn't be done here, this calls in to IsValidValue
+ // TODO: validating values shouldn't be done here, this calls in to IsValidValue
culture = culture.NullOrWhiteSpaceAsNull();
segment = segment.NullOrWhiteSpaceAsNull();
@@ -388,7 +388,7 @@ namespace Umbraco.Core.Models
/// True is property value is valid, otherwise false
private bool IsValidValue(object value)
{
- //todo - this shouldn't exist here, the model itself shouldn't be responsible for it's own validation and this requires singleton access
+ // TODO: this shouldn't exist here, the model itself shouldn't be responsible for it's own validation and this requires singleton access
return PropertyType.IsPropertyValueValid(value);
}
diff --git a/src/Umbraco.Core/Models/PropertyCollection.cs b/src/Umbraco.Core/Models/PropertyCollection.cs
index ef56ce4a4c..5e71fe9f65 100644
--- a/src/Umbraco.Core/Models/PropertyCollection.cs
+++ b/src/Umbraco.Core/Models/PropertyCollection.cs
@@ -97,7 +97,7 @@ namespace Umbraco.Core.Models
///
internal new void Add(Property property)
{
- lock (_addLocker) // todo - why are we locking here and not everywhere else?!
+ lock (_addLocker) // TODO: why are we locking here and not everywhere else?!
{
var key = GetKeyForItem(property);
if (key != null)
diff --git a/src/Umbraco.Core/Models/PropertyGroupCollection.cs b/src/Umbraco.Core/Models/PropertyGroupCollection.cs
index 5fe47b52a4..26e0fef178 100644
--- a/src/Umbraco.Core/Models/PropertyGroupCollection.cs
+++ b/src/Umbraco.Core/Models/PropertyGroupCollection.cs
@@ -14,12 +14,12 @@ namespace Umbraco.Core.Models
///
[Serializable]
[DataContract]
- //TODO: Change this to ObservableDictionary so we can reduce the INotifyCollectionChanged implementation details
+ // TODO: Change this to ObservableDictionary so we can reduce the INotifyCollectionChanged implementation details
public class PropertyGroupCollection : KeyedCollection, INotifyCollectionChanged, IDeepCloneable
{
private readonly ReaderWriterLockSlim _addLocker = new ReaderWriterLockSlim();
- //todo: this doesn't seem to be used anywhere
+ // TODO: this doesn't seem to be used anywhere
internal Action OnAdd;
internal PropertyGroupCollection()
diff --git a/src/Umbraco.Core/Models/PropertyTagsExtensions.cs b/src/Umbraco.Core/Models/PropertyTagsExtensions.cs
index c0dcddc6ae..63cf870221 100644
--- a/src/Umbraco.Core/Models/PropertyTagsExtensions.cs
+++ b/src/Umbraco.Core/Models/PropertyTagsExtensions.cs
@@ -14,7 +14,7 @@ namespace Umbraco.Core.Models
///
public static class PropertyTagsExtensions
{
- // todo: inject
+ // TODO: inject
private static PropertyEditorCollection PropertyEditors => Current.PropertyEditors;
private static IDataTypeService DataTypeService => Current.Services.DataTypeService;
diff --git a/src/Umbraco.Core/Models/PropertyType.cs b/src/Umbraco.Core/Models/PropertyType.cs
index 377e86d2e5..107831ebdd 100644
--- a/src/Umbraco.Core/Models/PropertyType.cs
+++ b/src/Umbraco.Core/Models/PropertyType.cs
@@ -378,14 +378,14 @@ namespace Umbraco.Core.Models
}
- //todo - this and other value validation methods should be a service level (not a model) thing. Changing this to internal for now
+ // TODO: this and other value validation methods should be a service level (not a model) thing. Changing this to internal for now
///
/// Determines whether a value is valid for this property type.
///
internal bool IsPropertyValueValid(object value)
{
- var editor = Current.PropertyEditors[_propertyEditorAlias]; // todo inject
- var configuration = Current.Services.DataTypeService.GetDataType(_dataTypeId).Configuration; // todo inject
+ var editor = Current.PropertyEditors[_propertyEditorAlias]; // TODO: inject
+ var configuration = Current.Services.DataTypeService.GetDataType(_dataTypeId).Configuration; // TODO: inject
var valueEditor = editor.GetValueEditor(configuration);
return !valueEditor.Validate(value, Mandatory, ValidationRegExp).Any();
}
diff --git a/src/Umbraco.Core/Models/PropertyTypeCollection.cs b/src/Umbraco.Core/Models/PropertyTypeCollection.cs
index 6753ee7532..e79015d828 100644
--- a/src/Umbraco.Core/Models/PropertyTypeCollection.cs
+++ b/src/Umbraco.Core/Models/PropertyTypeCollection.cs
@@ -13,13 +13,13 @@ namespace Umbraco.Core.Models
///
[Serializable]
[DataContract]
- //TODO: Change this to ObservableDictionary so we can reduce the INotifyCollectionChanged implementation details
+ // TODO: Change this to ObservableDictionary so we can reduce the INotifyCollectionChanged implementation details
public class PropertyTypeCollection : KeyedCollection, INotifyCollectionChanged, IDeepCloneable
{
[IgnoreDataMember]
private readonly ReaderWriterLockSlim _addLocker = new ReaderWriterLockSlim();
- //todo: This doesn't seem to be used
+ // TODO: This doesn't seem to be used
[IgnoreDataMember]
internal Action OnAdd;
@@ -76,12 +76,12 @@ namespace Umbraco.Core.Models
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
}
- //TODO: Instead of 'new' this should explicitly implement one of the collection interfaces members
+ // TODO: Instead of 'new' this should explicitly implement one of the collection interfaces members
internal new void Add(PropertyType item)
{
item.IsPublishing = IsPublishing;
- // todo this is not pretty and should be refactored
+ // TODO: this is not pretty and should be refactored
try
{
_addLocker.EnterWriteLock();
diff --git a/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs b/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs
index e50fb2c396..d38c8eb721 100644
--- a/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs
@@ -15,7 +15,7 @@ namespace Umbraco.Core.Models.PublishedContent
{
#region Content
- // todo - IPublishedContent properties colliding with models
+ // TODO: IPublishedContent properties colliding with models
// we need to find a way to remove as much clutter as possible from IPublishedContent,
// since this is preventing someone from creating a property named 'Path' and have it
// in a model, for instance. we could move them all under one unique property eg
@@ -156,10 +156,17 @@ namespace Umbraco.Core.Models.PublishedContent
///
/// Gets a value indicating whether the content is published.
///
- ///
+ ///
+ /// A content is published when it has a published version.
+ /// When retrieving documents from cache in non-preview mode, IsPublished is always
+ /// true, as only published documents are returned. When retrieving in draft mode, IsPublished
+ /// can either be true (document has a published version) or false (document has no
+ /// published version).
+ /// It is therefore possible for both IsDraft and IsPublished to be true at the same
+ /// time, meaning that the content is the draft version, and a published version exists.
+ ///
bool IsPublished(string culture = null);
-
#endregion
#region Tree
diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs
index 083e8dcc6e..0798e9a4e0 100644
--- a/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs
@@ -86,7 +86,7 @@ namespace Umbraco.Core.Models.PublishedContent
}
}
- // todo - this list somehow also exists in constants, see memberTypeRepository => remove duplicate!
+ // TODO: this list somehow also exists in constants, see memberTypeRepository => remove duplicate!
private static readonly Dictionary BuiltinMemberProperties = new Dictionary
{
{ "Email", (Constants.DataTypes.Textbox, Constants.PropertyEditors.Aliases.TextBox) },
@@ -148,7 +148,8 @@ namespace Umbraco.Core.Models.PublishedContent
return -1;
}
- // virtual for unit tests - todo explain why
+ // virtual for unit tests
+ // TODO: explain why
///
/// Gets a property type.
///
@@ -158,7 +159,8 @@ namespace Umbraco.Core.Models.PublishedContent
return GetPropertyType(index);
}
- // virtual for unit tests - todo explain why
+ // virtual for unit tests
+ // TODO: explain why
///
/// Gets a property type.
///
diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedContentWrapped.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedContentWrapped.cs
index 42ff16bae5..8bf8cec244 100644
--- a/src/Umbraco.Core/Models/PublishedContent/PublishedContentWrapped.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/PublishedContentWrapped.cs
@@ -114,7 +114,6 @@ namespace Umbraco.Core.Models.PublishedContent
///
public virtual bool IsPublished(string culture = null) => _content.IsPublished(culture);
-
#endregion
#region Tree
diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs
index 0860fdb822..68892fd79a 100644
--- a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs
@@ -12,7 +12,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// if the property type changes, then a new class needs to be created.
public class PublishedPropertyType
{
- //todo - API design review, should this be an interface?
+ // TODO: API design review, should this be an interface?
private readonly IPublishedModelFactory _publishedModelFactory;
private readonly PropertyValueConverterCollection _propertyValueConverters;
diff --git a/src/Umbraco.Core/Models/UserExtensions.cs b/src/Umbraco.Core/Models/UserExtensions.cs
index e14d7ee2de..f9aa1113b3 100644
--- a/src/Umbraco.Core/Models/UserExtensions.cs
+++ b/src/Umbraco.Core/Models/UserExtensions.cs
@@ -136,7 +136,7 @@ namespace Umbraco.Core.Models
try
{
var culture = CultureInfo.GetCultureInfo(userLanguage.Replace("_", "-"));
- //TODO: This is a hack because we store the user language as 2 chars instead of the full culture
+ // TODO: This is a hack because we store the user language as 2 chars instead of the full culture
// which is actually stored in the language files (which are also named with 2 chars!) so we need to attempt
// to convert to a supported full culture
var result = textService.ConvertToSupportedCultureWithRegionCode(culture);
diff --git a/src/Umbraco.Core/ObjectExtensions.cs b/src/Umbraco.Core/ObjectExtensions.cs
index 1a66cb96fb..68bc9c923d 100644
--- a/src/Umbraco.Core/ObjectExtensions.cs
+++ b/src/Umbraco.Core/ObjectExtensions.cs
@@ -143,7 +143,7 @@ namespace Umbraco.Core
// Special case for empty strings for bools/dates which should return null if an empty string.
if (input is string inputString)
{
- //TODO: Why the check against only bool/date when a string is null/empty? In what scenario can we convert to another type when the string is null or empty other than just being null?
+ // TODO: Why the check against only bool/date when a string is null/empty? In what scenario can we convert to another type when the string is null or empty other than just being null?
if (string.IsNullOrEmpty(inputString) && (underlying == typeof(DateTime) || underlying == typeof(bool)))
{
return Attempt.Succeed(null);
@@ -391,7 +391,7 @@ namespace Umbraco.Core
}
internal static void CheckThrowObjectDisposed(this IDisposable disposable, bool isDisposed, string objectname)
{
- //TODO: Localize this exception
+ // TODO: Localize this exception
if (isDisposed)
throw new ObjectDisposedException(objectname);
}
diff --git a/src/Umbraco.Web/_Legacy/PackageActions/allowDoctype.cs b/src/Umbraco.Core/PackageActions/AllowDoctype.cs
similarity index 94%
rename from src/Umbraco.Web/_Legacy/PackageActions/allowDoctype.cs
rename to src/Umbraco.Core/PackageActions/AllowDoctype.cs
index f4b206a9ad..2e37061c31 100644
--- a/src/Umbraco.Web/_Legacy/PackageActions/allowDoctype.cs
+++ b/src/Umbraco.Core/PackageActions/AllowDoctype.cs
@@ -1,14 +1,10 @@
-using System;
-using System.Collections;
+using System.Collections;
using System.Linq;
-using System.Xml;
using System.Xml.Linq;
-using Umbraco.Core;
+using Umbraco.Core.Composing;
using Umbraco.Core.Models;
-using Umbraco.Core._Legacy.PackageActions;
-using Umbraco.Web.Composing;
-namespace Umbraco.Web._Legacy.PackageActions
+namespace Umbraco.Core.PackageActions
{
///
/// This class implements the IPackageAction Interface, used to execute code when packages are installed.
diff --git a/src/Umbraco.Core/_Legacy/PackageActions/IPackageAction.cs b/src/Umbraco.Core/PackageActions/IPackageAction.cs
similarity index 80%
rename from src/Umbraco.Core/_Legacy/PackageActions/IPackageAction.cs
rename to src/Umbraco.Core/PackageActions/IPackageAction.cs
index b58ea34a60..d4dfb4079b 100644
--- a/src/Umbraco.Core/_Legacy/PackageActions/IPackageAction.cs
+++ b/src/Umbraco.Core/PackageActions/IPackageAction.cs
@@ -1,8 +1,7 @@
-using System.Xml;
using System.Xml.Linq;
using Umbraco.Core.Composing;
-namespace Umbraco.Core._Legacy.PackageActions
+namespace Umbraco.Core.PackageActions
{
public interface IPackageAction : IDiscoverable
{
diff --git a/src/Umbraco.Core/_Legacy/PackageActions/PackageActionCollection.cs b/src/Umbraco.Core/PackageActions/PackageActionCollection.cs
similarity index 86%
rename from src/Umbraco.Core/_Legacy/PackageActions/PackageActionCollection.cs
rename to src/Umbraco.Core/PackageActions/PackageActionCollection.cs
index a38c8cea56..813695f84c 100644
--- a/src/Umbraco.Core/_Legacy/PackageActions/PackageActionCollection.cs
+++ b/src/Umbraco.Core/PackageActions/PackageActionCollection.cs
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using Umbraco.Core.Composing;
-namespace Umbraco.Core._Legacy.PackageActions
+namespace Umbraco.Core.PackageActions
{
public sealed class PackageActionCollection : BuilderCollectionBase
{
diff --git a/src/Umbraco.Core/_Legacy/PackageActions/PackageActionCollectionBuilder.cs b/src/Umbraco.Core/PackageActions/PackageActionCollectionBuilder.cs
similarity index 85%
rename from src/Umbraco.Core/_Legacy/PackageActions/PackageActionCollectionBuilder.cs
rename to src/Umbraco.Core/PackageActions/PackageActionCollectionBuilder.cs
index 2f73a2b489..fdb118ae06 100644
--- a/src/Umbraco.Core/_Legacy/PackageActions/PackageActionCollectionBuilder.cs
+++ b/src/Umbraco.Core/PackageActions/PackageActionCollectionBuilder.cs
@@ -1,6 +1,6 @@
using Umbraco.Core.Composing;
-namespace Umbraco.Core._Legacy.PackageActions
+namespace Umbraco.Core.PackageActions
{
internal class PackageActionCollectionBuilder : LazyCollectionBuilderBase
{
diff --git a/src/Umbraco.Web/_Legacy/PackageActions/publishRootDocument.cs b/src/Umbraco.Core/PackageActions/PublishRootDocument.cs
similarity index 86%
rename from src/Umbraco.Web/_Legacy/PackageActions/publishRootDocument.cs
rename to src/Umbraco.Core/PackageActions/PublishRootDocument.cs
index f276afeca9..55955a4c8f 100644
--- a/src/Umbraco.Web/_Legacy/PackageActions/publishRootDocument.cs
+++ b/src/Umbraco.Core/PackageActions/PublishRootDocument.cs
@@ -1,11 +1,7 @@
-using System;
-using System.Xml;
-using System.Xml.Linq;
-using Umbraco.Core;
-using Umbraco.Core._Legacy.PackageActions;
-using Umbraco.Web.Composing;
+using System.Xml.Linq;
+using Umbraco.Core.Composing;
-namespace Umbraco.Web._Legacy.PackageActions
+namespace Umbraco.Core.PackageActions
{
///
/// This class implements the IPackageAction Interface, used to execute code when packages are installed.
@@ -23,7 +19,7 @@ namespace Umbraco.Web._Legacy.PackageActions
///
///
///
- /// true if executed successfully
+ /// True if executed succesfully
public bool Execute(string packageName, XElement xmlData)
{
@@ -35,7 +31,7 @@ namespace Umbraco.Web._Legacy.PackageActions
{
if (rootDoc.Name.Trim() == documentName.Trim() && rootDoc.ContentType != null)
{
- // todo variants?
+ // TODO: variants?
Current.Services.ContentService.SaveAndPublishBranch(rootDoc, true);
break;
}
diff --git a/src/Umbraco.Core/Packaging/PackageActionRunner.cs b/src/Umbraco.Core/Packaging/PackageActionRunner.cs
index dba2690c0c..8434f52f30 100644
--- a/src/Umbraco.Core/Packaging/PackageActionRunner.cs
+++ b/src/Umbraco.Core/Packaging/PackageActionRunner.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Xml.Linq;
using Umbraco.Core.Logging;
-using Umbraco.Core._Legacy.PackageActions;
+using Umbraco.Core.PackageActions;
namespace Umbraco.Core.Packaging
{
diff --git a/src/Umbraco.Core/Packaging/PackageDataInstallation.cs b/src/Umbraco.Core/Packaging/PackageDataInstallation.cs
index 72dc0cb325..a569954629 100644
--- a/src/Umbraco.Core/Packaging/PackageDataInstallation.cs
+++ b/src/Umbraco.Core/Packaging/PackageDataInstallation.cs
@@ -100,7 +100,7 @@ namespace Umbraco.Core.Packaging
//Order the DocumentTypes before removing them
if (contentTypes.Any())
{
- //TODO: I don't think this ordering is necessary
+ // TODO: I don't think this ordering is necessary
var orderedTypes = (from contentType in contentTypes
orderby contentType.ParentId descending, contentType.Id descending
select contentType).ToList();
@@ -710,7 +710,7 @@ namespace Umbraco.Core.Packaging
// This means that the property will not be created.
if (dataTypeDefinition == null)
{
- //TODO: We should expose this to the UI during install!
+ // 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.",
property.Element("Name").Value, dataTypeDefinitionId, property.Element("Type").Value.Trim());
diff --git a/src/Umbraco.Core/Packaging/PackageFileInstallation.cs b/src/Umbraco.Core/Packaging/PackageFileInstallation.cs
index 7c0891175b..29afc11d83 100644
--- a/src/Umbraco.Core/Packaging/PackageFileInstallation.cs
+++ b/src/Umbraco.Core/Packaging/PackageFileInstallation.cs
@@ -65,7 +65,7 @@ namespace Umbraco.Core.Packaging
var file = IOHelper.FindFile(item);
if (file != null)
{
- //TODO: Surely this should be ~/ ?
+ // TODO: Surely this should be ~/ ?
file = file.EnsureStartsWith("/");
var filePath = IOHelper.MapPath(file);
diff --git a/src/Umbraco.Core/Packaging/PackagesRepository.cs b/src/Umbraco.Core/Packaging/PackagesRepository.cs
index dcf3b62e55..05f67b3ed6 100644
--- a/src/Umbraco.Core/Packaging/PackagesRepository.cs
+++ b/src/Umbraco.Core/Packaging/PackagesRepository.cs
@@ -362,7 +362,7 @@ namespace Umbraco.Core.Packaging
new XAttribute("importMode", "root"),
contentXml)));
- //TODO: I guess tags has been broken for a very long time for packaging, we should get this working again sometime
+ // TODO: I guess tags has been broken for a very long time for packaging, we should get this working again sometime
////Create the TagProperties node - this is used to store a definition for all
//// document properties that are tags, this ensures that we can re-import tags properly
//XmlNode tagProps = new XElement("TagProperties");
diff --git a/src/Umbraco.Core/Persistence/Constants-DatabaseSchema.cs b/src/Umbraco.Core/Persistence/Constants-DatabaseSchema.cs
index bfbde592b5..7898a9997a 100644
--- a/src/Umbraco.Core/Persistence/Constants-DatabaseSchema.cs
+++ b/src/Umbraco.Core/Persistence/Constants-DatabaseSchema.cs
@@ -14,8 +14,8 @@ namespace Umbraco.Core
public const string Node = /*TableNamePrefix*/ "umbraco" + "Node";
public const string NodeData = /*TableNamePrefix*/ "cms" + "ContentNu";
- public const string NodeXml = /*TableNamePrefix*/ "cms" + "ContentXml"; // todo get rid of these with the xml cache
- public const string NodePreviewXml = /*TableNamePrefix*/ "cms" + "PreviewXml"; // todo get rid of these with the xml cache
+ public const string NodeXml = /*TableNamePrefix*/ "cms" + "ContentXml"; // TODO: get rid of these with the xml cache
+ public const string NodePreviewXml = /*TableNamePrefix*/ "cms" + "PreviewXml"; // TODO: get rid of these with the xml cache
public const string ContentType = /*TableNamePrefix*/ "cms" + "ContentType";
public const string ContentChildType = /*TableNamePrefix*/ "cms" + "ContentTypeAllowedContentType";
diff --git a/src/Umbraco.Core/Persistence/Dtos/ContentVersionCultureVariationDto.cs b/src/Umbraco.Core/Persistence/Dtos/ContentVersionCultureVariationDto.cs
index ada26358dc..65d677d240 100644
--- a/src/Umbraco.Core/Persistence/Dtos/ContentVersionCultureVariationDto.cs
+++ b/src/Umbraco.Core/Persistence/Dtos/ContentVersionCultureVariationDto.cs
@@ -33,10 +33,10 @@ namespace Umbraco.Core.Persistence.Dtos
[Column("name")]
public string Name { get; set; }
- [Column("date")] // todo: db rename to 'updateDate'
+ [Column("date")] // TODO: db rename to 'updateDate'
public DateTime UpdateDate { get; set; }
- [Column("availableUserId")] // todo: db rename to 'updateDate'
+ [Column("availableUserId")] // TODO: db rename to 'updateDate'
[ForeignKey(typeof(UserDto))]
[NullSetting(NullSetting = NullSettings.Null)]
public int? UpdateUserId { get => _updateUserId == 0 ? null : _updateUserId; set => _updateUserId = value; } //return null if zero
diff --git a/src/Umbraco.Core/Persistence/Dtos/ContentVersionDto.cs b/src/Umbraco.Core/Persistence/Dtos/ContentVersionDto.cs
index 287e812211..3c2c3deda4 100644
--- a/src/Umbraco.Core/Persistence/Dtos/ContentVersionDto.cs
+++ b/src/Umbraco.Core/Persistence/Dtos/ContentVersionDto.cs
@@ -21,16 +21,16 @@ namespace Umbraco.Core.Persistence.Dtos
[ForeignKey(typeof(ContentDto))]
public int NodeId { get; set; }
- [Column("versionDate")] // todo: db rename to 'updateDate'
+ [Column("versionDate")] // TODO: db rename to 'updateDate'
[Constraint(Default = SystemMethods.CurrentDateTime)]
public DateTime VersionDate { get; set; }
- [Column("userId")] // todo: db rename to 'updateUserId'
+ [Column("userId")] // TODO: db rename to 'updateUserId'
[ForeignKey(typeof(UserDto))]
[NullSetting(NullSetting = NullSettings.Null)]
public int? UserId { get => _userId == 0 ? null : _userId; set => _userId = value; } //return null if zero
- //todo - we need an index on this it is used almost always in querying and sorting
+ // TODO: we need an index on this it is used almost always in querying and sorting
[Column("current")]
public bool Current { get; set; }
diff --git a/src/Umbraco.Core/Persistence/Dtos/DataTypeDto.cs b/src/Umbraco.Core/Persistence/Dtos/DataTypeDto.cs
index a0e526b62e..d270c7b732 100644
--- a/src/Umbraco.Core/Persistence/Dtos/DataTypeDto.cs
+++ b/src/Umbraco.Core/Persistence/Dtos/DataTypeDto.cs
@@ -14,7 +14,7 @@ namespace Umbraco.Core.Persistence.Dtos
public int NodeId { get; set; }
[Column("propertyEditorAlias")]
- public string EditorAlias { get; set; } // todo should this have a length
+ public string EditorAlias { get; set; } // TODO: should this have a length
[Column("dbType")]
[Length(50)]
diff --git a/src/Umbraco.Core/Persistence/Dtos/LogDto.cs b/src/Umbraco.Core/Persistence/Dtos/LogDto.cs
index 9a710c1fec..bfd96426e2 100644
--- a/src/Umbraco.Core/Persistence/Dtos/LogDto.cs
+++ b/src/Umbraco.Core/Persistence/Dtos/LogDto.cs
@@ -35,12 +35,12 @@ namespace Umbraco.Core.Persistence.Dtos
[NullSetting(NullSetting = NullSettings.Null)]
public string EntityType { get; set; }
- //TODO: Should we have an index on this since we allow searching on it?
+ // TODO: Should we have an index on this since we allow searching on it?
[Column("Datestamp")]
[Constraint(Default = SystemMethods.CurrentDateTime)]
public DateTime Datestamp { get; set; }
- //TODO: Should we have an index on this since we allow searching on it?
+ // TODO: Should we have an index on this since we allow searching on it?
[Column("logHeader")]
[Length(50)]
public string Header { get; set; }
diff --git a/src/Umbraco.Core/Persistence/Dtos/MemberTypeReadOnlyDto.cs b/src/Umbraco.Core/Persistence/Dtos/MemberTypeReadOnlyDto.cs
index f9e70cce18..c4ea6a10fd 100644
--- a/src/Umbraco.Core/Persistence/Dtos/MemberTypeReadOnlyDto.cs
+++ b/src/Umbraco.Core/Persistence/Dtos/MemberTypeReadOnlyDto.cs
@@ -66,13 +66,13 @@ namespace Umbraco.Core.Persistence.Dtos
public bool AllowAtRoot { get; set; }
/* PropertyTypes */
- //TODO Add PropertyTypeDto (+MemberTypeDto and DataTypeDto as one) ReadOnly list
+ // TODO: Add PropertyTypeDto (+MemberTypeDto and DataTypeDto as one) ReadOnly list
[ResultColumn]
[Reference(ReferenceType.Many, ReferenceMemberName = "ContentTypeId")]
public List PropertyTypes { get; set; }
/* PropertyTypeGroups */
- //TODO Add PropertyTypeGroupDto ReadOnly list
+ // TODO: Add PropertyTypeGroupDto ReadOnly list
[ResultColumn]
[Reference(ReferenceType.Many, ReferenceMemberName = "ContentTypeNodeId")]
public List PropertyTypeGroups { get; set; }
diff --git a/src/Umbraco.Core/Persistence/Dtos/NodeDto.cs b/src/Umbraco.Core/Persistence/Dtos/NodeDto.cs
index 8f50891b34..5800efb97a 100644
--- a/src/Umbraco.Core/Persistence/Dtos/NodeDto.cs
+++ b/src/Umbraco.Core/Persistence/Dtos/NodeDto.cs
@@ -45,7 +45,7 @@ namespace Umbraco.Core.Persistence.Dtos
[Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_Trashed")]
public bool Trashed { get; set; }
- [Column("nodeUser")] // todo: db rename to 'createUserId'
+ [Column("nodeUser")] // TODO: db rename to 'createUserId'
[ForeignKey(typeof(UserDto))]
[NullSetting(NullSetting = NullSettings.Null)]
public int? UserId { get => _userId == 0 ? null : _userId; set => _userId = value; } //return null if zero
@@ -54,7 +54,7 @@ namespace Umbraco.Core.Persistence.Dtos
[NullSetting(NullSetting = NullSettings.Null)]
public string Text { get; set; }
- [Column("nodeObjectType")] // todo: db rename to 'objectType'
+ [Column("nodeObjectType")] // TODO: db rename to 'objectType'
[NullSetting(NullSetting = NullSettings.Null)]
[Index(IndexTypes.NonClustered, Name = "IX_" + TableName + "_ObjectType")]
public Guid? NodeObjectType { get; set; }
diff --git a/src/Umbraco.Core/Persistence/EntityNotFoundException.cs b/src/Umbraco.Core/Persistence/EntityNotFoundException.cs
index 49e85046a0..e0fe778fa6 100644
--- a/src/Umbraco.Core/Persistence/EntityNotFoundException.cs
+++ b/src/Umbraco.Core/Persistence/EntityNotFoundException.cs
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace Umbraco.Core.Persistence
{
- //TODO: Would be good to use this exception type anytime we cannot find an entity
+ // TODO: Would be good to use this exception type anytime we cannot find an entity
///
/// An exception used to indicate that an umbraco entity could not be found
diff --git a/src/Umbraco.Core/Persistence/Factories/ContentBaseFactory.cs b/src/Umbraco.Core/Persistence/Factories/ContentBaseFactory.cs
index 97e172f98f..434e0393cd 100644
--- a/src/Umbraco.Core/Persistence/Factories/ContentBaseFactory.cs
+++ b/src/Umbraco.Core/Persistence/Factories/ContentBaseFactory.cs
@@ -49,7 +49,7 @@ namespace Umbraco.Core.Persistence.Factories
content.Published = dto.Published;
content.Edited = dto.Edited;
- // todo - shall we get published infos or not?
+ // TODO: shall we get published infos or not?
//if (dto.Published)
if (publishedVersionDto != null)
{
@@ -89,7 +89,7 @@ namespace Umbraco.Core.Persistence.Factories
content.Key = nodeDto.UniqueId;
content.VersionId = contentVersionDto.Id;
- // todo missing names?
+ // TODO: missing names?
content.Path = nodeDto.Path;
content.Level = nodeDto.Level;
@@ -130,7 +130,7 @@ namespace Umbraco.Core.Persistence.Factories
content.Key = nodeDto.UniqueId;
content.VersionId = contentVersionDto.Id;
- // todo missing names?
+ // TODO: missing names?
content.Path = nodeDto.Path;
content.Level = nodeDto.Level;
@@ -294,7 +294,7 @@ namespace Umbraco.Core.Persistence.Factories
private static MediaVersionDto BuildMediaVersionDto(IMedia entity, ContentDto contentDto)
{
// try to get a path from the string being stored for media
- // todo - only considering umbracoFile
+ // TODO: only considering umbracoFile
TryMatch(entity.GetValue("umbracoFile"), out var path);
@@ -309,7 +309,7 @@ namespace Umbraco.Core.Persistence.Factories
return dto;
}
- // todo - this should NOT be here?!
+ // TODO: this should NOT be here?!
// more dark magic ;-(
internal static bool TryMatch(string text, out string path)
{
diff --git a/src/Umbraco.Core/Persistence/LocalDb.cs b/src/Umbraco.Core/Persistence/LocalDb.cs
index 94e930abe9..55d6565344 100644
--- a/src/Umbraco.Core/Persistence/LocalDb.cs
+++ b/src/Umbraco.Core/Persistence/LocalDb.cs
@@ -317,8 +317,8 @@ namespace Umbraco.Core.Persistence
if (dbname == "master" || dbname == "tempdb" || dbname == "model" || dbname == "msdb")
continue;
- // todo - shall we deal with stale databases?
- // todo - is it always ok to assume file names?
+ // TODO: shall we deal with stale databases?
+ // TODO: is it always ok to assume file names?
//var mdf = database.Value;
//var ldf = mdf.Replace(".mdf", "_log.ldf");
//if (staleOnly && File.Exists(mdf) && File.Exists(ldf))
diff --git a/src/Umbraco.Core/Persistence/NPocoDatabaseExtensions-Bulk.cs b/src/Umbraco.Core/Persistence/NPocoDatabaseExtensions-Bulk.cs
index b596ab60a3..09f754c47a 100644
--- a/src/Umbraco.Core/Persistence/NPocoDatabaseExtensions-Bulk.cs
+++ b/src/Umbraco.Core/Persistence/NPocoDatabaseExtensions-Bulk.cs
@@ -17,7 +17,7 @@ namespace Umbraco.Core.Persistence
///
public static partial class NPocoDatabaseExtensions
{
- // todo: review NPoco native InsertBulk to replace the code below
+ // TODO: review NPoco native InsertBulk to replace the code below
///
/// Bulk-inserts records within a transaction.
@@ -177,8 +177,8 @@ namespace Umbraco.Core.Persistence
using (var command = database.CreateCommand(database.Connection, CommandType.TableDirect, string.Empty))
{
command.CommandText = pocoData.TableInfo.TableName;
- command.CommandType = CommandType.TableDirect; // todo - why repeat?
- // todo - not supporting transactions?
+ command.CommandType = CommandType.TableDirect; // TODO: why repeat?
+ // TODO: not supporting transactions?
//cmd.Transaction = GetTypedTransaction(db.Connection.);
var count = 0;
diff --git a/src/Umbraco.Core/Persistence/NPocoDatabaseExtensions.cs b/src/Umbraco.Core/Persistence/NPocoDatabaseExtensions.cs
index b8417d743d..248f91284f 100644
--- a/src/Umbraco.Core/Persistence/NPocoDatabaseExtensions.cs
+++ b/src/Umbraco.Core/Persistence/NPocoDatabaseExtensions.cs
@@ -32,7 +32,7 @@ namespace Umbraco.Core.Persistence
//
// works in READ COMMITED, TSQL & SQLCE lock the constraint even if it does not exist, so INSERT is OK
//
- // todo: use the proper database syntax, not this kludge
+ // TODO: use the proper database syntax, not this kludge
///
/// Safely inserts a record, or updates if it exists, based on a unique constraint.
@@ -81,7 +81,7 @@ namespace Umbraco.Core.Persistence
if (poco == null)
throw new ArgumentNullException(nameof(poco));
- // todo - NPoco has a Save method that works with the primary key
+ // TODO: NPoco has a Save method that works with the primary key
// in any case, no point trying to update if there's no primary key!
// try to update
diff --git a/src/Umbraco.Core/Persistence/NPocoSqlExtensions.cs b/src/Umbraco.Core/Persistence/NPocoSqlExtensions.cs
index 10735f865c..23d818f0b3 100644
--- a/src/Umbraco.Core/Persistence/NPocoSqlExtensions.cs
+++ b/src/Umbraco.Core/Persistence/NPocoSqlExtensions.cs
@@ -496,7 +496,7 @@ namespace Umbraco.Core.Persistence
public static Sql On(this Sql.SqlJoinClause sqlJoin,
Expression> leftField, Expression> rightField)
{
- // todo - ugly - should define on SqlContext!
+ // TODO: ugly - should define on SqlContext!
var xLeft = new Sql(sqlJoin.SqlContext).Columns(leftField);
var xRight = new Sql(sqlJoin.SqlContext).Columns(rightField);
@@ -1180,7 +1180,7 @@ namespace Umbraco.Core.Persistence
private static string GetTableName(this Type type)
{
- // todo: returning string.Empty for now
+ // TODO: returning string.Empty for now
// BUT the code bits that calls this method cannot deal with string.Empty so we
// should either throw, or fix these code bits...
var attr = type.FirstAttribute();
diff --git a/src/Umbraco.Core/Persistence/Querying/ExpressionVisitorBase.cs b/src/Umbraco.Core/Persistence/Querying/ExpressionVisitorBase.cs
index 64b3c91e50..d04930fa92 100644
--- a/src/Umbraco.Core/Persistence/Querying/ExpressionVisitorBase.cs
+++ b/src/Umbraco.Core/Persistence/Querying/ExpressionVisitorBase.cs
@@ -10,7 +10,7 @@ using Umbraco.Core.Composing;
namespace Umbraco.Core.Persistence.Querying
{
- // todo - are we basically duplicating entire parts of NPoco just because of SqlSyntax ?!
+ // TODO: are we basically duplicating entire parts of NPoco just because of SqlSyntax ?!
// try to use NPoco's version !
///
@@ -269,7 +269,7 @@ namespace Umbraco.Core.Persistence.Querying
protected virtual string VisitNew(NewExpression newExpression)
{
- // TODO : check !
+ // TODO: check !
var member = Expression.Convert(newExpression, typeof(object));
var lambda = Expression.Lambda>(member);
try
@@ -662,7 +662,7 @@ namespace Umbraco.Core.Persistence.Querying
// sql 'COALESCE(x,fb) = COALESCE(y,fb)' - of course, fb must be a value outside
// of x and y range - and if that is not possible, then a manual comparison need
// to be written
- //TODO support SqlNullableEquals with 0 parameters, using the full syntax below
+ // TODO: support SqlNullableEquals with 0 parameters, using the full syntax below
case "SqlNullableEquals":
var compareTo = Visit(m.Arguments[1]);
var fallback = Visit(m.Arguments[2]);
diff --git a/src/Umbraco.Core/Persistence/Querying/ModelToSqlExpressionVisitor.cs b/src/Umbraco.Core/Persistence/Querying/ModelToSqlExpressionVisitor.cs
index 9f57e61db9..a353f01f5b 100644
--- a/src/Umbraco.Core/Persistence/Querying/ModelToSqlExpressionVisitor.cs
+++ b/src/Umbraco.Core/Persistence/Querying/ModelToSqlExpressionVisitor.cs
@@ -79,7 +79,7 @@ namespace Umbraco.Core.Persistence.Querying
return string.Empty;
}
- //TODO: When m.Expression.NodeType == ExpressionType.Constant and it's an expression like: content => aliases.Contains(content.ContentType.Alias);
+ // TODO: When m.Expression.NodeType == ExpressionType.Constant and it's an expression like: content => aliases.Contains(content.ContentType.Alias);
// then an SQL parameter will be added for aliases as an array, however in SqlIn on the subclass it will manually add these SqlParameters anyways,
// however the query will still execute because the SQL that is written will only contain the correct indexes of SQL parameters, this would be ignored,
// I'm just unsure right now due to time constraints how to make it correct. It won't matter right now and has been working already with this bug but I've
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentRepositoryBase.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentRepositoryBase.cs
index 8057c87578..821f0941fc 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentRepositoryBase.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentRepositoryBase.cs
@@ -43,7 +43,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
protected ILanguageRepository LanguageRepository { get; }
- protected PropertyEditorCollection PropertyEditors => Current.PropertyEditors; // todo inject
+ protected PropertyEditorCollection PropertyEditors => Current.PropertyEditors; // TODO: inject
#region Versions
@@ -73,7 +73,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
// deletes a specific version
public virtual void DeleteVersion(int versionId)
{
- // todo test object node type?
+ // TODO: test object node type?
// get the version we want to delete
var template = SqlContext.Templates.Get("Umbraco.Core.VersionableRepository.GetVersion", tsql =>
@@ -95,7 +95,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
// deletes all versions of an entity, older than a date.
public virtual void DeleteVersions(int nodeId, DateTime versionDate)
{
- // todo test object node type?
+ // TODO: test object node type?
// get the versions we want to delete, excluding the current one
var template = SqlContext.Templates.Get("Umbraco.Core.VersionableRepository.GetVersions", tsql =>
@@ -240,7 +240,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
}
}
- // todo should we do it when un-publishing? or?
+ // TODO: should we do it when un-publishing? or?
///
/// Clears tags for an item.
///
@@ -374,7 +374,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
return GetAliasedField(SqlSyntax.GetFieldName(x => x.Text), sql);
// "variantName" alias is defined in DocumentRepository.GetBaseQuery
- // todo - what if it is NOT a document but a ... media or whatever?
+ // TODO: what if it is NOT a document but a ... media or whatever?
// previously, we inserted the join+select *here* so we were sure to have it,
// but now that's not the case anymore!
return "variantName";
@@ -620,7 +620,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
#region UnitOfWork Events
- // todo: The reason these events are in the repository is for legacy, the events should exist at the service
+ // TODO: The reason these events are in the repository is for legacy, the events should exist at the service
// level now since we can fire these events within the transaction... so move the events to service level
public class ScopedEntityEventArgs : EventArgs
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs
index 3bc730d5d0..7f41d2a456 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs
@@ -271,7 +271,7 @@ AND umbracoNode.id <> @id",
compositionBase.RemovedContentTypeKeyTracker != null &&
compositionBase.RemovedContentTypeKeyTracker.Any())
{
- //TODO: Could we do the below with bulk SQL statements instead of looking everything up and then manipulating?
+ // TODO: Could we do the below with bulk SQL statements instead of looking everything up and then manipulating?
// find Content based on the current ContentType
var sql = Sql()
@@ -291,7 +291,7 @@ AND umbracoNode.id <> @id",
// based on the PropertyTypes that belong to the removed ContentType.
foreach (var contentDto in contentDtos)
{
- //TODO: This could be done with bulk SQL statements
+ // TODO: This could be done with bulk SQL statements
foreach (var propertyType in propertyTypes)
{
var nodeId = contentDto.NodeId;
@@ -343,8 +343,7 @@ AND umbracoNode.id <> @id",
List orphanPropertyTypeIds = null;
if (entity.IsPropertyDirty("PropertyGroups"))
{
- // todo
- // we used to try to propagate tabs renaming downstream, relying on ParentId, but
+ // TODO: we used to try to propagate tabs renaming downstream, relying on ParentId, but
// 1) ParentId makes no sense (if a tab can be inherited from multiple composition
// types) so we would need to figure things out differently, visiting downstream
// content types and looking for tabs with the same name...
@@ -438,7 +437,7 @@ AND umbracoNode.id <> @id",
case ContentVariation.CultureAndSegment:
case ContentVariation.Segment:
default:
- throw new NotSupportedException(); //TODO: Support this
+ throw new NotSupportedException(); // TODO: Support this
}
}
@@ -628,7 +627,7 @@ AND umbracoNode.id <> @id",
///
private void ClearScheduledPublishing(IContentTypeComposition contentType)
{
- //TODO: Fill this in when scheduled publishing is enabled for variants
+ // TODO: Fill this in when scheduled publishing is enabled for variants
}
///
@@ -671,7 +670,7 @@ AND umbracoNode.id <> @id",
case ContentVariation.CultureAndSegment:
case ContentVariation.Segment:
default:
- throw new NotSupportedException(); //TODO: Support this
+ throw new NotSupportedException(); // TODO: Support this
}
}
}
@@ -754,7 +753,7 @@ AND umbracoNode.id <> @id",
case ContentVariation.CultureAndSegment:
case ContentVariation.Segment:
default:
- throw new NotSupportedException(); //TODO: Support this
+ throw new NotSupportedException(); // TODO: Support this
}
}
@@ -1038,7 +1037,7 @@ AND umbracoNode.id <> @id",
var dtos = Database.Fetch(sql);
- //TODO Move this to a PropertyTypeFactory
+ // TODO: Move this to a PropertyTypeFactory
var list = new List();
foreach (var dto in dtos.Where(x => x.PropertyTypeGroupId <= 0))
{
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/DataTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/DataTypeRepository.cs
index 0e6ff0310d..3de9e3c99b 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/DataTypeRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/DataTypeRepository.cs
@@ -26,7 +26,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
{
private readonly Lazy _editors;
- // TODO - https://github.com/umbraco/Umbraco-CMS/issues/4237 - get rid of Lazy injection and fix circular dependencies
+ // TODO: https://github.com/umbraco/Umbraco-CMS/issues/4237 - get rid of Lazy injection and fix circular dependencies
public DataTypeRepository(IScopeAccessor scopeAccessor, AppCaches cache, Lazy editors, ILogger logger)
: base(scopeAccessor, cache, logger)
{
@@ -111,7 +111,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
//ensure a datatype has a unique name before creating it
entity.Name = EnsureUniqueNodeName(entity.Name);
- //TODO: should the below be removed?
+ // TODO: should the below be removed?
//Cannot add a duplicate data type
var existsSql = Sql()
.SelectCount()
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/DocumentRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/DocumentRepository.cs
index 8bee55060b..dcac7f4ff4 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/DocumentRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/DocumentRepository.cs
@@ -148,7 +148,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
.On((left, right) => left.Id == right.Id && right.Published, "pcv", "pdv"), "pcv")
.On((left, right) => left.NodeId == right.NodeId, aliasRight: "pcv")
- // todo - should we be joining this when the query type is not single/many?
+ // TODO: should we be joining this when the query type is not single/many?
// left join on optional culture variation
//the magic "[[[ISOCODE]]]" parameter value will be replaced in ContentRepositoryBase.GetPage() by the actual ISO code
.LeftJoin(nested =>
@@ -277,7 +277,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
SanitizeNames(content, publishing);
// ensure that strings don't contain characters that are invalid in xml
- // todo - do we really want to keep doing this here?
+ // TODO: do we really want to keep doing this here?
entity.SanitizeEntityPropertiesForXmlStorage();
// create the dto
@@ -466,7 +466,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
SanitizeNames(content, publishing);
// ensure that strings don't contain characters that are invalid in xml
- // todo - do we really want to keep doing this here?
+ // TODO: do we really want to keep doing this here?
entity.SanitizeEntityPropertiesForXmlStorage();
// if parent has changed, get path, level and sort order
@@ -545,7 +545,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
edited = true;
(editedCultures ?? (editedCultures = new HashSet(StringComparer.OrdinalIgnoreCase))).Add(culture);
- // todo - change tracking
+ // TODO: change tracking
// at the moment, we don't do any dirty tracking on property values, so we don't know whether the
// culture has just been edited or not, so we don't update its update date - that date only changes
// when the name is set, and it all works because the controller does it - but, if someone uses a
@@ -561,7 +561,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
var deleteDocumentVariations = Sql().Delete().Where(x => x.NodeId == content.Id);
Database.Execute(deleteDocumentVariations);
- // todo NPoco InsertBulk issue?
+ // TODO: NPoco InsertBulk issue?
// we should use the native NPoco InsertBulk here but it causes problems (not sure exactly all scenarios)
// but by using SQL Server and updating a variants name will cause: Unable to cast object of type
// 'Umbraco.Core.Persistence.FaultHandling.RetryDbConnection' to type 'System.Data.SqlClient.SqlConnection'.
@@ -622,8 +622,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
ClearEntityTags(entity, _tagRepository);
}
- // note re. tags: explicitly unpublished entities have cleared tags,
- // but masked or trashed entities *still* have tags in the db todo so what?
+ // TODO: note re. tags: explicitly unpublished entities have cleared tags, but masked or trashed entities *still* have tags in the db - so what?
entity.ResetDirtyProperties();
@@ -837,7 +836,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
}
// reading repository purely for looking up by GUID
- // todo - ugly and to fix we need to decouple the IRepositoryQueryable -> IRepository -> IReadRepository which should all be separate things!
+ // TODO: ugly and to fix we need to decouple the IRepositoryQueryable -> IRepository -> IReadRepository which should all be separate things!
private class ContentByGuidReadRepository : NPocoRepositoryBase
{
private readonly DocumentRepository _outerRepo;
@@ -1124,7 +1123,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
// get properties - indexed by version id
var versionId = dto.DocumentVersionDto.Id;
- // todo - shall we get published properties or not?
+ // TODO: shall we get published properties or not?
//var publishedVersionId = dto.Published ? dto.PublishedVersionDto.Id : 0;
var publishedVersionId = dto.PublishedVersionDto != null ? dto.PublishedVersionDto.Id : 0;
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/DomainRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/DomainRepository.cs
index fa06216f9b..01b8bdd66c 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/DomainRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/DomainRepository.cs
@@ -12,7 +12,7 @@ using Umbraco.Core.Scoping;
namespace Umbraco.Core.Persistence.Repositories.Implement
{
- //TODO: We need to get a readonly ISO code for the domain assigned
+ // TODO: We need to get a readonly ISO code for the domain assigned
internal class DomainRepository : NPocoRepositoryBase, IDomainRepository
{
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/EntityRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/EntityRepository.cs
index c531b991a9..85912694f0 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/EntityRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/EntityRepository.cs
@@ -62,7 +62,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
ApplyOrdering(ref sql, ordering);
}
- //todo - we should be able to do sql = sql.OrderBy(x => Alias(x.NodeId, "NodeId")); but we can't because the OrderBy extension don't support Alias currently
+ // TODO: we should be able to do sql = sql.OrderBy(x => Alias(x.NodeId, "NodeId")); but we can't because the OrderBy extension don't support Alias currently
//no matter what we always must have node id ordered at the end
sql = ordering.Direction == Direction.Ascending ? sql.OrderBy("NodeId") : sql.OrderByDescending("NodeId");
@@ -73,7 +73,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
if (isContent)
BuildVariants(entities.Cast());
- //todo - see https://github.com/umbraco/Umbraco-CMS/pull/3460#issuecomment-434903930 we need to not load any property data at all for media
+ // TODO: see https://github.com/umbraco/Umbraco-CMS/pull/3460#issuecomment-434903930 we need to not load any property data at all for media
if (isMedia)
BuildProperties(entities, dtos);
@@ -166,7 +166,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
var entities = dtos.Select(x => BuildEntity(false, isMedia, x)).ToArray();
- //todo- see https://github.com/umbraco/Umbraco-CMS/pull/3460#issuecomment-434903930 we need to not load any property data at all for media
+ // TODO: See https://github.com/umbraco/Umbraco-CMS/pull/3460#issuecomment-434903930 we need to not load any property data at all for media
if (isMedia && loadMediaProperties)
BuildProperties(entities, dtos);
@@ -227,7 +227,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
return GetEntities(sql, isContent, isMedia, true);
}
- //todo- see https://github.com/umbraco/Umbraco-CMS/pull/3460#issuecomment-434903930 we need to not load any property data at all for media
+ // TODO: See https://github.com/umbraco/Umbraco-CMS/pull/3460#issuecomment-434903930 we need to not load any property data at all for media
internal IEnumerable GetMediaByQueryWithoutPropertyData(IQuery query)
{
var isContent = false;
@@ -266,7 +266,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
return Database.ExecuteScalar(sql) > 0;
}
- //todo - see https://github.com/umbraco/Umbraco-CMS/pull/3460#issuecomment-434903930 we need to not load any property data at all for media
+ // TODO: see https://github.com/umbraco/Umbraco-CMS/pull/3460#issuecomment-434903930 we need to not load any property data at all for media
private void BuildProperties(EntitySlim entity, BaseDto dto)
{
var pdtos = Database.Fetch(GetPropertyData(dto.VersionId));
@@ -274,7 +274,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
BuildProperty(entity, pdto);
}
- //todo - see https://github.com/umbraco/Umbraco-CMS/pull/3460#issuecomment-434903930 we need to not load any property data at all for media
+ // TODO: see https://github.com/umbraco/Umbraco-CMS/pull/3460#issuecomment-434903930 we need to not load any property data at all for media
private void BuildProperties(EntitySlim[] entities, List dtos)
{
var versionIds = dtos.Select(x => x.VersionId).Distinct().ToList();
@@ -290,7 +290,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
}
}
- //todo - see https://github.com/umbraco/Umbraco-CMS/pull/3460#issuecomment-434903930 we need to not load any property data at all for media
+ // TODO: see https://github.com/umbraco/Umbraco-CMS/pull/3460#issuecomment-434903930 we need to not load any property data at all for media
private void BuildProperty(EntitySlim entity, PropertyDataDto pdto)
{
// explain ?!
@@ -539,7 +539,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
if (sql == null) throw new ArgumentNullException(nameof(sql));
if (ordering == null) throw new ArgumentNullException(nameof(ordering));
- //todo - although this works for name, it probably doesn't work for others without an alias of some sort
+ // TODO: although this works for name, it probably doesn't work for others without an alias of some sort
var orderBy = ordering.OrderBy;
if (ordering.Direction == Direction.Ascending)
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/MediaRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/MediaRepository.cs
index 94714d6ded..38558e1ca5 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/MediaRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/MediaRepository.cs
@@ -225,7 +225,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
entity.Name = EnsureUniqueNodeName(entity.ParentId, entity.Name);
// ensure that strings don't contain characters that are invalid in xml
- // todo - do we really want to keep doing this here?
+ // TODO: do we really want to keep doing this here?
entity.SanitizeEntityPropertiesForXmlStorage();
// create the dto
@@ -304,7 +304,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
entity.Name = EnsureUniqueNodeName(entity.ParentId, entity.Name, entity.Id);
// ensure that strings don't contain characters that are invalid in xml
- // todo - do we really want to keep doing this here?
+ // TODO: do we really want to keep doing this here?
entity.SanitizeEntityPropertiesForXmlStorage();
// if parent has changed, get path, level and sort order
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/MemberGroupRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/MemberGroupRepository.cs
index e6ee79470c..ff7a79f98e 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/MemberGroupRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/MemberGroupRepository.cs
@@ -298,7 +298,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
public int MemberGroupId { get; set; }
}
- // todo - understand why we need these two repository-level events, move them back to service
+ // TODO: understand why we need these two repository-level events, move them back to service
///
/// Occurs before Save
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/MemberRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/MemberRepository.cs
index 9d7556f356..ba3526f1f0 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/MemberRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/MemberRepository.cs
@@ -66,7 +66,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
{
var baseQuery = GetBaseQuery(false);
- // todo why is this different from content/media?!
+ // TODO: why is this different from content/media?!
// check if the query is based on properties or not
var wheres = query.GetWhereClauses();
@@ -103,7 +103,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
{
var sql = SqlContext.Sql();
- switch (queryType) // todo pretend we still need these queries for now
+ switch (queryType) // TODO: pretend we still need these queries for now
{
case QueryType.Count:
sql = sql.SelectCount();
@@ -143,18 +143,18 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
return sql;
}
- // todo - move that one up to Versionable! or better: kill it!
+ // TODO: move that one up to Versionable! or better: kill it!
protected override Sql GetBaseQuery(bool isCount)
{
return GetBaseQuery(isCount ? QueryType.Count : QueryType.Single);
}
- protected override string GetBaseWhereClause() // todo - can we kill / refactor this?
+ protected override string GetBaseWhereClause() // TODO: can we kill / refactor this?
{
return "umbracoNode.id = @id";
}
- // todo document/understand that one
+ // TODO: document/understand that one
protected Sql GetNodeIdQueryWithPropertyData()
{
return Sql()
@@ -237,7 +237,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
member.AddingEntity();
// ensure that strings don't contain characters that are invalid in xml
- // todo - do we really want to keep doing this here?
+ // TODO: do we really want to keep doing this here?
entity.SanitizeEntityPropertiesForXmlStorage();
// create the dto
@@ -329,7 +329,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
member.UpdatingEntity();
// ensure that strings don't contain characters that are invalid in xml
- // todo - do we really want to keep doing this here?
+ // TODO: do we really want to keep doing this here?
entity.SanitizeEntityPropertiesForXmlStorage();
// if parent has changed, get path, level and sort order
@@ -460,7 +460,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
var subQuery = Sql().Select("Member").From().Where(dto => dto.MemberGroup == memberGroup.Id);
var sql = GetBaseQuery(false)
- //TODO: An inner join would be better, though I've read that the query optimizer will always turn a
+ // TODO: An inner join would be better, though I've read that the query optimizer will always turn a
// subquery with an IN clause into an inner join anyways.
.Append("WHERE umbracoNode.id IN (" + subQuery.SQL + ")", subQuery.Arguments)
.OrderByDescending(x => x.VersionDate)
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/NPocoRepositoryBase.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/NPocoRepositoryBase.cs
index a0ba2d5aa3..23236ec9f0 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/NPocoRepositoryBase.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/NPocoRepositoryBase.cs
@@ -42,7 +42,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
#region Abstract Methods
- protected abstract Sql GetBaseQuery(bool isCount); // todo obsolete, use QueryType instead everywhere
+ protected abstract Sql GetBaseQuery(bool isCount); // TODO: obsolete, use QueryType instead everywhere
protected abstract string GetBaseWhereClause();
protected abstract IEnumerable GetDeleteClauses();
protected abstract Guid NodeObjectTypeId { get; }
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/RepositoryBaseOfTIdTEntity.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/RepositoryBaseOfTIdTEntity.cs
index 84e8ffc172..a7e366a94f 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/RepositoryBaseOfTIdTEntity.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/RepositoryBaseOfTIdTEntity.cs
@@ -78,7 +78,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
}
}
- // todo - but now that we have 1 unique repository?
+ // TODO: but now that we have 1 unique repository?
// this is a *bad* idea because PerformCount captures the current repository and its UOW
//
//private static RepositoryCachePolicyOptions _defaultOptions;
@@ -207,7 +207,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
//ensure they are de-duplicated, easy win if people don't do this as this can cause many excess queries
ids = ids.Distinct()
//don't query by anything that is a default of T (like a zero)
- //TODO: I think we should enabled this in case accidental calls are made to get all with invalid ids
+ // TODO: I think we should enabled this in case accidental calls are made to get all with invalid ids
//.Where(x => Equals(x, default(TId)) == false)
.ToArray();
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/ServerRegistrationRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/ServerRegistrationRepository.cs
index b4aa9c27f9..2bad7229f2 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/ServerRegistrationRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/ServerRegistrationRepository.cs
@@ -20,7 +20,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
protected override IRepositoryCachePolicy CreateCachePolicy()
{
- // todo - wtf are we doing with cache here?
+ // TODO: wtf are we doing with cache here?
// why are we using disabled cache helper up there?
//
// 7.6 says:
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/TagRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/TagRepository.cs
index 7dd3f03407..f26fcca81b 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/TagRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/TagRepository.cs
@@ -254,8 +254,7 @@ WHERE r.tagId IS NULL";
#region Queries
- // TODO
- // consider caching implications
+ // TODO: consider caching implications
// add lookups for parentId or path (ie get content in tag group, that are descendants of x)
// ReSharper disable once ClassNeverInstantiated.Local
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/TemplateRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/TemplateRepository.cs
index a183894462..b348317989 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/TemplateRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/TemplateRepository.cs
@@ -407,13 +407,12 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
template.UpdateDate = fs.GetLastModified(filename).UtcDateTime;
}
- // TODO
- // see if this could enable us to update UpdateDate without messing with change tracking
- // and then we'd want to do it for scripts, stylesheets and partial views too (ie files)
- //var xtemplate = template as Template;
- //xtemplate.DisableChangeTracking();
- //template.UpdateDate = fs.GetLastModified(filename).UtcDateTime;
- //xtemplate.EnableChangeTracking();
+ // TODO: see if this could enable us to update UpdateDate without messing with change tracking
+ // and then we'd want to do it for scripts, stylesheets and partial views too (ie files)
+ // var xtemplate = template as Template;
+ // xtemplate.DisableChangeTracking();
+ // template.UpdateDate = fs.GetLastModified(filename).UtcDateTime;
+ // xtemplate.EnableChangeTracking();
template.VirtualPath = fs.GetUrl(filename);
@@ -580,9 +579,8 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
public bool ValidateTemplate(ITemplate template)
{
// get path
- // TODO
- // templates should have a real Path somehow - but anyways
- // are we using Path for something else?!
+ // TODO: templates should have a real Path somehow - but anyways
+ // are we using Path for something else?!
var path = template.VirtualPath;
// get valid paths
@@ -652,7 +650,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
private string EnsureUniqueAlias(ITemplate template, int attempts)
{
- //TODO: This is ported from the old data layer... pretty crap way of doing this but it works for now.
+ // TODO: This is ported from the old data layer... pretty crap way of doing this but it works for now.
if (AliasAlreadExists(template))
return template.Alias + attempts;
attempts++;
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/UserGroupRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/UserGroupRepository.cs
index b42060b6cc..3935027ada 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/UserGroupRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/UserGroupRepository.cs
@@ -128,7 +128,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
{
foreach (var nodeId in nodeIds)
{
- //TODO: We could/should change the EntityPermissionsCollection into a KeyedCollection and they key could be
+ // TODO: We could/should change the EntityPermissionsCollection into a KeyedCollection and they key could be
// a struct of the nodeid + groupid so then we don't actually allocate this class just to check if it's not
// going to be included in the result!
@@ -444,7 +444,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
/// Ids of users
private void AddUsersToGroup(int groupId, int[] userIds)
{
- //TODO: Check if the user exists?
+ // TODO: Check if the user exists?
foreach (var userId in userIds)
{
var dto = new User2UserGroupDto
diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/UserRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/UserRepository.cs
index 2242c65256..07ad6bcba9 100644
--- a/src/Umbraco.Core/Persistence/Repositories/Implement/UserRepository.cs
+++ b/src/Umbraco.Core/Persistence/Repositories/Implement/UserRepository.cs
@@ -65,7 +65,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
if (_passwordConfigInitialized)
return _passwordConfigJson;
- // todo - this is bad
+ // TODO: this is bad
// because the membership provider we're trying to get has a dependency on the user service
// and we should not depend on services in repositories - need a way better way to do this
@@ -169,7 +169,7 @@ ORDER BY colName";
public Guid CreateLoginSession(int userId, string requestingIpAddress, bool cleanStaleSessions = true)
{
- //TODO: I know this doesn't follow the normal repository conventions which would require us to create a UserSessionRepository
+ // TODO: I know this doesn't follow the normal repository conventions which would require us to create a UserSessionRepository
//and also business logic models for these objects but that's just so overkill for what we are doing
//and now that everything is properly in a transaction (Scope) there doesn't seem to be much reason for using that anymore
var now = DateTime.UtcNow;
@@ -238,7 +238,7 @@ ORDER BY colName";
public void ClearLoginSession(Guid sessionId)
{
- // todo why is that one updating and not deleting?
+ // TODO: why is that one updating and not deleting?
Database.Execute(Sql()
.Update(u => u.Set(x => x.LoggedOutUtc, DateTime.UtcNow))
.Where(x => x.SessionId == sessionId));
@@ -443,7 +443,7 @@ ORDER BY colName";
var userDto = UserFactory.BuildDto(entity);
// check if we have a known config, we only want to store config for hashing
- //TODO: This logic will need to be updated when we do http://issues.umbraco.org/issue/U4-10089
+ // TODO: This logic will need to be updated when we do http://issues.umbraco.org/issue/U4-10089
if (PasswordConfigJson != null)
userDto.PasswordConfig = PasswordConfigJson;
@@ -538,7 +538,7 @@ ORDER BY colName";
}
// check if we have a known config, we only want to store config for hashing
- //TODO: This logic will need to be updated when we do http://issues.umbraco.org/issue/U4-10089
+ // TODO: This logic will need to be updated when we do http://issues.umbraco.org/issue/U4-10089
if (PasswordConfigJson != null)
{
userDto.PasswordConfig = PasswordConfigJson;
@@ -573,7 +573,7 @@ ORDER BY colName";
: Database.Fetch("SELECT * FROM umbracoUserGroup WHERE userGroupAlias IN (@aliases)", new { aliases = entity.Groups.Select(x => x.Alias) });
//first delete all
- //TODO: We could do this a nicer way instead of "Nuke and Pave"
+ // TODO: We could do this a nicer way instead of "Nuke and Pave"
Database.Delete("WHERE UserId = @UserId", new { UserId = entity.Id });
foreach (var groupDto in assigned)
diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs b/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs
index d6ceeaa3e6..5b6a9afb04 100644
--- a/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs
+++ b/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs
@@ -500,7 +500,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
if (column.DefaultValue == null)
return string.Empty;
- //hack - probably not needed with latest changes
+ // HACK: probably not needed with latest changes
if (column.DefaultValue.ToString().ToLower().Equals("getdate()".ToLower()))
column.DefaultValue = SystemMethods.CurrentDateTime;
diff --git a/src/Umbraco.Core/Persistence/SqlSyntaxExtensions.cs b/src/Umbraco.Core/Persistence/SqlSyntaxExtensions.cs
index 43ef03327b..2fba8e7d49 100644
--- a/src/Umbraco.Core/Persistence/SqlSyntaxExtensions.cs
+++ b/src/Umbraco.Core/Persistence/SqlSyntaxExtensions.cs
@@ -13,7 +13,7 @@ namespace Umbraco.Core.Persistence
{
private static string GetTableName(this Type type)
{
- // todo: returning string.Empty for now
+ // TODO: returning string.Empty for now
// BUT the code bits that calls this method cannot deal with string.Empty so we
// should either throw, or fix these code bits...
var attr = type.FirstAttribute();
diff --git a/src/Umbraco.Core/Persistence/UmbracoDatabase.cs b/src/Umbraco.Core/Persistence/UmbracoDatabase.cs
index 4e795d3a78..51e0172f35 100644
--- a/src/Umbraco.Core/Persistence/UmbracoDatabase.cs
+++ b/src/Umbraco.Core/Persistence/UmbracoDatabase.cs
@@ -159,7 +159,7 @@ namespace Umbraco.Core.Persistence
#region OnSomething
- // todo - has new interceptors to replace OnSomething?
+ // TODO: has new interceptors to replace OnSomething?
protected override DbConnection OnConnectionOpened(DbConnection connection)
{
@@ -218,7 +218,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 aec49b8eb5..eab0ae5509 100644
--- a/src/Umbraco.Core/Persistence/UmbracoDatabaseFactory.cs
+++ b/src/Umbraco.Core/Persistence/UmbracoDatabaseFactory.cs
@@ -22,8 +22,8 @@ namespace Umbraco.Core.Persistence
/// It wraps an NPoco UmbracoDatabaseFactory which is initializes with a proper IPocoDataFactory to ensure
/// that NPoco's plumbing is cached appropriately for the whole application.
///
- //todo these comments are not true anymore
- //todo this class needs not be disposable!
+ // TODO: these comments are not true anymore
+ // TODO: this class needs not be disposable!
internal class UmbracoDatabaseFactory : DisposableObject, IUmbracoDatabaseFactory
{
private readonly Lazy _mappers;
@@ -288,7 +288,7 @@ namespace Umbraco.Core.Persistence
// thread, so we don't really know what we are disposing here...
// besides, we don't really want to dispose the factory, which is a singleton...
- // todo - the class does not need be disposable
+ // TODO: the class does not need be disposable
//var db = _umbracoDatabaseAccessor.UmbracoDatabase;
//_umbracoDatabaseAccessor.UmbracoDatabase = null;
//db?.Dispose();
@@ -299,7 +299,7 @@ namespace Umbraco.Core.Persistence
// this method provides a way to force-reset the variable
internal void ResetForTests()
{
- // todo remove all this eventually
+ // TODO: remove all this eventually
//var db = _umbracoDatabaseAccessor.UmbracoDatabase;
//_umbracoDatabaseAccessor.UmbracoDatabase = null;
//db?.Dispose();
diff --git a/src/Umbraco.Core/PropertyEditors/DataEditor.cs b/src/Umbraco.Core/PropertyEditors/DataEditor.cs
index 0db6dcb0dd..ae6ace996e 100644
--- a/src/Umbraco.Core/PropertyEditors/DataEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/DataEditor.cs
@@ -89,7 +89,7 @@ namespace Umbraco.Core.PropertyEditors
/// Technically, it could be cached by datatype but let's keep things
/// simple enough for now.
///
- // todo point of that one? shouldn't we always configure?
+ // TODO: point of that one? shouldn't we always configure?
public IDataValueEditor GetValueEditor() => ExplicitValueEditor ?? CreateValueEditor();
///
@@ -113,7 +113,7 @@ namespace Umbraco.Core.PropertyEditors
return ExplicitValueEditor;
var editor = CreateValueEditor();
- ((DataValueEditor) editor).Configuration = configuration; // todo casting is bad
+ ((DataValueEditor) editor).Configuration = configuration; // TODO: casting is bad
return editor;
}
diff --git a/src/Umbraco.Core/PropertyEditors/DataValueEditor.cs b/src/Umbraco.Core/PropertyEditors/DataValueEditor.cs
index 153039dedb..096b80de1f 100644
--- a/src/Umbraco.Core/PropertyEditors/DataValueEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/DataValueEditor.cs
@@ -283,7 +283,7 @@ namespace Umbraco.Core.PropertyEditors
}
}
- // todo - the methods below should be replaced by proper property value convert ToXPath usage!
+ // TODO: the methods below should be replaced by proper property value convert ToXPath usage!
///
/// Converts a property to Xml fragments.
diff --git a/src/Umbraco.Core/PropertyEditors/IDataEditor.cs b/src/Umbraco.Core/PropertyEditors/IDataEditor.cs
index 16aa4d6d5c..e7aa68459e 100644
--- a/src/Umbraco.Core/PropertyEditors/IDataEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/IDataEditor.cs
@@ -46,7 +46,7 @@ namespace Umbraco.Core.PropertyEditors
///
/// Gets a value editor.
///
- IDataValueEditor GetValueEditor(); // todo - should be configured?!
+ IDataValueEditor GetValueEditor(); // TODO: should be configured?!
///
/// Gets a configured value editor.
diff --git a/src/Umbraco.Core/PropertyEditors/IDataValueEditor.cs b/src/Umbraco.Core/PropertyEditors/IDataValueEditor.cs
index c92b6fa0d3..cb68531cc7 100644
--- a/src/Umbraco.Core/PropertyEditors/IDataValueEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/IDataValueEditor.cs
@@ -47,7 +47,7 @@ namespace Umbraco.Core.PropertyEditors
///
///
/// Use this property to add validators, not to validate. Use instead.
- /// todo replace with AddValidator? WithValidator?
+ /// TODO: replace with AddValidator? WithValidator?
///
List Validators { get; }
@@ -61,7 +61,7 @@ namespace Umbraco.Core.PropertyEditors
///
object ToEditor(Property property, IDataTypeService dataTypeService, string culture = null, string segment = null);
- // todo / deal with this when unplugging the xml cache
+ // TODO: / deal with this when unplugging the xml cache
// why property vs propertyType? services should be injected! etc...
IEnumerable ConvertDbToXml(Property property, IDataTypeService dataTypeService, ILocalizationService localizationService, bool published);
XNode ConvertDbToXml(PropertyType propertyType, object value, IDataTypeService dataTypeService);
diff --git a/src/Umbraco.Core/PropertyEditors/ManifestValueValidatorCollection.cs b/src/Umbraco.Core/PropertyEditors/ManifestValueValidatorCollection.cs
index 204dff6f19..62f2e0ca1d 100644
--- a/src/Umbraco.Core/PropertyEditors/ManifestValueValidatorCollection.cs
+++ b/src/Umbraco.Core/PropertyEditors/ManifestValueValidatorCollection.cs
@@ -17,7 +17,7 @@ namespace Umbraco.Core.PropertyEditors
if (v == null)
throw new InvalidOperationException($"Could not find a validator named \"{name}\".");
- // todo - what is this exactly?
+ // TODO: what is this exactly?
// we cannot return this instance, need to clone it?
return (IManifestValueValidator) Activator.CreateInstance(v.GetType()); // ouch
}
diff --git a/src/Umbraco.Core/PropertyEditors/TagsPropertyEditorAttribute.cs b/src/Umbraco.Core/PropertyEditors/TagsPropertyEditorAttribute.cs
index e1f99083e8..2439c7c02e 100644
--- a/src/Umbraco.Core/PropertyEditors/TagsPropertyEditorAttribute.cs
+++ b/src/Umbraco.Core/PropertyEditors/TagsPropertyEditorAttribute.cs
@@ -43,7 +43,7 @@ namespace Umbraco.Core.PropertyEditors
///
/// Gets or sets a value indicating whether to replace the tags entirely.
///
- // todo: what's the usage?
+ // TODO: what's the usage?
public bool ReplaceTags { get; set; }
///
diff --git a/src/Umbraco.Core/PropertyEditors/Validators/DelimitedValueValidator.cs b/src/Umbraco.Core/PropertyEditors/Validators/DelimitedValueValidator.cs
index 3891d7952b..c3dca609d2 100644
--- a/src/Umbraco.Core/PropertyEditors/Validators/DelimitedValueValidator.cs
+++ b/src/Umbraco.Core/PropertyEditors/Validators/DelimitedValueValidator.cs
@@ -23,7 +23,7 @@ namespace Umbraco.Core.PropertyEditors.Validators
///
public IEnumerable Validate(object value, string valueType, object dataTypeConfiguration)
{
- //TODO: localize these!
+ // TODO: localize these!
if (value != null)
{
var delimiter = ",";
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs
index d4cee4762f..e04893716a 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs
@@ -65,6 +65,6 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
return sourceString;
}
- //TODO: Now to convert that to XPath!
+ // TODO: Now to convert that to XPath!
}
}
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs
index 12594eb842..31ab47223f 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs
@@ -67,7 +67,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
// GetPreValuesCollectionByDataTypeId is cached at repository level;
// still, the collection is deep-cloned so this is kinda expensive,
// better to cache here + trigger refresh in DataTypeCacheRefresher
- // todo: this is cheap now, remove the caching
+ // TODO: this is cheap now, remove the caching
return Storages.GetOrAdd(dataTypeId, id =>
{
diff --git a/src/Umbraco.Core/RenderingEngine.cs b/src/Umbraco.Core/RenderingEngine.cs
deleted file mode 100644
index ac1c9dce56..0000000000
--- a/src/Umbraco.Core/RenderingEngine.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace Umbraco.Core
-{
- public enum RenderingEngine
- {
- Unknown,
- Mvc,
- WebForms
- }
-}
diff --git a/src/Umbraco.Core/Runtime/CoreRuntimeComposer.cs b/src/Umbraco.Core/Runtime/CoreRuntimeComposer.cs
index 5535d5c67b..ee289ddcfa 100644
--- a/src/Umbraco.Core/Runtime/CoreRuntimeComposer.cs
+++ b/src/Umbraco.Core/Runtime/CoreRuntimeComposer.cs
@@ -11,6 +11,7 @@ using Umbraco.Core.Manifest;
using Umbraco.Core.Migrations;
using Umbraco.Core.Migrations.Install;
using Umbraco.Core.Models.PublishedContent;
+using Umbraco.Core.PackageActions;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.Mappers;
using Umbraco.Core.PropertyEditors;
@@ -19,7 +20,6 @@ using Umbraco.Core.Scoping;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using Umbraco.Core.Sync;
-using Umbraco.Core._Legacy.PackageActions;
using IntegerValidator = Umbraco.Core.PropertyEditors.Validators.IntegerValidator;
namespace Umbraco.Core.Runtime
@@ -73,16 +73,20 @@ namespace Umbraco.Core.Runtime
// register a server registrar, by default it's the db registrar
composition.RegisterUnique(f =>
{
- if ("true".InvariantEquals(ConfigurationManager.AppSettings["umbracoDisableElectionForSingleServer"]))
- return new SingleServerRegistrar(f.GetInstance());
- return new DatabaseServerRegistrar(
- new Lazy(f.GetInstance),
- new DatabaseServerRegistrarOptions());
+ // TODO: this is a hack, use proper configuration!
+ // also: we still register the full IServerMessenger because
+ // even on 1 single server we can have 2 concurrent app domains
+ var singleServer = "true".InvariantEquals(ConfigurationManager.AppSettings["umbracoDisableElectionForSingleServer"]);
+ return singleServer
+ ? (IServerRegistrar) new SingleServerRegistrar(f.GetInstance())
+ : new DatabaseServerRegistrar(
+ new Lazy(f.GetInstance),
+ new DatabaseServerRegistrarOptions());
});
// by default we'll use the database server messenger with default options (no callbacks),
- // this will be overridden by either the legacy thing or the db thing in the corresponding
- // components in the web project - todo - should obsolete the legacy thing
+ // this will be overridden by the db thing in the corresponding components in the web
+ // project
composition.RegisterUnique(factory
=> new DatabaseServerMessenger(
factory.GetInstance(),
diff --git a/src/Umbraco.Core/Scoping/Scope.cs b/src/Umbraco.Core/Scoping/Scope.cs
index 6aeee33c41..f9ea02b072 100644
--- a/src/Umbraco.Core/Scoping/Scope.cs
+++ b/src/Umbraco.Core/Scoping/Scope.cs
@@ -85,7 +85,7 @@ namespace Umbraco.Core.Scoping
ParentScope = parent;
// cannot specify a different mode!
- // todo - means that it's OK to go from L2 to None for reading purposes, but writing would be BAD!
+ // TODO: means that it's OK to go from L2 to None for reading purposes, but writing would be BAD!
// this is for XmlStore that wants to bypass caches when rebuilding XML (same for NuCache)
if (repositoryCacheMode != RepositoryCacheMode.Unspecified && parent.RepositoryCacheMode > repositoryCacheMode)
throw new ArgumentException($"Value '{repositoryCacheMode}' cannot be lower than parent value '{parent.RepositoryCacheMode}'.", nameof(repositoryCacheMode));
@@ -264,7 +264,7 @@ namespace Umbraco.Core.Scoping
if (ParentScope != null) return ParentScope.Messages;
return _messages ?? (_messages = new EventMessages());
- // todo - event messages?
+ // TODO: event messages?
// this may be a problem: the messages collection will be cleared at the end of the scope
// how shall we process it in controllers etc? if we don't want the global factory from v7?
// it'd need to be captured by the controller
@@ -323,7 +323,7 @@ namespace Umbraco.Core.Scoping
if (_disposed)
throw new ObjectDisposedException(GetType().FullName);
- // todo - safer?
+ // TODO: safer?
//if (Interlocked.CompareExchange(ref _disposed, 1, 0) != 0)
// throw new ObjectDisposedException(GetType().FullName);
}
diff --git a/src/Umbraco.Core/Scoping/ScopeContext.cs b/src/Umbraco.Core/Scoping/ScopeContext.cs
index 3f70f1791e..7b62c5c7a2 100644
--- a/src/Umbraco.Core/Scoping/ScopeContext.cs
+++ b/src/Umbraco.Core/Scoping/ScopeContext.cs
@@ -13,10 +13,7 @@ namespace Umbraco.Core.Scoping
if (_enlisted == null)
return;
- // todo
- // - can we create infinite loops?
- // - what about nested events? will they just be plainly ignored = really bad?
-
+ // TODO: can we create infinite loops? - what about nested events? will they just be plainly ignored = really bad?
List exceptions = null;
List orderedEnlisted;
while ((orderedEnlisted = _enlisted.Values.OrderBy(x => x.Priority).ToList()).Count > 0)
diff --git a/src/Umbraco.Core/Security/BackOfficeUserStore.cs b/src/Umbraco.Core/Security/BackOfficeUserStore.cs
index 2d9469180a..3d87482d60 100644
--- a/src/Umbraco.Core/Security/BackOfficeUserStore.cs
+++ b/src/Umbraco.Core/Security/BackOfficeUserStore.cs
@@ -30,9 +30,9 @@ namespace Umbraco.Core.Security
IUserTwoFactorStore,
IUserSessionStore
- //TODO: This would require additional columns/tables for now people will need to implement this on their own
+ // TODO: This would require additional columns/tables for now people will need to implement this on their own
//IUserPhoneNumberStore,
- //TODO: To do this we need to implement IQueryable - we'll have an IQuerable implementation soon with the UmbracoLinqPadDriver implementation
+ // TODO: To do this we need to implement IQueryable - we'll have an IQuerable implementation soon with the UmbracoLinqPadDriver implementation
//IQueryableUserStore
{
private readonly IUserService _userService;
@@ -99,7 +99,7 @@ namespace Umbraco.Core.Security
UpdateMemberProperties(userEntity, user);
- //TODO: We should deal with Roles --> User Groups here which we currently are not doing
+ // TODO: We should deal with Roles --> User Groups here which we currently are not doing
_userService.Save(userEntity);
@@ -720,7 +720,7 @@ namespace Umbraco.Core.Security
user.SecurityStamp = identityUser.SecurityStamp;
}
- //TODO: Fix this for Groups too
+ // TODO: Fix this for Groups too
if (identityUser.IsPropertyDirty("Roles") || identityUser.IsPropertyDirty("Groups"))
{
var userGroupAliases = user.Groups.Select(x => x.Alias).ToArray();
diff --git a/src/Umbraco.Core/Security/MembershipProviderExtensions.cs b/src/Umbraco.Core/Security/MembershipProviderExtensions.cs
index ff595a5d45..8fc2cb77e4 100644
--- a/src/Umbraco.Core/Security/MembershipProviderExtensions.cs
+++ b/src/Umbraco.Core/Security/MembershipProviderExtensions.cs
@@ -161,7 +161,7 @@ namespace Umbraco.Core.Security
return (membershipProvider is UmbracoMembershipProviderBase);
}
- //TODO: Add role provider checks too
+ // TODO: Add role provider checks too
public static UmbracoMembershipProviderBase AsUmbracoMembershipProvider(this MembershipProvider membershipProvider)
{
diff --git a/src/Umbraco.Core/Security/UserAwareMembershipProviderPasswordHasher.cs b/src/Umbraco.Core/Security/UserAwareMembershipProviderPasswordHasher.cs
index 7fecb30fba..e09c861caa 100644
--- a/src/Umbraco.Core/Security/UserAwareMembershipProviderPasswordHasher.cs
+++ b/src/Umbraco.Core/Security/UserAwareMembershipProviderPasswordHasher.cs
@@ -15,14 +15,14 @@ namespace Umbraco.Core.Security
public string HashPassword(BackOfficeIdentityUser user, string password)
{
- //TODO: Implement the logic for this, we need to lookup the password format for the user and hash accordingly: http://issues.umbraco.org/issue/U4-10089
+ // TODO: Implement the logic for this, we need to lookup the password format for the user and hash accordingly: http://issues.umbraco.org/issue/U4-10089
//NOTE: For now this just falls back to the hashing we are currently using
return base.HashPassword(password);
}
public PasswordVerificationResult VerifyHashedPassword(BackOfficeIdentityUser user, string hashedPassword, string providedPassword)
{
- //TODO: Implement the logic for this, we need to lookup the password format for the user and hash accordingly: http://issues.umbraco.org/issue/U4-10089
+ // TODO: Implement the logic for this, we need to lookup the password format for the user and hash accordingly: http://issues.umbraco.org/issue/U4-10089
//NOTE: For now this just falls back to the hashing we are currently using
return base.VerifyHashedPassword(hashedPassword, providedPassword);
}
diff --git a/src/Umbraco.Core/Services/IContentService.cs b/src/Umbraco.Core/Services/IContentService.cs
index 3a3c43c6a0..7fb7450b46 100644
--- a/src/Umbraco.Core/Services/IContentService.cs
+++ b/src/Umbraco.Core/Services/IContentService.cs
@@ -242,7 +242,7 @@ namespace Umbraco.Core.Services
///
/// Saves documents.
///
- // todo why only 1 result not 1 per content?!
+ // TODO: why only 1 result not 1 per content?!
OperationResult Save(IEnumerable contents, int userId = 0, bool raiseEvents = true);
///
diff --git a/src/Umbraco.Core/Services/IEntityService.cs b/src/Umbraco.Core/Services/IEntityService.cs
index 3f398cc1e9..9d0399f324 100644
--- a/src/Umbraco.Core/Services/IEntityService.cs
+++ b/src/Umbraco.Core/Services/IEntityService.cs
@@ -242,8 +242,9 @@ namespace Umbraco.Core.Services
IEnumerable GetPagedDescendants(IEnumerable ids, UmbracoObjectTypes objectType, long pageIndex, int pageSize, out long totalRecords,
IQuery filter = null, Ordering ordering = null);
+ // TODO: Do we really need this? why not just pass in -1
///
- /// Gets descendants of root. todo: Do we really need this? why not just pass in -1
+ /// Gets descendants of root.
///
IEnumerable GetPagedDescendants(UmbracoObjectTypes objectType, long pageIndex, int pageSize, out long totalRecords,
IQuery filter = null, Ordering ordering = null, bool includeTrashed = true);
diff --git a/src/Umbraco.Core/Services/IEntityXmlSerializer.cs b/src/Umbraco.Core/Services/IEntityXmlSerializer.cs
index 1c58fc56b8..6feb31115c 100644
--- a/src/Umbraco.Core/Services/IEntityXmlSerializer.cs
+++ b/src/Umbraco.Core/Services/IEntityXmlSerializer.cs
@@ -14,7 +14,7 @@ namespace Umbraco.Core.Services
///
XElement Serialize(IContent content,
bool published,
- bool withDescendants = false) //todo take care of usage! only used for the packager
+ bool withDescendants = false) // TODO: take care of usage! only used for the packager
;
///
diff --git a/src/Umbraco.Core/Services/IFileService.cs b/src/Umbraco.Core/Services/IFileService.cs
index a895eff7e1..d32c984b5e 100644
--- a/src/Umbraco.Core/Services/IFileService.cs
+++ b/src/Umbraco.Core/Services/IFileService.cs
@@ -108,6 +108,19 @@ namespace Umbraco.Core.Services
///
void DeleteScriptFolder(string folderPath);
+ ///
+ /// Creates a folder for style sheets
+ ///
+ ///
+ ///
+ void CreateStyleSheetFolder(string folderPath);
+
+ ///
+ /// Deletes a folder for style sheets
+ ///
+ ///
+ void DeleteStyleSheetFolder(string folderPath);
+
///
/// Gets a list of all objects
///
diff --git a/src/Umbraco.Core/Services/Implement/AuditService.cs b/src/Umbraco.Core/Services/Implement/AuditService.cs
index d02d7f541b..46c851a789 100644
--- a/src/Umbraco.Core/Services/Implement/AuditService.cs
+++ b/src/Umbraco.Core/Services/Implement/AuditService.cs
@@ -200,7 +200,7 @@ namespace Umbraco.Core.Services.Implement
return entry;
}
- //TODO: Currently used in testing only, not part of the interface, need to add queryable methods to the interface instead
+ // TODO: Currently used in testing only, not part of the interface, need to add queryable methods to the interface instead
internal IEnumerable GetAll()
{
if (_isAvailable.Value == false) return Enumerable.Empty();
@@ -211,7 +211,7 @@ namespace Umbraco.Core.Services.Implement
}
}
- //TODO: Currently used in testing only, not part of the interface, need to add queryable methods to the interface instead
+ // TODO: Currently used in testing only, not part of the interface, need to add queryable methods to the interface instead
internal IEnumerable GetPage(long pageIndex, int pageCount, out long records)
{
if (_isAvailable.Value == false)
diff --git a/src/Umbraco.Core/Services/Implement/ContentService.cs b/src/Umbraco.Core/Services/Implement/ContentService.cs
index e1304a324f..266f34cc37 100644
--- a/src/Umbraco.Core/Services/Implement/ContentService.cs
+++ b/src/Umbraco.Core/Services/Implement/ContentService.cs
@@ -164,7 +164,7 @@ namespace Umbraco.Core.Services.Implement
///
public IContent Create(string name, Guid parentId, string contentTypeAlias, int userId = 0)
{
- // todo - what about culture?
+ // TODO: what about culture?
var parent = GetById(parentId);
return Create(name, parent, contentTypeAlias, userId);
@@ -184,7 +184,7 @@ namespace Umbraco.Core.Services.Implement
/// The content object.
public IContent Create(string name, int parentId, string contentTypeAlias, int userId = 0)
{
- // todo - what about culture?
+ // TODO: what about culture?
var contentType = GetContentType(contentTypeAlias);
if (contentType == null)
@@ -217,7 +217,7 @@ namespace Umbraco.Core.Services.Implement
/// The content object.
public IContent Create(string name, IContent parent, string contentTypeAlias, int userId = 0)
{
- // todo - what about culture?
+ // TODO: what about culture?
if (parent == null) throw new ArgumentNullException(nameof(parent));
@@ -248,7 +248,7 @@ namespace Umbraco.Core.Services.Implement
/// The content object.
public IContent CreateAndSave(string name, int parentId, string contentTypeAlias, int userId = 0)
{
- // todo - what about culture?
+ // TODO: what about culture?
using (var scope = ScopeProvider.CreateScope())
{
@@ -282,7 +282,7 @@ namespace Umbraco.Core.Services.Implement
/// The content object.
public IContent CreateAndSave(string name, IContent parent, string contentTypeAlias, int userId = 0)
{
- // todo - what about culture?
+ // TODO: what about culture?
if (parent == null) throw new ArgumentNullException(nameof(parent));
@@ -778,7 +778,7 @@ namespace Umbraco.Core.Services.Implement
var culturesChanging = content.ContentType.VariesByCulture()
? content.CultureInfos.Where(x => x.Value.IsDirty()).Select(x => x.Key).ToList()
: null;
- //TODO: Currently there's no way to change track which variant properties have changed, we only have change
+ // TODO: Currently there's no way to change track which variant properties have changed, we only have change
// tracking enabled on all values on the Property which doesn't allow us to know which variants have changed.
// in this particular case, determining which cultures have changed works with the above with names since it will
// have always changed if it's been saved in the back office but that's not really fail safe.
@@ -1562,8 +1562,7 @@ namespace Umbraco.Core.Services.Implement
DoDelete(content);
}
- //TODO:
- // both DeleteVersions methods below have an issue. Sort of. They do NOT take care of files the way
+ //TODO: both DeleteVersions methods below have an issue. Sort of. They do NOT take care of files the way
// Delete does - for a good reason: the file may be referenced by other, non-deleted, versions. BUT,
// if that's not the case, then the file will never be deleted, because when we delete the content,
// the version referencing the file will not be there anymore. SO, we can leak files.
@@ -2001,7 +2000,7 @@ namespace Umbraco.Core.Services.Implement
? string.Join(",", content.CultureInfos.Where(x => x.Value.IsDirty()).Select(x => x.Key))
: null;
- //TODO: Currently there's no way to change track which variant properties have changed, we only have change
+ // TODO: Currently there's no way to change track which variant properties have changed, we only have change
// tracking enabled on all values on the Property which doesn't allow us to know which variants have changed.
// in this particular case, determining which cultures have changed works with the above with names since it will
// have always changed if it's been saved in the back office but that's not really fail safe.
@@ -2553,7 +2552,7 @@ namespace Umbraco.Core.Services.Implement
/// Optional Id of the user issuing the delete operation
public void DeleteOfTypes(IEnumerable contentTypeIds, int userId = 0)
{
- //TODO: This currently this is called from the ContentTypeService but that needs to change,
+ // TODO: This currently this is called from the ContentTypeService but that needs to change,
// if we are deleting a content type, we should just delete the data and do this operation slightly differently.
// This method will recursively go lookup every content item, check if any of it's descendants are
// of a different type, move them to the recycle bin, then permanently delete the content items.
diff --git a/src/Umbraco.Core/Services/Implement/ContentTypeServiceBaseOfTRepositoryTItemTService.cs b/src/Umbraco.Core/Services/Implement/ContentTypeServiceBaseOfTRepositoryTItemTService.cs
index a9e75e6f29..bf43693d3b 100644
--- a/src/Umbraco.Core/Services/Implement/ContentTypeServiceBaseOfTRepositoryTItemTService.cs
+++ b/src/Umbraco.Core/Services/Implement/ContentTypeServiceBaseOfTRepositoryTItemTService.cs
@@ -134,7 +134,7 @@ namespace Umbraco.Core.Services.Implement
var dirty = (IRememberBeingDirty)contentType;
// skip new content types
- //TODO: This used to be WasPropertyDirty("HasIdentity") but i don't think that actually worked for detecting new entities this does seem to work properly
+ // TODO: This used to be WasPropertyDirty("HasIdentity") but i don't think that actually worked for detecting new entities this does seem to work properly
var isNewContentType = dirty.WasPropertyDirty("Id");
if (isNewContentType)
{
@@ -152,7 +152,7 @@ namespace Umbraco.Core.Services.Implement
throw new Exception("oops");
// skip new properties
- //TODO: This used to be WasPropertyDirty("HasIdentity") but i don't think that actually worked for detecting new entities this does seem to work properly
+ // TODO: This used to be WasPropertyDirty("HasIdentity") but i don't think that actually worked for detecting new entities this does seem to work properly
var isNewProperty = dirtyProperty.WasPropertyDirty("Id");
if (isNewProperty) return false;
@@ -353,7 +353,7 @@ namespace Umbraco.Core.Services.Implement
public IEnumerable GetComposedOf(int id)
{
// GetAll is cheap, repository has a full dataset cache policy
- // todo - still, because it uses the cache, race conditions!
+ // TODO: still, because it uses the cache, race conditions!
var allContentTypes = GetAll(Array.Empty());
return GetComposedOf(id, allContentTypes);
}
@@ -758,7 +758,7 @@ namespace Umbraco.Core.Services.Implement
saveEventArgs.CanCancel = false;
OnSavedContainer(scope, saveEventArgs);
- //TODO: Audit trail ?
+ // TODO: Audit trail ?
return OperationResult.Attempt.Succeed(evtMsgs, container);
}
@@ -805,7 +805,7 @@ namespace Umbraco.Core.Services.Implement
OnSavedContainer(scope, args);
}
- //TODO: Audit trail ?
+ // TODO: Audit trail ?
return OperationResult.Attempt.Succeed(evtMsgs);
}
@@ -897,7 +897,7 @@ namespace Umbraco.Core.Services.Implement
OnDeletedContainer(scope, deleteEventArgs);
return OperationResult.Attempt.Succeed(evtMsgs);
- //TODO: Audit trail ?
+ // TODO: Audit trail ?
}
}
diff --git a/src/Umbraco.Core/Services/Implement/DataTypeService.cs b/src/Umbraco.Core/Services/Implement/DataTypeService.cs
index b97c3a3ee7..97368e9047 100644
--- a/src/Umbraco.Core/Services/Implement/DataTypeService.cs
+++ b/src/Umbraco.Core/Services/Implement/DataTypeService.cs
@@ -62,7 +62,7 @@ namespace Umbraco.Core.Services.Implement
scope.Complete();
scope.Events.Dispatch(SavedContainer, this, new SaveEventArgs(container, evtMsgs));
- //TODO: Audit trail ?
+ // TODO: Audit trail ?
return OperationResult.Attempt.Succeed(evtMsgs, container);
}
@@ -149,7 +149,7 @@ namespace Umbraco.Core.Services.Implement
scope.Complete();
}
- //TODO: Audit trail ?
+ // TODO: Audit trail ?
return OperationResult.Attempt.Succeed(evtMsgs);
}
@@ -182,7 +182,7 @@ namespace Umbraco.Core.Services.Implement
scope.Complete();
}
- //TODO: Audit trail ?
+ // TODO: Audit trail ?
return OperationResult.Attempt.Succeed(evtMsgs);
}
@@ -204,7 +204,7 @@ namespace Umbraco.Core.Services.Implement
_dataTypeContainerRepository.Save(container);
scope.Complete();
- // todo - triggering SavedContainer with a different name?!
+ // TODO: triggering SavedContainer with a different name?!
scope.Events.Dispatch(SavedContainer, this, new SaveEventArgs(container, evtMsgs), "RenamedContainer");
return OperationResult.Attempt.Succeed(OperationResultType.Success, evtMsgs, container);
@@ -318,7 +318,7 @@ namespace Umbraco.Core.Services.Implement
}
catch (DataOperationException ex)
{
- scope.Complete(); // todo what are we doing here exactly?
+ scope.Complete(); // TODO: what are we doing here exactly?
return OperationResult.Attempt.Fail(ex.Operation, evtMsgs);
}
}
@@ -426,8 +426,8 @@ namespace Umbraco.Core.Services.Implement
// find ContentTypes using this IDataTypeDefinition on a PropertyType, and delete
- // todo - media and members?!
- // todo - non-group properties?!
+ // TODO: media and members?!
+ // TODO: non-group properties?!
var query = Query().Where(x => x.DataTypeId == dataType.Id);
var contentTypes = _contentTypeRepository.GetByQuery(query);
foreach (var contentType in contentTypes)
diff --git a/src/Umbraco.Core/Services/Implement/EntityService.cs b/src/Umbraco.Core/Services/Implement/EntityService.cs
index ee6bdeb46d..00edde48f3 100644
--- a/src/Umbraco.Core/Services/Implement/EntityService.cs
+++ b/src/Umbraco.Core/Services/Implement/EntityService.cs
@@ -388,7 +388,7 @@ namespace Umbraco.Core.Services.Implement
{
var query = Query().Where(x => x.ParentId == parentId);
- //todo - see https://github.com/umbraco/Umbraco-CMS/pull/3460#issuecomment-434903930 we need to not load any property data at all for media
+ // TODO: see https://github.com/umbraco/Umbraco-CMS/pull/3460#issuecomment-434903930 we need to not load any property data at all for media
return ((EntityRepository)_entityRepository).GetMediaByQueryWithoutPropertyData(query);
}
}
diff --git a/src/Umbraco.Core/Services/Implement/EntityXmlSerializer.cs b/src/Umbraco.Core/Services/Implement/EntityXmlSerializer.cs
index 6b52dd4ac1..6a8514f0a0 100644
--- a/src/Umbraco.Core/Services/Implement/EntityXmlSerializer.cs
+++ b/src/Umbraco.Core/Services/Implement/EntityXmlSerializer.cs
@@ -47,7 +47,7 @@ namespace Umbraco.Core.Services.Implement
///
public XElement Serialize(IContent content,
bool published,
- bool withDescendants = false) //todo take care of usage! only used for the packager
+ bool withDescendants = false) // TODO: take care of usage! only used for the packager
{
if (content == null) throw new ArgumentNullException(nameof(content));
diff --git a/src/Umbraco.Core/Services/Implement/FileService.cs b/src/Umbraco.Core/Services/Implement/FileService.cs
index da82d38e36..f49395d73d 100644
--- a/src/Umbraco.Core/Services/Implement/FileService.cs
+++ b/src/Umbraco.Core/Services/Implement/FileService.cs
@@ -140,6 +140,24 @@ namespace Umbraco.Core.Services.Implement
}
}
+ public void CreateStyleSheetFolder(string folderPath)
+ {
+ using (var scope = ScopeProvider.CreateScope())
+ {
+ ((StylesheetRepository) _stylesheetRepository).AddFolder(folderPath);
+ scope.Complete();
+ }
+ }
+
+ public void DeleteStyleSheetFolder(string folderPath)
+ {
+ using (var scope = ScopeProvider.CreateScope())
+ {
+ ((StylesheetRepository) _stylesheetRepository).DeleteFolder(folderPath);
+ scope.Complete();
+ }
+ }
+
public Stream GetStylesheetFileContentStream(string filepath)
{
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
@@ -331,7 +349,7 @@ namespace Umbraco.Core.Services.Implement
var evtMsgs = EventMessagesFactory.Get();
- //todo: This isn't pretty because we we're required to maintain backwards compatibility so we could not change
+ // TODO: This isn't pretty because we we're required to maintain backwards compatibility so we could not change
// the event args here. The other option is to create a different event with different event
// args specifically for this method... which also isn't pretty. So fix this in v8!
var additionalData = new Dictionary
@@ -1021,7 +1039,7 @@ namespace Umbraco.Core.Services.Implement
_auditRepository.Save(new AuditItem(objectId, type, userId, entityType));
}
- //TODO Method to change name and/or alias of view template
+ // TODO: Method to change name and/or alias of view template
#region Event Handlers
diff --git a/src/Umbraco.Core/Services/Implement/KeyValueService.cs b/src/Umbraco.Core/Services/Implement/KeyValueService.cs
index b30543ed48..eb68cea25c 100644
--- a/src/Umbraco.Core/Services/Implement/KeyValueService.cs
+++ b/src/Umbraco.Core/Services/Implement/KeyValueService.cs
@@ -40,7 +40,7 @@ namespace Umbraco.Core.Services.Implement
// if already running 8, either following an upgrade or an install,
// then everything should be ok (the table should exist, etc)
- if (UmbracoVersion.LocalVersion.Major >= 8)
+ if (UmbracoVersion.LocalVersion != null && UmbracoVersion.LocalVersion.Major >= 8)
return;
// else we are upgrading from 7, we can assume that the locks table
diff --git a/src/Umbraco.Core/Services/Implement/LocalizedTextService.cs b/src/Umbraco.Core/Services/Implement/LocalizedTextService.cs
index 9401cefa7d..4f5121def7 100644
--- a/src/Umbraco.Core/Services/Implement/LocalizedTextService.cs
+++ b/src/Umbraco.Core/Services/Implement/LocalizedTextService.cs
@@ -8,7 +8,7 @@ using Umbraco.Core.Logging;
namespace Umbraco.Core.Services.Implement
{
- //TODO: Convert all of this over to Niels K's localization framework one day
+ // TODO: Convert all of this over to Niels K's localization framework one day
public class LocalizedTextService : ILocalizedTextService
{
@@ -58,7 +58,7 @@ namespace Umbraco.Core.Services.Implement
{
if (culture == null) throw new ArgumentNullException(nameof(culture));
- //TODO: Hack, see notes on ConvertToSupportedCultureWithRegionCode
+ // TODO: Hack, see notes on ConvertToSupportedCultureWithRegionCode
culture = ConvertToSupportedCultureWithRegionCode(culture);
//This is what the legacy ui service did
@@ -91,7 +91,7 @@ namespace Umbraco.Core.Services.Implement
{
if (culture == null) throw new ArgumentNullException("culture");
- //TODO: Hack, see notes on ConvertToSupportedCultureWithRegionCode
+ // TODO: Hack, see notes on ConvertToSupportedCultureWithRegionCode
culture = ConvertToSupportedCultureWithRegionCode(culture);
var result = new Dictionary();
diff --git a/src/Umbraco.Core/Services/Implement/LocalizedTextServiceFileSources.cs b/src/Umbraco.Core/Services/Implement/LocalizedTextServiceFileSources.cs
index f19dd9f63e..a0b952a75a 100644
--- a/src/Umbraco.Core/Services/Implement/LocalizedTextServiceFileSources.cs
+++ b/src/Umbraco.Core/Services/Implement/LocalizedTextServiceFileSources.cs
@@ -21,7 +21,7 @@ namespace Umbraco.Core.Services.Implement
private readonly IEnumerable _supplementFileSources;
private readonly DirectoryInfo _fileSourceFolder;
- //TODO: See other notes in this class, this is purely a hack because we store 2 letter culture file names that contain 4 letter cultures :(
+ // TODO: See other notes in this class, this is purely a hack because we store 2 letter culture file names that contain 4 letter cultures :(
private readonly Dictionary _twoLetterCultureConverter = new Dictionary();
private readonly Lazy>> _xmlSources;
@@ -60,7 +60,7 @@ namespace Umbraco.Core.Services.Implement
var localCopy = fileInfo;
var filename = Path.GetFileNameWithoutExtension(localCopy.FullName).Replace("_", "-");
- //TODO: Fix this nonsense... would have to wait until v8 to store the language files with their correct
+ // TODO: Fix this nonsense... would have to wait until v8 to store the language files with their correct
// names instead of storing them as 2 letters but actually having a 4 letter culture. wtf. So now, we
// need to check if the file is 2 letters, then open it to try to find it's 4 letter culture, then use that
// if it's successful. We're going to assume (though it seems assuming in the legacy logic is never a great idea)
@@ -150,7 +150,7 @@ namespace Umbraco.Core.Services.Implement
return _xmlSources.Value;
}
- //TODO: See other notes in this class, this is purely a hack because we store 2 letter culture file names that contain 4 letter cultures :(
+ // TODO: See other notes in this class, this is purely a hack because we store 2 letter culture file names that contain 4 letter cultures :(
public Attempt TryConvert2LetterCultureTo4Letter(string twoLetterCulture)
{
if (twoLetterCulture.Length != 2) return Attempt.Fail();
@@ -163,7 +163,7 @@ namespace Umbraco.Core.Services.Implement
: Attempt.Fail();
}
- //TODO: See other notes in this class, this is purely a hack because we store 2 letter culture file names that contain 4 letter cultures :(
+ // TODO: See other notes in this class, this is purely a hack because we store 2 letter culture file names that contain 4 letter cultures :(
public Attempt TryConvert4LetterCultureTo2Letter(CultureInfo culture)
{
if (culture == null) throw new ArgumentNullException("culture");
diff --git a/src/Umbraco.Core/Services/Implement/MediaService.cs b/src/Umbraco.Core/Services/Implement/MediaService.cs
index 357352c182..e7a42e28e4 100644
--- a/src/Umbraco.Core/Services/Implement/MediaService.cs
+++ b/src/Umbraco.Core/Services/Implement/MediaService.cs
@@ -773,8 +773,7 @@ namespace Umbraco.Core.Services.Implement
DoDelete(media);
}
- //TODO:
- // both DeleteVersions methods below have an issue. Sort of. They do NOT take care of files the way
+ //TODO: both DeleteVersions methods below have an issue. Sort of. They do NOT take care of files the way
// Delete does - for a good reason: the file may be referenced by other, non-deleted, versions. BUT,
// if that's not the case, then the file will never be deleted, because when we delete the media,
// the version referencing the file will not be there anymore. SO, we can leak files.
@@ -882,7 +881,7 @@ namespace Umbraco.Core.Services.Implement
{
scope.WriteLock(Constants.Locks.MediaTree);
- // todo - missing 7.6 "ensure valid path" thing here?
+ // TODO: missing 7.6 "ensure valid path" thing here?
// but then should be in PerformMoveLocked on every moved item?
var originalPath = media.Path;
@@ -1031,7 +1030,7 @@ namespace Umbraco.Core.Services.Implement
{
var nodeObjectType = Constants.ObjectTypes.Media;
var deleted = new List();
- var evtMsgs = EventMessagesFactory.Get(); // todo - and then?
+ var evtMsgs = EventMessagesFactory.Get(); // TODO: and then?
using (var scope = ScopeProvider.CreateScope())
{
@@ -1276,7 +1275,7 @@ namespace Umbraco.Core.Services.Implement
/// Optional id of the user deleting the media
public void DeleteMediaOfTypes(IEnumerable mediaTypeIds, int userId = 0)
{
- //TODO: This currently this is called from the ContentTypeService but that needs to change,
+ // TODO: This currently this is called from the ContentTypeService but that needs to change,
// if we are deleting a content type, we should just delete the data and do this operation slightly differently.
// This method will recursively go lookup every content item, check if any of it's descendants are
// of a different type, move them to the recycle bin, then permanently delete the content items.
diff --git a/src/Umbraco.Core/Services/Implement/MemberService.cs b/src/Umbraco.Core/Services/Implement/MemberService.cs
index 5726c43fc7..3b35896769 100644
--- a/src/Umbraco.Core/Services/Implement/MemberService.cs
+++ b/src/Umbraco.Core/Services/Implement/MemberService.cs
@@ -449,7 +449,7 @@ namespace Umbraco.Core.Services.Implement
///
public IMember GetByUsername(string username)
{
- //TODO: Somewhere in here, whether at this level or the repository level, we need to add
+ // TODO: Somewhere in here, whether at this level or the repository level, we need to add
// a caching mechanism since this method is used by all the membership providers and could be
// called quite a bit when dealing with members.
@@ -770,8 +770,8 @@ namespace Umbraco.Core.Services.Implement
throw new ArgumentOutOfRangeException(nameof(matchType)); // causes rollback // causes rollback
}
- //TODO: Since this is by property value, we need a GetByPropertyQuery on the repo!
- //TODO: Since this is by property value, we need a GetByPropertyQuery on the repo!
+ // TODO: Since this is by property value, we need a GetByPropertyQuery on the repo!
+ // TODO: Since this is by property value, we need a GetByPropertyQuery on the repo!
return _memberRepository.Get(query);
}
}
@@ -1304,7 +1304,7 @@ namespace Umbraco.Core.Services.Implement
Id = property.Id,
Alias = property.Alias,
Name = property.PropertyType.Name,
- Value = property.GetValue(), // todo ignoring variants
+ Value = property.GetValue(), // TODO: ignoring variants
CreateDate = property.CreateDate,
UpdateDate = property.UpdateDate
};
@@ -1330,8 +1330,8 @@ namespace Umbraco.Core.Services.Implement
{
scope.WriteLock(Constants.Locks.MemberTree);
- //TODO: What about content that has the contenttype as part of its composition?
- //TODO: What about content that has the contenttype as part of its composition?
+ // TODO: What about content that has the contenttype as part of its composition?
+ // TODO: What about content that has the contenttype as part of its composition?
var query = Query().Where(x => x.ContentTypeId == memberTypeId);
var members = _memberRepository.Get(query).ToArray();
diff --git a/src/Umbraco.Core/Services/Implement/NotificationService.cs b/src/Umbraco.Core/Services/Implement/NotificationService.cs
index a4aedec438..d981809364 100644
--- a/src/Umbraco.Core/Services/Implement/NotificationService.cs
+++ b/src/Umbraco.Core/Services/Implement/NotificationService.cs
@@ -307,7 +307,7 @@ namespace Umbraco.Core.Services.Implement
summary.Append("
");
foreach (var p in content.Properties)
{
- //todo doesn't take into account variants
+ // TODO: doesn't take into account variants
var newText = p.GetValue() != null ? p.GetValue().ToString() : "";
var oldText = newText;
@@ -394,7 +394,7 @@ namespace Umbraco.Core.Services.Implement
content.Id.ToString(CultureInfo.InvariantCulture),
string.Format("{2}://{0}/{1}",
string.Concat(siteUri.Authority),
- //TODO: RE-enable this so we can have a nice url
+ // TODO: RE-enable this so we can have a nice url
/*umbraco.library.NiceUrl(documentObject.Id))*/
string.Concat(content.Id, ".aspx"),
protocol),
diff --git a/src/Umbraco.Core/Services/Implement/RelationService.cs b/src/Umbraco.Core/Services/Implement/RelationService.cs
index dc9693766f..a316d04f8e 100644
--- a/src/Umbraco.Core/Services/Implement/RelationService.cs
+++ b/src/Umbraco.Core/Services/Implement/RelationService.cs
@@ -393,7 +393,7 @@ namespace Umbraco.Core.Services.Implement
if (scope.Events.DispatchCancelable(SavingRelation, this, saveEventArgs))
{
scope.Complete();
- return relation; // todo - returning sth that does not exist here?!
+ return relation; // TODO: returning sth that does not exist here?!
}
_relationRepository.Save(relation);
diff --git a/src/Umbraco.Core/Services/Implement/ScopeRepositoryService.cs b/src/Umbraco.Core/Services/Implement/ScopeRepositoryService.cs
index 784d18da4e..d7303991b5 100644
--- a/src/Umbraco.Core/Services/Implement/ScopeRepositoryService.cs
+++ b/src/Umbraco.Core/Services/Implement/ScopeRepositoryService.cs
@@ -4,7 +4,7 @@ using Umbraco.Core.Scoping;
namespace Umbraco.Core.Services.Implement
{
- // todo that one does not add anything = kill
+ // TODO: that one does not add anything = kill
public abstract class ScopeRepositoryService : RepositoryService
{
protected ScopeRepositoryService(IScopeProvider provider, ILogger logger, IEventMessagesFactory eventMessagesFactory)
diff --git a/src/Umbraco.Core/Services/Implement/UserService.cs b/src/Umbraco.Core/Services/Implement/UserService.cs
index 1a88464231..0ea77dedcc 100644
--- a/src/Umbraco.Core/Services/Implement/UserService.cs
+++ b/src/Umbraco.Core/Services/Implement/UserService.cs
@@ -109,7 +109,7 @@ namespace Umbraco.Core.Services.Implement
{
if (string.IsNullOrWhiteSpace(username)) throw new ArgumentNullOrEmptyException(nameof(username));
- //TODO: PUT lock here!!
+ // TODO: PUT lock here!!
User user;
using (var scope = ScopeProvider.CreateScope())
@@ -200,7 +200,7 @@ namespace Umbraco.Core.Services.Implement
}
catch (DbException)
{
- // todo - refactor users/upgrade
+ // TODO: refactor users/upgrade
// currently kinda accepting anything on upgrade, but that won't deal with all cases
// so we need to do it differently, see the custom UmbracoPocoDataBuilder which should
// be better BUT requires that the app restarts after the upgrade!
@@ -705,7 +705,7 @@ namespace Umbraco.Core.Services.Implement
}
catch (DbException)
{
- // todo - refactor users/upgrade
+ // TODO: refactor users/upgrade
// currently kinda accepting anything on upgrade, but that won't deal with all cases
// so we need to do it differently, see the custom UmbracoPocoDataBuilder which should
// be better BUT requires that the app restarts after the upgrade!
@@ -1218,7 +1218,7 @@ namespace Umbraco.Core.Services.Implement
///
public static event TypedEventHandler> DeletedUserGroup;
- //TODO: still don't know if we need this yet unless we start caching permissions, but that also means we'll need another
+ // TODO: still don't know if we need this yet unless we start caching permissions, but that also means we'll need another
// event on the ContentService since there's a method there to modify node permissions too, or we can proxy events if needed.
internal static event TypedEventHandler> UserGroupPermissionsAssigned;
}
diff --git a/src/Umbraco.Core/Services/OperationResult.cs b/src/Umbraco.Core/Services/OperationResult.cs
index f6349a985d..d5cdcd79fc 100644
--- a/src/Umbraco.Core/Services/OperationResult.cs
+++ b/src/Umbraco.Core/Services/OperationResult.cs
@@ -3,8 +3,7 @@ using Umbraco.Core.Events;
namespace Umbraco.Core.Services
{
- // todo
- // no need for Attempt - the operation result SHOULD KNOW if it's a success or a failure!
+ // TODO: no need for Attempt - the operation result SHOULD KNOW if it's a success or a failure!
// but then each WhateverResultType must
///
@@ -119,7 +118,7 @@ namespace Umbraco.Core.Services
return new OperationResult(OperationResultType.FailedCancelledByEvent, eventMessages);
}
- // todo - this exists to support services that still return Attempt
+ // TODO: this exists to support services that still return Attempt
// these services should directly return an OperationResult, and then this static class should be deleted
internal static class Attempt
{
diff --git a/src/Umbraco.Core/Services/OperationResultType.cs b/src/Umbraco.Core/Services/OperationResultType.cs
index 8ad24aafb8..918f1c49fa 100644
--- a/src/Umbraco.Core/Services/OperationResultType.cs
+++ b/src/Umbraco.Core/Services/OperationResultType.cs
@@ -38,8 +38,8 @@
///
/// No operation has been executed because it was not needed (eg deleting an item that doesn't exist).
///
- NoOperation = Failed | 6, // todo shouldn't it be a success?
+ NoOperation = Failed | 6, // TODO: shouldn't it be a success?
- //TODO: In the future, we might need to add more operations statuses, potentially like 'FailedByPermissions', etc...
+ // TODO: In the future, we might need to add more operations statuses, potentially like 'FailedByPermissions', etc...
}
}
diff --git a/src/Umbraco.Core/Services/PublishResultType.cs b/src/Umbraco.Core/Services/PublishResultType.cs
index 418e5c0896..1a2b52f9c9 100644
--- a/src/Umbraco.Core/Services/PublishResultType.cs
+++ b/src/Umbraco.Core/Services/PublishResultType.cs
@@ -115,7 +115,7 @@
///
/// The document could not be published because it has no publishing flags or values.
///
- FailedPublishNothingToPublish = FailedPublish | 9, // in ContentService.StrategyCanPublish - todo weird
+ FailedPublishNothingToPublish = FailedPublish | 9, // TODO: in ContentService.StrategyCanPublish - weird
///
/// The document could not be published because some mandatory cultures are missing.
diff --git a/src/Umbraco.Core/StringExtensions.cs b/src/Umbraco.Core/StringExtensions.cs
index 463e5a6a5c..95c8d3e17f 100644
--- a/src/Umbraco.Core/StringExtensions.cs
+++ b/src/Umbraco.Core/StringExtensions.cs
@@ -737,7 +737,8 @@ namespace Umbraco.Core
///
/// Refers to itself
/// The MD5 hashed string
- public static string ToMd5(this string stringToConvert)
+ [Obsolete("Please use the GenerateHash method instead. This may be removed in future versions")]
+ internal static string ToMd5(this string stringToConvert)
{
return stringToConvert.GenerateHash("MD5");
}
@@ -747,7 +748,8 @@ namespace Umbraco.Core
///
/// refers to itself
/// The SHA1 hashed string
- public static string ToSHA1(this string stringToConvert)
+ [Obsolete("Please use the GenerateHash method instead. This may be removed in future versions")]
+ internal static string ToSHA1(this string stringToConvert)
{
return stringToConvert.GenerateHash("SHA1");
}
diff --git a/src/Umbraco.Core/Strings/IUrlSegmentProvider.cs b/src/Umbraco.Core/Strings/IUrlSegmentProvider.cs
index b326a3cda6..12d2ef9a17 100644
--- a/src/Umbraco.Core/Strings/IUrlSegmentProvider.cs
+++ b/src/Umbraco.Core/Strings/IUrlSegmentProvider.cs
@@ -20,7 +20,7 @@ namespace Umbraco.Core.Strings
/// url per culture.
string GetUrlSegment(IContentBase content, string culture = null);
- //TODO: For the 301 tracking, we need to add another extended interface to this so that
+ // TODO: For the 301 tracking, we need to add another extended interface to this so that
// the RedirectTrackingEventHandler can ask the IUrlSegmentProvider if the URL is changing.
// Currently the way it works is very hacky, see notes in: RedirectTrackingEventHandler.ContentService_Publishing
}
diff --git a/src/Umbraco.Core/Strings/Utf8ToAsciiConverter.cs b/src/Umbraco.Core/Strings/Utf8ToAsciiConverter.cs
index f5b4a1cff3..91dd5a7597 100644
--- a/src/Umbraco.Core/Strings/Utf8ToAsciiConverter.cs
+++ b/src/Umbraco.Core/Strings/Utf8ToAsciiConverter.cs
@@ -3337,8 +3337,7 @@ namespace Umbraco.Core.Strings
// time for a T4 template?
// also we should support extensibility so ppl can register more cases in external code
- // todo
- // transliterates Анастасия as Anastasiya, and not Anastasia
+ // TODO: transliterates Анастасия as Anastasiya, and not Anastasia
// Ольга --> Ol'ga, Татьяна --> Tat'yana -- that's bad (?)
// Note: should ä (German umlaut) become a or ae ?
diff --git a/src/Umbraco.Core/Sync/ApplicationUrlHelper.cs b/src/Umbraco.Core/Sync/ApplicationUrlHelper.cs
index d2b7903343..a10c967866 100644
--- a/src/Umbraco.Core/Sync/ApplicationUrlHelper.cs
+++ b/src/Umbraco.Core/Sync/ApplicationUrlHelper.cs
@@ -26,7 +26,7 @@ namespace Umbraco.Core.Sync
/// in config files but is determined programmatically.
/// Must be assigned before resolution is frozen.
///
- // todo need another way to do it, eg an interface, injected!
+ // TODO: need another way to do it, eg an interface, injected!
public static Func ApplicationUrlProvider { get; set; }
internal static string GetApplicationUrl(ILogger logger, IGlobalSettings globalSettings, IUmbracoSettingsSection settings, IServerRegistrar serverRegistrar, HttpRequestBase request = null)
diff --git a/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs b/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs
index a34644e6a1..741cc2bab1 100644
--- a/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs
+++ b/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs
@@ -302,7 +302,7 @@ namespace Umbraco.Core.Sync
// (depending on what the cache refreshers are doing). I think it's best we do the one time check, process them and continue, if there are
// pending requests after being processed, they'll just be processed on the next poll.
//
- // todo not true if we're running on a background thread, assuming we can?
+ // TODO: not true if we're running on a background thread, assuming we can?
var sql = Sql().SelectAll()
.From()
diff --git a/src/Umbraco.Core/Sync/DatabaseServerRegistrar.cs b/src/Umbraco.Core/Sync/DatabaseServerRegistrar.cs
index 9ad5875edf..276ce6097c 100644
--- a/src/Umbraco.Core/Sync/DatabaseServerRegistrar.cs
+++ b/src/Umbraco.Core/Sync/DatabaseServerRegistrar.cs
@@ -7,6 +7,10 @@ namespace Umbraco.Core.Sync
///
/// A registrar that stores registered server nodes in the database.
///
+ ///
+ /// This is the default registrar which determines a server's role by using a master election process.
+ /// The master election process doesn't occur until just after startup so this election process doesn't really affect the primary startup phase.
+ ///
public sealed class DatabaseServerRegistrar : IServerRegistrar
{
private readonly Lazy _registrationService;
diff --git a/src/Umbraco.Core/Sync/IServerAddress.cs b/src/Umbraco.Core/Sync/IServerAddress.cs
index 42567c67c1..be74b8483f 100644
--- a/src/Umbraco.Core/Sync/IServerAddress.cs
+++ b/src/Umbraco.Core/Sync/IServerAddress.cs
@@ -10,6 +10,6 @@
///
string ServerAddress { get; }
- //TODO : Should probably add things like port, protocol, server name, app id
+ // TODO: Should probably add things like port, protocol, server name, app id
}
}
diff --git a/src/Umbraco.Core/Sync/ServerSyncWebServiceClient.cs b/src/Umbraco.Core/Sync/ServerSyncWebServiceClient.cs
deleted file mode 100644
index 38ba2ce189..0000000000
--- a/src/Umbraco.Core/Sync/ServerSyncWebServiceClient.cs
+++ /dev/null
@@ -1,248 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Web.Services;
-using Umbraco.Core.IO;
-
-namespace Umbraco.Core.Sync
-{
- ///
- /// The client Soap service for making distributed cache calls between servers
- ///
- [WebServiceBinding(Name = "CacheRefresherSoap", Namespace = "http://umbraco.org/webservices/")]
- [Obsolete("Legacy load balancing is obsolete and should be removed")]
- internal class ServerSyncWebServiceClient : System.Web.Services.Protocols.SoapHttpClientProtocol
- {
-
- ///
- public ServerSyncWebServiceClient()
- {
- // only set the url if the httpcontext is present, else it's set by the cache dispatcher methods (when using distributed calls)
- if (System.Web.HttpContext.Current != null)
- this.Url = "http://" + System.Web.HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + IOHelper.ResolveUrl(SystemDirectories.WebServices) + "/cacheRefresher.asmx";
-
- }
-
- ///
- [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/BulkRefresh", RequestNamespace = "http://umbraco.org/webservices/", ResponseNamespace = "http://umbraco.org/webservices/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
- public void BulkRefresh(RefreshInstruction[] instructions, string appId, string login, string password)
- {
- this.Invoke("BulkRefresh", new object[] {
- instructions,
- appId,
- login,
- password});
- }
-
- ///
- public System.IAsyncResult BeginBulkRefresh(RefreshInstruction[] instructions, string appId, string login, string password, System.AsyncCallback callback, object asyncState)
- {
- return this.BeginInvoke("BulkRefresh", new object[] {
- instructions,
- appId,
- login,
- password}, callback, asyncState);
- }
-
- ///
- public void EndBulkRefresh(System.IAsyncResult asyncResult)
- {
- this.EndInvoke(asyncResult);
- }
-
- ///
- [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RefreshAll", RequestNamespace = "http://umbraco.org/webservices/", ResponseNamespace = "http://umbraco.org/webservices/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
- public void RefreshAll(System.Guid uniqueIdentifier, string Login, string Password)
- {
- this.Invoke("RefreshAll", new object[] {
- uniqueIdentifier,
- Login,
- Password});
- }
-
- ///
- public System.IAsyncResult BeginRefreshAll(System.Guid uniqueIdentifier, string Login, string Password, System.AsyncCallback callback, object asyncState)
- {
- return this.BeginInvoke("RefreshAll", new object[] {
- uniqueIdentifier,
- Login,
- Password}, callback, asyncState);
- }
-
- ///
- public void EndRefreshAll(System.IAsyncResult asyncResult)
- {
- this.EndInvoke(asyncResult);
- }
-
- ///
- [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RefreshByJson", RequestNamespace = "http://umbraco.org/webservices/", ResponseNamespace = "http://umbraco.org/webservices/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
- public void RefreshByJson(System.Guid uniqueIdentifier, string jsonPayload, string Login, string Password)
- {
- this.Invoke("RefreshByJson", new object[] {
- uniqueIdentifier,
- jsonPayload,
- Login,
- Password});
- }
-
- ///
- public System.IAsyncResult BeginRefreshByJson(System.Guid uniqueIdentifier, string jsonPayload, string Login, string Password, System.AsyncCallback callback, object asyncState)
- {
- return this.BeginInvoke("RefreshByJson", new object[] {
- uniqueIdentifier,
- jsonPayload,
- Login,
- Password}, callback, asyncState);
- }
-
- ///
- public void EndRefreshByJson(System.IAsyncResult asyncResult)
- {
- this.EndInvoke(asyncResult);
- }
-
- ///
- [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RefreshByGuid", RequestNamespace = "http://umbraco.org/webservices/", ResponseNamespace = "http://umbraco.org/webservices/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
- public void RefreshByGuid(System.Guid uniqueIdentifier, System.Guid Id, string Login, string Password)
- {
- this.Invoke("RefreshByGuid", new object[] {
- uniqueIdentifier,
- Id,
- Login,
- Password});
- }
-
- ///
- public System.IAsyncResult BeginRefreshByGuid(System.Guid uniqueIdentifier, System.Guid Id, string Login, string Password, System.AsyncCallback callback, object asyncState)
- {
- return this.BeginInvoke("RefreshByGuid", new object[] {
- uniqueIdentifier,
- Id,
- Login,
- Password}, callback, asyncState);
- }
-
- ///
- public void EndRefreshByGuid(System.IAsyncResult asyncResult)
- {
- this.EndInvoke(asyncResult);
- }
-
- ///
- [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RefreshById",
- RequestNamespace = "http://umbraco.org/webservices/",
- ResponseNamespace = "http://umbraco.org/webservices/",
- Use = System.Web.Services.Description.SoapBindingUse.Literal,
- ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
- public void RefreshById(System.Guid uniqueIdentifier, int Id, string Login, string Password)
- {
- this.Invoke("RefreshById", new object[] {
- uniqueIdentifier,
- Id,
- Login,
- Password});
- }
-
- ///
- public System.IAsyncResult BeginRefreshById(System.Guid uniqueIdentifier, int Id, string Login, string Password, System.AsyncCallback callback, object asyncState)
- {
- return this.BeginInvoke("RefreshById", new object[] {
- uniqueIdentifier,
- Id,
- Login,
- Password}, callback, asyncState);
- }
-
- ///
- public void EndRefreshById(System.IAsyncResult asyncResult)
- {
- this.EndInvoke(asyncResult);
- }
-
-
- ///
- [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RefreshByIds",
- RequestNamespace = "http://umbraco.org/webservices/",
- ResponseNamespace = "http://umbraco.org/webservices/",
- Use = System.Web.Services.Description.SoapBindingUse.Literal,
- ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
- public void RefreshByIds(System.Guid uniqueIdentifier, string jsonIds, string Login, string Password)
- {
- this.Invoke("RefreshByIds", new object[] {
- uniqueIdentifier,
- jsonIds,
- Login,
- Password});
- }
-
- ///
- public System.IAsyncResult BeginRefreshByIds(System.Guid uniqueIdentifier, string jsonIds, string Login, string Password, System.AsyncCallback callback, object asyncState)
- {
- return this.BeginInvoke("RefreshByIds", new object[] {
- uniqueIdentifier,
- jsonIds,
- Login,
- Password}, callback, asyncState);
- }
-
- ///
- public void EndRefreshByIds(System.IAsyncResult asyncResult)
- {
- this.EndInvoke(asyncResult);
- }
-
-
-
- ///
- [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RemoveById", RequestNamespace = "http://umbraco.org/webservices/", ResponseNamespace = "http://umbraco.org/webservices/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
- public void RemoveById(System.Guid uniqueIdentifier, int Id, string Login, string Password)
- {
- this.Invoke("RemoveById", new object[] {
- uniqueIdentifier,
- Id,
- Login,
- Password});
- }
-
- ///
- public System.IAsyncResult BeginRemoveById(System.Guid uniqueIdentifier, int Id, string Login, string Password, System.AsyncCallback callback, object asyncState)
- {
- return this.BeginInvoke("RemoveById", new object[] {
- uniqueIdentifier,
- Id,
- Login,
- Password}, callback, asyncState);
- }
-
- ///
- public void EndRemoveById(System.IAsyncResult asyncResult)
- {
- this.EndInvoke(asyncResult);
- }
-
- ///
- [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/GetRefreshers", RequestNamespace = "http://umbraco.org/webservices/", ResponseNamespace = "http://umbraco.org/webservices/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
- public System.Xml.XmlNode GetRefreshers(string Login, string Password)
- {
- object[] results = this.Invoke("GetRefreshers", new object[] {
- Login,
- Password});
- return ((System.Xml.XmlNode)(results[0]));
- }
-
- ///
- public System.IAsyncResult BeginGetRefreshers(string Login, string Password, System.AsyncCallback callback, object asyncState)
- {
- return this.BeginInvoke("GetRefreshers", new object[] {
- Login,
- Password}, callback, asyncState);
- }
-
- ///
- public System.Xml.XmlNode EndGetRefreshers(System.IAsyncResult asyncResult)
- {
- object[] results = this.EndInvoke(asyncResult);
- return ((System.Xml.XmlNode)(results[0]));
- }
- }
-}
diff --git a/src/Umbraco.Core/Sync/SingleServerRegistrar.cs b/src/Umbraco.Core/Sync/SingleServerRegistrar.cs
index dec0342fc0..b29533dd51 100644
--- a/src/Umbraco.Core/Sync/SingleServerRegistrar.cs
+++ b/src/Umbraco.Core/Sync/SingleServerRegistrar.cs
@@ -3,6 +3,14 @@ using System.Collections.Generic;
namespace Umbraco.Core.Sync
{
+ ///
+ /// Can be used when Umbraco is definitely not operating in a Load Balanced scenario to micro-optimize some startup performance
+ ///
+ ///
+ /// The micro optimization is specifically to avoid a DB query just after the app starts up to determine the
+ /// which by default is done with master election by a database query. The master election process doesn't occur until just after startup
+ /// so this micro optimization doesn't really affect the primary startup phase.
+ ///
public class SingleServerRegistrar : IServerRegistrar
{
private readonly IRuntimeState _runtime;
@@ -13,7 +21,7 @@ namespace Umbraco.Core.Sync
public SingleServerRegistrar(IRuntimeState runtime)
{
_runtime = runtime;
- _registrations = new Lazy(() => new[] { new ServerAddressImpl(_runtime.ApplicationUrl.ToString()) });
+ _registrations = new Lazy(() => new IServerAddress[] { new ServerAddressImpl(_runtime.ApplicationUrl.ToString()) });
}
public ServerRole GetCurrentServerRole()
@@ -23,7 +31,7 @@ namespace Umbraco.Core.Sync
public string GetCurrentServerUmbracoApplicationUrl()
{
- return _runtime.ApplicationUrl.ToString();
+ return _runtime.ApplicationUrl?.ToString();
}
private class ServerAddressImpl : IServerAddress
diff --git a/src/Umbraco.Core/TypeExtensions.cs b/src/Umbraco.Core/TypeExtensions.cs
index 56b2026afb..1582b603d3 100644
--- a/src/Umbraco.Core/TypeExtensions.cs
+++ b/src/Umbraco.Core/TypeExtensions.cs
@@ -55,7 +55,7 @@ namespace Umbraco.Core
? getMember(memberName.ToCleanString(CleanStringType.Ascii | CleanStringType.ConvertCase | CleanStringType.CamelCase))
: getMember(memberName.ToCleanString(CleanStringType.Ascii | CleanStringType.ConvertCase | CleanStringType.PascalCase));
- //TODO: If this still fails then we should get a list of properties from the object and then compare - doing the above without listing
+ // TODO: If this still fails then we should get a list of properties from the object and then compare - doing the above without listing
// all properties will surely be faster than using reflection to get ALL properties first and then query against them.
}
diff --git a/src/Umbraco.Core/UdiEntityType.cs b/src/Umbraco.Core/UdiEntityType.cs
index 07bde1ba93..86197ce6a8 100644
--- a/src/Umbraco.Core/UdiEntityType.cs
+++ b/src/Umbraco.Core/UdiEntityType.cs
@@ -78,7 +78,7 @@ namespace Umbraco.Core
public const string DocumentType = "document-type";
public const string DocumentTypeContainer = "document-type-container";
- //TODO: What is this? This alias is only used for the blue print tree to render the blueprint's document type, it's not a real udi type
+ // TODO: What is this? This alias is only used for the blue print tree to render the blueprint's document type, it's not a real udi type
public const string DocumentTypeBluePrints = "document-type-blueprints";
public const string MediaType = "media-type";
public const string MediaTypeContainer = "media-type-container";
diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj
index 1faa913d75..ca4bd40551 100755
--- a/src/Umbraco.Core/Umbraco.Core.csproj
+++ b/src/Umbraco.Core/Umbraco.Core.csproj
@@ -231,6 +231,9 @@
+
+
+
@@ -326,8 +329,15 @@
+
+
+
+
+
+
+
@@ -368,7 +378,7 @@
-
+
@@ -388,6 +398,7 @@
+
@@ -411,6 +422,7 @@
+
@@ -461,6 +473,8 @@
+
+
@@ -1315,7 +1329,6 @@
-
@@ -1524,15 +1537,12 @@
-
-
-
+
+
+ Component
-
- Component
-
Properties\SolutionInfo.cs
diff --git a/src/Umbraco.Core/UriExtensions.cs b/src/Umbraco.Core/UriExtensions.cs
index ba3e677219..083ca90cc4 100644
--- a/src/Umbraco.Core/UriExtensions.cs
+++ b/src/Umbraco.Core/UriExtensions.cs
@@ -4,7 +4,6 @@ using System.Linq;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
-using Umbraco.Core.Logging;
namespace Umbraco.Core
{
@@ -28,7 +27,6 @@ namespace Umbraco.Core
/// If any route has an extension in the path like .aspx = back office
///
/// These are def back office:
- /// /Umbraco/RestServices = back office
/// /Umbraco/BackOffice = back office
/// /Umbraco/Preview = back office
/// If it's not any of the above, and there's no extension then we cannot determine if it's back office or front-end
@@ -78,7 +76,6 @@ namespace Umbraco.Core
//check for special back office paths
if (urlPath.InvariantStartsWith("/" + globalSettings.GetUmbracoMvcArea() + "/BackOffice/")
- || urlPath.InvariantStartsWith("/" + globalSettings.GetUmbracoMvcArea() + "/RestServices/")
|| urlPath.InvariantStartsWith("/" + globalSettings.GetUmbracoMvcArea() + "/Preview/"))
{
return true;
diff --git a/src/Umbraco.Core/Xml/UmbracoXPathPathSyntaxParser.cs b/src/Umbraco.Core/Xml/UmbracoXPathPathSyntaxParser.cs
index afe9831b72..b31fa6a8df 100644
--- a/src/Umbraco.Core/Xml/UmbracoXPathPathSyntaxParser.cs
+++ b/src/Umbraco.Core/Xml/UmbracoXPathPathSyntaxParser.cs
@@ -31,7 +31,7 @@ namespace Umbraco.Core.Xml
Func publishedContentExists)
{
- //TODO: This should probably support some of the old syntax and token replacements, currently
+ // TODO: This should probably support some of the old syntax and token replacements, currently
// it does not, there is a ticket raised here about it: http://issues.umbraco.org/issue/U4-6364
// previous tokens were: "$currentPage", "$ancestorOrSelf", "$parentPage" and I believe they were
// allowed 'inline', not just at the beginning... whether or not we want to support that is up
@@ -97,7 +97,7 @@ namespace Umbraco.Core.Xml
});
}
- //TODO: This used to just replace $root with string.Empty BUT, that would never work
+ // TODO: This used to just replace $root with string.Empty BUT, that would never work
// the root is always "/root . Need to confirm with Per why this was string.Empty before!
vars.Add("$root", q => q.Replace("$root", "/root"));
diff --git a/src/Umbraco.Core/Xml/XPath/INavigableContent.cs b/src/Umbraco.Core/Xml/XPath/INavigableContent.cs
index c48b91893a..eeb7891726 100644
--- a/src/Umbraco.Core/Xml/XPath/INavigableContent.cs
+++ b/src/Umbraco.Core/Xml/XPath/INavigableContent.cs
@@ -45,7 +45,7 @@ namespace Umbraco.Core.Xml.XPath
///
object Value(int index);
- // TODO implement the following one
+ // TODO: implement the following one
/////
///// Gets the value of a field of the navigable content, for a specified language.
diff --git a/src/Umbraco.Examine/ContentValueSetBuilder.cs b/src/Umbraco.Examine/ContentValueSetBuilder.cs
index a6262c53fc..5e0197765d 100644
--- a/src/Umbraco.Examine/ContentValueSetBuilder.cs
+++ b/src/Umbraco.Examine/ContentValueSetBuilder.cs
@@ -29,7 +29,7 @@ namespace Umbraco.Examine
///
public override IEnumerable GetValueSets(params IContent[] content)
{
- //TODO: There is a lot of boxing going on here and ultimately all values will be boxed by Lucene anyways
+ // TODO: There is a lot of boxing going on here and ultimately all values will be boxed by Lucene anyways
// but I wonder if there's a way to reduce the boxing that we have to do or if it will matter in the end since
// Lucene will do it no matter what? One idea was to create a `FieldValue` struct which would contain `object`, `object[]`, `ValueType` and `ValueType[]`
// references and then each array is an array of `FieldValue[]` and values are assigned accordingly. Not sure if it will make a difference or not.
diff --git a/src/Umbraco.Examine/ExamineExtensions.cs b/src/Umbraco.Examine/ExamineExtensions.cs
index 4fe6c359d7..19171ac6b1 100644
--- a/src/Umbraco.Examine/ExamineExtensions.cs
+++ b/src/Umbraco.Examine/ExamineExtensions.cs
@@ -48,7 +48,7 @@ namespace Umbraco.Examine
internal static bool TryParseLuceneQuery(string query)
{
- //TODO: I'd assume there would be a more strict way to parse the query but not that i can find yet, for now we'll
+ // TODO: I'd assume there would be a more strict way to parse the query but not that i can find yet, for now we'll
// also do this rudimentary check
if (!query.Contains(":"))
return false;
diff --git a/src/Umbraco.Tests.Benchmarks/BulkInsertBenchmarks.cs b/src/Umbraco.Tests.Benchmarks/BulkInsertBenchmarks.cs
index ee2e75cfad..d6dc1f8c73 100644
--- a/src/Umbraco.Tests.Benchmarks/BulkInsertBenchmarks.cs
+++ b/src/Umbraco.Tests.Benchmarks/BulkInsertBenchmarks.cs
@@ -22,7 +22,7 @@ namespace Umbraco.Tests.Benchmarks
{
private static byte[] _initDbBytes;
- // fixme - should run on LocalDb same as NPoco tests!
+ // FIXME: should run on LocalDb same as NPoco tests!
private IUmbracoDatabase GetSqlServerDatabase(ILogger logger)
{
diff --git a/src/Umbraco.Tests.Benchmarks/XmlPublishedContentInitBenchmarks.cs b/src/Umbraco.Tests.Benchmarks/XmlPublishedContentInitBenchmarks.cs
index 860dc0ac4b..bc18b97d47 100644
--- a/src/Umbraco.Tests.Benchmarks/XmlPublishedContentInitBenchmarks.cs
+++ b/src/Umbraco.Tests.Benchmarks/XmlPublishedContentInitBenchmarks.cs
@@ -145,7 +145,7 @@ namespace Umbraco.Tests.Benchmarks
XmlPublishedContent.InitializeNode(null, _xml10.DocumentElement, false,
out id, out key, out template, out sortOrder, out name, out writerName, out urlName,
out creatorName, out creatorId, out writerId, out docTypeAlias, out nodeType, out path,
- out createDate, out updateDate, out level, out isDraft, out isPublished, out publishedContentType,
+ out createDate, out updateDate, out level, out isDraft, out publishedContentType,
out properties, GetPublishedContentType);
}
@@ -155,7 +155,7 @@ namespace Umbraco.Tests.Benchmarks
XmlPublishedContent.InitializeNode(null, _xml100.DocumentElement, false,
out id, out key, out template, out sortOrder, out name, out writerName, out urlName,
out creatorName, out creatorId, out writerId, out docTypeAlias, out nodeType, out path,
- out createDate, out updateDate, out level, out isDraft, out isPublished,out publishedContentType,
+ out createDate, out updateDate, out level, out isDraft, out publishedContentType,
out properties, GetPublishedContentType);
}
@@ -165,7 +165,7 @@ namespace Umbraco.Tests.Benchmarks
XmlPublishedContent.InitializeNode(null, _xml1000.DocumentElement, false,
out id, out key, out template, out sortOrder, out name, out writerName, out urlName,
out creatorName, out creatorId, out writerId, out docTypeAlias, out nodeType, out path,
- out createDate, out updateDate, out level, out isDraft, out isPublished,out publishedContentType,
+ out createDate, out updateDate, out level, out isDraft,out publishedContentType,
out properties, GetPublishedContentType);
}
@@ -175,7 +175,7 @@ namespace Umbraco.Tests.Benchmarks
XmlPublishedContent.InitializeNode(null, _xml10000.DocumentElement, false,
out id, out key, out template, out sortOrder, out name, out writerName, out urlName,
out creatorName, out creatorId, out writerId, out docTypeAlias, out nodeType, out path,
- out createDate, out updateDate, out level, out isDraft, out isPublished,out publishedContentType,
+ out createDate, out updateDate, out level, out isDraft,out publishedContentType,
out properties, GetPublishedContentType);
}
diff --git a/src/Umbraco.Tests/Cache/AppCacheTests.cs b/src/Umbraco.Tests/Cache/AppCacheTests.cs
index 29d61cc14a..3a86feb90a 100644
--- a/src/Umbraco.Tests/Cache/AppCacheTests.cs
+++ b/src/Umbraco.Tests/Cache/AppCacheTests.cs
@@ -3,7 +3,6 @@ using System.Linq;
using System.Web.UI;
using NUnit.Framework;
using Umbraco.Core.Cache;
-using umbraco;
namespace Umbraco.Tests.Cache
{
@@ -104,9 +103,9 @@ namespace Umbraco.Tests.Cache
[Test]
public void Can_Get_By_Search()
{
- var cacheContent1 = new MacroCacheContent(new LiteralControl(), "Test1");
- var cacheContent2 = new MacroCacheContent(new LiteralControl(), "Test2");
- var cacheContent3 = new MacroCacheContent(new LiteralControl(), "Test3");
+ var cacheContent1 = new MacroCacheContent();
+ var cacheContent2 = new MacroCacheContent();
+ var cacheContent3 = new MacroCacheContent();
var cacheContent4 = new LiteralControl();
AppCache.Get("Test1", () => cacheContent1);
AppCache.Get("Tester2", () => cacheContent2);
@@ -123,9 +122,9 @@ namespace Umbraco.Tests.Cache
[Test]
public void Can_Clear_By_Expression()
{
- var cacheContent1 = new MacroCacheContent(new LiteralControl(), "Test1");
- var cacheContent2 = new MacroCacheContent(new LiteralControl(), "Test2");
- var cacheContent3 = new MacroCacheContent(new LiteralControl(), "Test3");
+ var cacheContent1 = new MacroCacheContent();
+ var cacheContent2 = new MacroCacheContent();
+ var cacheContent3 = new MacroCacheContent();
var cacheContent4 = new LiteralControl();
AppCache.Get("TTes1t", () => cacheContent1);
AppCache.Get("Tester2", () => cacheContent2);
@@ -142,9 +141,9 @@ namespace Umbraco.Tests.Cache
[Test]
public void Can_Clear_By_Search()
{
- var cacheContent1 = new MacroCacheContent(new LiteralControl(), "Test1");
- var cacheContent2 = new MacroCacheContent(new LiteralControl(), "Test2");
- var cacheContent3 = new MacroCacheContent(new LiteralControl(), "Test3");
+ var cacheContent1 = new MacroCacheContent();
+ var cacheContent2 = new MacroCacheContent();
+ var cacheContent3 = new MacroCacheContent();
var cacheContent4 = new LiteralControl();
AppCache.Get("Test1", () => cacheContent1);
AppCache.Get("Tester2", () => cacheContent2);
@@ -161,9 +160,9 @@ namespace Umbraco.Tests.Cache
[Test]
public void Can_Clear_By_Key()
{
- var cacheContent1 = new MacroCacheContent(new LiteralControl(), "Test1");
- var cacheContent2 = new MacroCacheContent(new LiteralControl(), "Test2");
- var cacheContent3 = new MacroCacheContent(new LiteralControl(), "Test3");
+ var cacheContent1 = new MacroCacheContent();
+ var cacheContent2 = new MacroCacheContent();
+ var cacheContent3 = new MacroCacheContent();
var cacheContent4 = new LiteralControl();
AppCache.Get("Test1", () => cacheContent1);
AppCache.Get("Test2", () => cacheContent2);
@@ -181,9 +180,9 @@ namespace Umbraco.Tests.Cache
[Test]
public void Can_Clear_All_Items()
{
- var cacheContent1 = new MacroCacheContent(new LiteralControl(), "Test1");
- var cacheContent2 = new MacroCacheContent(new LiteralControl(), "Test2");
- var cacheContent3 = new MacroCacheContent(new LiteralControl(), "Test3");
+ var cacheContent1 = new MacroCacheContent();
+ var cacheContent2 = new MacroCacheContent();
+ var cacheContent3 = new MacroCacheContent();
var cacheContent4 = new LiteralControl();
AppCache.Get("Test1", () => cacheContent1);
AppCache.Get("Test2", () => cacheContent2);
@@ -200,7 +199,7 @@ namespace Umbraco.Tests.Cache
[Test]
public void Can_Add_When_Not_Available()
{
- var cacheContent1 = new MacroCacheContent(new LiteralControl(), "Test1");
+ var cacheContent1 = new MacroCacheContent();
AppCache.Get("Test1", () => cacheContent1);
Assert.AreEqual(1, GetTotalItemCount);
}
@@ -208,7 +207,7 @@ namespace Umbraco.Tests.Cache
[Test]
public void Can_Get_When_Available()
{
- var cacheContent1 = new MacroCacheContent(new LiteralControl(), "Test1");
+ var cacheContent1 = new MacroCacheContent();
var result = AppCache.Get("Test1", () => cacheContent1);
var result2 = AppCache.Get("Test1", () => cacheContent1);
Assert.AreEqual(1, GetTotalItemCount);
@@ -218,9 +217,9 @@ namespace Umbraco.Tests.Cache
[Test]
public void Can_Remove_By_Type_Name()
{
- var cacheContent1 = new MacroCacheContent(new LiteralControl(), "Test1");
- var cacheContent2 = new MacroCacheContent(new LiteralControl(), "Test2");
- var cacheContent3 = new MacroCacheContent(new LiteralControl(), "Test3");
+ var cacheContent1 = new MacroCacheContent();
+ var cacheContent2 = new MacroCacheContent();
+ var cacheContent3 = new MacroCacheContent();
var cacheContent4 = new LiteralControl();
AppCache.Get("Test1", () => cacheContent1);
AppCache.Get("Test2", () => cacheContent2);
@@ -238,9 +237,9 @@ namespace Umbraco.Tests.Cache
[Test]
public void Can_Remove_By_Strong_Type()
{
- var cacheContent1 = new MacroCacheContent(new LiteralControl(), "Test1");
- var cacheContent2 = new MacroCacheContent(new LiteralControl(), "Test2");
- var cacheContent3 = new MacroCacheContent(new LiteralControl(), "Test3");
+ var cacheContent1 = new MacroCacheContent();
+ var cacheContent2 = new MacroCacheContent();
+ var cacheContent3 = new MacroCacheContent();
var cacheContent4 = new LiteralControl();
AppCache.Get("Test1", () => cacheContent1);
AppCache.Get("Test2", () => cacheContent2);
@@ -253,5 +252,10 @@ namespace Umbraco.Tests.Cache
Assert.AreEqual(1, GetTotalItemCount);
}
+
+ //just used for these tests
+ private class MacroCacheContent
+ {
+ }
}
}
diff --git a/src/Umbraco.Tests/Cache/DistributedCacheBinderTests.cs b/src/Umbraco.Tests/Cache/DistributedCacheBinderTests.cs
index 3532a11c63..e9448bd0fc 100644
--- a/src/Umbraco.Tests/Cache/DistributedCacheBinderTests.cs
+++ b/src/Umbraco.Tests/Cache/DistributedCacheBinderTests.cs
@@ -32,7 +32,7 @@ namespace Umbraco.Tests.Cache
[Test]
public void Can_Find_All_Event_Handlers()
{
- // fixme - cannot work with mocks
+ // FIXME: cannot work with mocks
// because the events are defined on actual static classes, not on the interfaces, so name matching fails
// we should really refactor events entirely - in the meantime, let it be an UmbracoTestBase ;(
//var testObjects = new TestObjects(null);
diff --git a/src/Umbraco.Tests/Cache/PublishedCache/PublishedContentCacheTests.cs b/src/Umbraco.Tests/Cache/PublishedCache/PublishedContentCacheTests.cs
index 147a159d5f..e868e32b07 100644
--- a/src/Umbraco.Tests/Cache/PublishedCache/PublishedContentCacheTests.cs
+++ b/src/Umbraco.Tests/Cache/PublishedCache/PublishedContentCacheTests.cs
@@ -59,6 +59,7 @@ namespace Umbraco.Tests.Cache.PublishedCache
var umbracoSettings = Factory.GetInstance();
var globalSettings = Factory.GetInstance();
+ var umbracoContextAccessor = Factory.GetInstance();
_xml = new XmlDocument();
_xml.LoadXml(GetXml());
@@ -66,9 +67,9 @@ namespace Umbraco.Tests.Cache.PublishedCache
var appCache = new DictionaryAppCache();
var domainCache = new DomainCache(ServiceContext.DomainService, DefaultCultureAccessor);
var publishedShapshot = new Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedSnapshot(
- new PublishedContentCache(xmlStore, domainCache, appCache, globalSettings, new SiteDomainHelper(), ContentTypesCache, null, null),
- new PublishedMediaCache(xmlStore, ServiceContext.MediaService, ServiceContext.UserService, appCache, ContentTypesCache, Factory.GetInstance()),
- new PublishedMemberCache(null, appCache, Current.Services.MemberService, ContentTypesCache),
+ new PublishedContentCache(xmlStore, domainCache, appCache, globalSettings, new SiteDomainHelper(), umbracoContextAccessor, ContentTypesCache, null, null),
+ new PublishedMediaCache(xmlStore, ServiceContext.MediaService, ServiceContext.UserService, appCache, ContentTypesCache, Factory.GetInstance(), umbracoContextAccessor),
+ new PublishedMemberCache(null, appCache, Current.Services.MemberService, ContentTypesCache, umbracoContextAccessor),
domainCache);
var publishedSnapshotService = new Mock();
publishedSnapshotService.Setup(x => x.CreatePublishedSnapshot(It.IsAny())).Returns(publishedShapshot);
diff --git a/src/Umbraco.Tests/Cache/PublishedCache/PublishedMediaCacheTests.cs b/src/Umbraco.Tests/Cache/PublishedCache/PublishedMediaCacheTests.cs
index bd4f1610cd..07a6a6ee82 100644
--- a/src/Umbraco.Tests/Cache/PublishedCache/PublishedMediaCacheTests.cs
+++ b/src/Umbraco.Tests/Cache/PublishedCache/PublishedMediaCacheTests.cs
@@ -17,6 +17,7 @@ using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Services;
using Umbraco.Tests.PublishedContent;
+using Umbraco.Web;
namespace Umbraco.Tests.Cache.PublishedCache
{
@@ -26,6 +27,7 @@ namespace Umbraco.Tests.Cache.PublishedCache
{
private Dictionary _mediaTypes;
+ private IUmbracoContextAccessor _umbracoContextAccessor;
protected override void Compose()
{
base.Compose();
@@ -33,6 +35,8 @@ namespace Umbraco.Tests.Cache.PublishedCache
Composition.WithCollectionBuilder()
.Clear()
.Append();
+
+ _umbracoContextAccessor = Current.UmbracoContextAccessor;
}
protected override void Initialize()
@@ -75,7 +79,7 @@ namespace Umbraco.Tests.Cache.PublishedCache
var mChild2 = MakeNewMedia("Child2", mType, user, mRoot2.Id);
var ctx = GetUmbracoContext("/test");
- var cache = new PublishedMediaCache(new XmlStore((XmlDocument) null, null, null, null), ServiceContext.MediaService, ServiceContext.UserService, new DictionaryAppCache(), ContentTypesCache, Factory.GetInstance());
+ var cache = new PublishedMediaCache(new XmlStore((XmlDocument) null, null, null, null), ServiceContext.MediaService, ServiceContext.UserService, new DictionaryAppCache(), ContentTypesCache, Factory.GetInstance(), Factory.GetInstance());
var roots = cache.GetAtRoot();
Assert.AreEqual(2, roots.Count());
Assert.IsTrue(roots.Select(x => x.Id).ContainsAll(new[] {mRoot1.Id, mRoot2.Id}));
@@ -93,7 +97,7 @@ namespace Umbraco.Tests.Cache.PublishedCache
//var publishedMedia = PublishedMediaTests.GetNode(mRoot.Id, GetUmbracoContext("/test", 1234));
var umbracoContext = GetUmbracoContext("/test");
- var cache = new PublishedMediaCache(new XmlStore((XmlDocument)null, null, null, null), Current.Services.MediaService, Current.Services.UserService, new DictionaryAppCache(), ContentTypesCache, Factory.GetInstance());
+ var cache = new PublishedMediaCache(new XmlStore((XmlDocument)null, null, null, null), Current.Services.MediaService, Current.Services.UserService, new DictionaryAppCache(), ContentTypesCache, Factory.GetInstance(), Factory.GetInstance());
var publishedMedia = cache.GetById(mRoot.Id);
Assert.IsNotNull(publishedMedia);
@@ -204,7 +208,7 @@ namespace Umbraco.Tests.Cache.PublishedCache
var result = new SearchResult("1234", 1, () => fields.ToDictionary(x => x.Key, x => new List { x.Value }));
- var store = new PublishedMediaCache(new XmlStore((XmlDocument)null, null, null, null), ServiceContext.MediaService, ServiceContext.UserService, new DictionaryAppCache(), ContentTypesCache, Factory.GetInstance());
+ var store = new PublishedMediaCache(new XmlStore((XmlDocument)null, null, null, null), ServiceContext.MediaService, ServiceContext.UserService, new DictionaryAppCache(), ContentTypesCache, Factory.GetInstance(), Factory.GetInstance());
var doc = store.CreateFromCacheValues(store.ConvertFromSearchResult(result));
DoAssert(doc, 1234, key, null, 0, "/media/test.jpg", "Image", 23, "Shannon", "Shannon", 0, 0, "-1,1234", DateTime.Parse("2012-07-17T10:34:09"), DateTime.Parse("2012-07-16T10:34:09"), 2);
@@ -220,7 +224,7 @@ namespace Umbraco.Tests.Cache.PublishedCache
var xmlDoc = GetMediaXml();
((XmlElement)xmlDoc.DocumentElement.FirstChild).SetAttribute("key", key.ToString());
var navigator = xmlDoc.SelectSingleNode("/root/Image").CreateNavigator();
- var cache = new PublishedMediaCache(new XmlStore((XmlDocument)null, null, null, null), ServiceContext.MediaService, ServiceContext.UserService, new DictionaryAppCache(), ContentTypesCache, Factory.GetInstance());
+ var cache = new PublishedMediaCache(new XmlStore((XmlDocument)null, null, null, null), ServiceContext.MediaService, ServiceContext.UserService, new DictionaryAppCache(), ContentTypesCache, Factory.GetInstance(), Factory.GetInstance());
var doc = cache.CreateFromCacheValues(cache.ConvertFromXPathNavigator(navigator, true));
DoAssert(doc, 2000, key, null, 2, "image1", "Image", 23, "Shannon", "Shannon", 33, 33, "-1,2000", DateTime.Parse("2012-06-12T14:13:17"), DateTime.Parse("2012-07-20T18:50:43"), 1);
@@ -319,7 +323,8 @@ namespace Umbraco.Tests.Cache.PublishedCache
// no xpath
null,
// not from examine
- false),
+ false,
+ _umbracoContextAccessor),
//callback to get the children
(dd, n) => children,
// callback to get a property
@@ -329,7 +334,8 @@ namespace Umbraco.Tests.Cache.PublishedCache
// no xpath
null,
// not from examine
- false);
+ false,
+ _umbracoContextAccessor);
return dicDoc;
}
diff --git a/src/Umbraco.Tests/Clr/ReflectionUtilitiesTests.cs b/src/Umbraco.Tests/Clr/ReflectionUtilitiesTests.cs
index f40ca3f500..0431e7d69f 100644
--- a/src/Umbraco.Tests/Clr/ReflectionUtilitiesTests.cs
+++ b/src/Umbraco.Tests/Clr/ReflectionUtilitiesTests.cs
@@ -309,7 +309,7 @@ namespace Umbraco.Tests.Clr
setterInt4(object4, 42);
Assert.AreEqual(42, object4.IntValue);
- // fixme the code below runs fine with ReSharper test running within VisualStudio
+ // FIXME: the code below runs fine with ReSharper test running within VisualStudio
// but it crashes when running via vstest.console.exe - unless some settings are required?
// converting works
@@ -552,7 +552,7 @@ namespace Umbraco.Tests.Clr
Assert.AreEqual(44, getter3(c));
}
- // fixme - missing tests specifying 'returned' on method, property
+ // FIXME: missing tests specifying 'returned' on method, property
[Test]
public void DeconstructAnonymousType()
diff --git a/src/Umbraco.Tests/Components/ComponentTests.cs b/src/Umbraco.Tests/Components/ComponentTests.cs
index a04636f919..390bb018da 100644
--- a/src/Umbraco.Tests/Components/ComponentTests.cs
+++ b/src/Umbraco.Tests/Components/ComponentTests.cs
@@ -23,7 +23,7 @@ namespace Umbraco.Tests.Components
private static IFactory MockFactory(Action> setup = null)
{
- // fixme use IUmbracoDatabaseFactory vs UmbracoDatabaseFactory, clean it all up!
+ // FIXME: use IUmbracoDatabaseFactory vs UmbracoDatabaseFactory, clean it all up!
var mock = new Mock();
@@ -444,7 +444,7 @@ namespace Umbraco.Tests.Components
#region TypeArray
- // fixme - move to Testing
+ // FIXME: move to Testing
private static Type[] TypeArray()
{
diff --git a/src/Umbraco.Tests/Composing/CollectionBuildersTests.cs b/src/Umbraco.Tests/Composing/CollectionBuildersTests.cs
index 4c262fbf82..8ea13fc920 100644
--- a/src/Umbraco.Tests/Composing/CollectionBuildersTests.cs
+++ b/src/Umbraco.Tests/Composing/CollectionBuildersTests.cs
@@ -453,7 +453,7 @@ namespace Umbraco.Tests.Composing
public class Resolved1 : Resolved
{ }
- [Weight(5)] // default is 10
+ [Weight(50)] // default is 100
public class Resolved2 : Resolved
{ }
diff --git a/src/Umbraco.Tests/Composing/ContainerConformingTests.cs b/src/Umbraco.Tests/Composing/ContainerConformingTests.cs
index 21ea961636..86226b82e7 100644
--- a/src/Umbraco.Tests/Composing/ContainerConformingTests.cs
+++ b/src/Umbraco.Tests/Composing/ContainerConformingTests.cs
@@ -143,12 +143,11 @@ namespace Umbraco.Tests.Composing
}
[Test]
- public void SingletonServiceIsUnique() // fixme - but what is LightInject actually doing
+ public void SingletonServiceIsUnique() // FIXME: but what is LightInject actually doing
{
var register = GetRegister();
- // fixme
- // LightInject is 'unique' per serviceType+serviceName
+ // FIXME: LightInject is 'unique' per serviceType+serviceName
// but that's not how all containers work
// and we should not rely on it
// if we need unique, use RegisterUnique
diff --git a/src/Umbraco.Tests/Composing/PackageActionCollectionTests.cs b/src/Umbraco.Tests/Composing/PackageActionCollectionTests.cs
index 75030decbf..fe8ca7dadc 100644
--- a/src/Umbraco.Tests/Composing/PackageActionCollectionTests.cs
+++ b/src/Umbraco.Tests/Composing/PackageActionCollectionTests.cs
@@ -8,7 +8,7 @@ using Umbraco.Core;
using Umbraco.Core.Components;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
-using Umbraco.Core._Legacy.PackageActions;
+using Umbraco.Core.PackageActions;
using Umbraco.Tests.Components;
namespace Umbraco.Tests.Composing
diff --git a/src/Umbraco.Tests/Composing/TypeFinderTests.cs b/src/Umbraco.Tests/Composing/TypeFinderTests.cs
index 49c807b19f..ca622e9288 100644
--- a/src/Umbraco.Tests/Composing/TypeFinderTests.cs
+++ b/src/Umbraco.Tests/Composing/TypeFinderTests.cs
@@ -11,7 +11,6 @@ using System.Threading;
using System.Web;
using System.Web.Compilation;
using NUnit.Framework;
-using umbraco;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.IO;
@@ -367,7 +366,6 @@ namespace Umbraco.Tests.Composing
"umbraco.interfaces,",
"umbraco.providers,",
"Umbraco.Web.UI,",
- "umbraco.webservices",
"Lucene.",
"Examine,",
"Examine.",
diff --git a/src/Umbraco.Tests/Composing/TypeLoaderTests.cs b/src/Umbraco.Tests/Composing/TypeLoaderTests.cs
index 6b3ce3eb4e..2354dc8147 100644
--- a/src/Umbraco.Tests/Composing/TypeLoaderTests.cs
+++ b/src/Umbraco.Tests/Composing/TypeLoaderTests.cs
@@ -5,7 +5,6 @@ using System.Linq;
using System.Reflection;
using Moq;
using NUnit.Framework;
-using umbraco;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
@@ -279,7 +278,7 @@ AnotherContentFinder
public void GetDataEditors()
{
var types = _typeLoader.GetDataEditors();
- Assert.AreEqual(40, types.Count());
+ Assert.AreEqual(39, types.Count());
}
///
diff --git a/src/Umbraco.Tests/Configurations/DashboardSettings/Dashboard.config b/src/Umbraco.Tests/Configurations/DashboardSettings/Dashboard.config
deleted file mode 100644
index 4c86355a1b..0000000000
--- a/src/Umbraco.Tests/Configurations/DashboardSettings/Dashboard.config
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
- settings
-
-
-
- views/dashboard/settings/settingsdashboardintro.html
-
-
- views/dashboard/settings/settingsdashboardvideos.html
-
-
-
- dashboard/ExamineManagement.ascx
-
-
-
-
-
- developer
-
-
-
- views/dashboard/developer/developerdashboardintro.html
-
-
- views/dashboard/developer/developerdashboardvideos.html
-
-
-
-
-
-
- media
-
-
-
- views/dashboard/media/mediafolderbrowser.html
-
-
-
-
- admin
-
-
- views/dashboard/media/mediadashboardintro.html
-
-
- views/dashboard/media/desktopmediauploader.html
-
-
- views/dashboard/media/mediadashboardvideos.html
-
-
-
-
-
-
- translator
- hello
- world
-
-
- content
-
-
-
- admin
-
-
- views/dashboard/default/startupdashboardintro.html
-
-
- views/dashboard/default/startupdashboardkits.html
-
- editor
- writer
-
-
-
- views/dashboard/default/startupdashboardvideos.html
-
-
-
- dashboard/latestEdits.ascx
-
-
-
- views/dashboard/changepassword.html
-
-
-
-
-
-
- default
- member
-
-
-
- views/dashboard/members/membersdashboardintro.html
-
-
- members/membersearch.ascx
-
-
- views/dashboard/members/membersdashboardvideos.html
-
-
-
-
diff --git a/src/Umbraco.Tests/Configurations/DashboardSettings/DashboardSettingsTests.cs b/src/Umbraco.Tests/Configurations/DashboardSettings/DashboardSettingsTests.cs
deleted file mode 100644
index 920de683b4..0000000000
--- a/src/Umbraco.Tests/Configurations/DashboardSettings/DashboardSettingsTests.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-using System.Configuration;
-using System.IO;
-using System.Linq;
-using NUnit.Framework;
-using Umbraco.Core.Configuration.Dashboard;
-using Umbraco.Core.Configuration.UmbracoSettings;
-using Umbraco.Tests.TestHelpers;
-
-namespace Umbraco.Tests.Configurations.DashboardSettings
-{
- [TestFixture]
- public class DashboardSettingsTests
- {
- [SetUp]
- public void Init()
- {
- var config = new FileInfo(TestHelper.MapPathForTest("~/Configurations/DashboardSettings/web.config"));
-
- var fileMap = new ExeConfigurationFileMap() { ExeConfigFilename = config.FullName };
- var configuration = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None);
-
- SettingsSection = configuration.GetSection("umbracoConfiguration/dashBoard") as DashboardSection;
-
- Assert.IsNotNull(SettingsSection);
- }
-
- protected IDashboardSection SettingsSection { get; private set; }
-
- [Test]
- public void Test_Sections()
- {
- Assert.AreEqual(5, SettingsSection.Sections.Count());
-
- Assert.AreEqual("StartupSettingsDashboardSection", SettingsSection.Sections.ElementAt(0).Alias);
- Assert.AreEqual("StartupDeveloperDashboardSection", SettingsSection.Sections.ElementAt(1).Alias);
- Assert.AreEqual("StartupMediaDashboardSection", SettingsSection.Sections.ElementAt(2).Alias);
- Assert.AreEqual("StartupDashboardSection", SettingsSection.Sections.ElementAt(3).Alias);
- Assert.AreEqual("StartupMemberDashboardSection", SettingsSection.Sections.ElementAt(4).Alias);
- }
-
- [Test]
- public void Test_Section_Area()
- {
- Assert.AreEqual("settings", SettingsSection.Sections.ElementAt(0).Areas.First());
- Assert.AreEqual("developer", SettingsSection.Sections.ElementAt(1).Areas.First());
- Assert.AreEqual("media", SettingsSection.Sections.ElementAt(2).Areas.First());
- Assert.AreEqual("content", SettingsSection.Sections.ElementAt(3).Areas.First());
- Assert.AreEqual("default", SettingsSection.Sections.ElementAt(4).Areas.First());
- Assert.AreEqual("member", SettingsSection.Sections.ElementAt(4).Areas.Last());
- }
-
- [Test]
- public void Test_Section_Access()
- {
-
- Assert.AreEqual(3, SettingsSection.Sections.ElementAt(3).AccessRights.Rules.Count());
-
- Assert.AreEqual("translator", SettingsSection.Sections.ElementAt(3).AccessRights.Rules.ElementAt(0).Value);
- Assert.AreEqual(AccessRuleType.Deny, SettingsSection.Sections.ElementAt(3).AccessRights.Rules.ElementAt(0).Type);
- Assert.AreEqual("hello", SettingsSection.Sections.ElementAt(3).AccessRights.Rules.ElementAt(1).Value);
- Assert.AreEqual(AccessRuleType.Grant, SettingsSection.Sections.ElementAt(3).AccessRights.Rules.ElementAt(1).Type);
- Assert.AreEqual("world", SettingsSection.Sections.ElementAt(3).AccessRights.Rules.ElementAt(2).Value);
- Assert.AreEqual(AccessRuleType.GrantBySection, SettingsSection.Sections.ElementAt(3).AccessRights.Rules.ElementAt(2).Type);
- }
-
- [Test]
- public void Test_Section_Tabs()
- {
- //Element 0 Alias "StartupSettingsDashboardSection"
- Assert.AreEqual(2, SettingsSection.Sections.ElementAt(0).Tabs.Count());
-
- //Element 1 Alias "StartupDeveloperDashboardSection"
- Assert.AreEqual(1, SettingsSection.Sections.ElementAt(1).Tabs.Count());
-
- //Element 2 Alias "StartupMediaDashboardSection"
- Assert.AreEqual(2, SettingsSection.Sections.ElementAt(2).Tabs.Count());
-
- //Element 3 Alias "StartupDashboardSection"
- Assert.AreEqual(3, SettingsSection.Sections.ElementAt(3).Tabs.Count());
-
- //Element 4 Alias "StartupMemberDashboardSection"
- Assert.AreEqual(1, SettingsSection.Sections.ElementAt(4).Tabs.Count());
-
- }
-
- [Test]
- public void Test_Tab()
- {
- Assert.AreEqual("Get Started", SettingsSection.Sections.ElementAt(0).Tabs.ElementAt(0).Caption);
- Assert.AreEqual(2, SettingsSection.Sections.ElementAt(0).Tabs.ElementAt(0).Controls.Count());
- }
-
- [Test]
- public void Test_Tab_Access()
- {
- Assert.AreEqual(1, SettingsSection.Sections.ElementAt(2).Tabs.ElementAt(1).AccessRights.Rules.Count());
- Assert.AreEqual(AccessRuleType.Grant, SettingsSection.Sections.ElementAt(2).Tabs.ElementAt(1).AccessRights.Rules.ElementAt(0).Type);
- Assert.AreEqual("admin", SettingsSection.Sections.ElementAt(2).Tabs.ElementAt(1).AccessRights.Rules.ElementAt(0).Value);
- }
-
- [Test]
- public void Test_Control()
- {
- Assert.AreEqual("hello", SettingsSection.Sections.ElementAt(0).Tabs.ElementAt(0).Controls.ElementAt(0).PanelCaption);
- Assert.AreEqual("views/dashboard/settings/settingsdashboardintro.html",
- SettingsSection.Sections.ElementAt(0).Tabs.ElementAt(0).Controls.ElementAt(0).ControlPath);
-
- Assert.AreEqual("", SettingsSection.Sections.ElementAt(0).Tabs.ElementAt(0).Controls.ElementAt(1).PanelCaption);
- Assert.AreEqual("views/dashboard/settings/settingsdashboardvideos.html",
- SettingsSection.Sections.ElementAt(0).Tabs.ElementAt(0).Controls.ElementAt(1).ControlPath);
- }
-
- [Test]
- public void Test_Control_Access()
- {
- Assert.AreEqual(2, SettingsSection.Sections.ElementAt(3).Tabs.ElementAt(0).Controls.ElementAt(1).AccessRights.Rules.Count());
- Assert.AreEqual(AccessRuleType.Deny, SettingsSection.Sections.ElementAt(3).Tabs.ElementAt(0).Controls.ElementAt(1).AccessRights.Rules.ElementAt(0).Type);
- Assert.AreEqual("editor", SettingsSection.Sections.ElementAt(3).Tabs.ElementAt(0).Controls.ElementAt(1).AccessRights.Rules.ElementAt(0).Value);
- Assert.AreEqual(AccessRuleType.Deny, SettingsSection.Sections.ElementAt(3).Tabs.ElementAt(0).Controls.ElementAt(1).AccessRights.Rules.ElementAt(1).Type);
- Assert.AreEqual("writer", SettingsSection.Sections.ElementAt(3).Tabs.ElementAt(0).Controls.ElementAt(1).AccessRights.Rules.ElementAt(1).Value);
- }
- }
-}
diff --git a/src/Umbraco.Tests/Configurations/DashboardSettings/web.config b/src/Umbraco.Tests/Configurations/DashboardSettings/web.config
deleted file mode 100644
index 8cf262cbff..0000000000
--- a/src/Umbraco.Tests/Configurations/DashboardSettings/web.config
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Umbraco.Tests/Configurations/GlobalSettingsTests.cs b/src/Umbraco.Tests/Configurations/GlobalSettingsTests.cs
index 8587a7b194..54080f05de 100644
--- a/src/Umbraco.Tests/Configurations/GlobalSettingsTests.cs
+++ b/src/Umbraco.Tests/Configurations/GlobalSettingsTests.cs
@@ -60,7 +60,6 @@ namespace Umbraco.Tests.Configurations
[TestCase("/install")]
[TestCase("/install/?installStep=asdf")]
[TestCase("/install/test.aspx")]
- [TestCase("/config/splashes/booting.aspx")]
public void Is_Reserved_Path_Or_Url(string url)
{
var globalSettings = TestObjects.GetGlobalSettings();
diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs
index 962d6d13a9..d1b86c6c37 100644
--- a/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs
+++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs
@@ -130,11 +130,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
{
Assert.IsTrue(SettingsSection.Content.XmlContentCheckForDiskChanges);
}
- [Test]
- public void EnableSplashWhileLoading()
- {
- Assert.IsFalse(SettingsSection.Content.EnableSplashWhileLoading);
- }
+
[Test]
public void PropertyContextHelpOption()
{
diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/umbracoSettings.config b/src/Umbraco.Tests/Configurations/UmbracoSettings/umbracoSettings.config
index dd44e23328..b3ca1524c9 100644
--- a/src/Umbraco.Tests/Configurations/UmbracoSettings/umbracoSettings.config
+++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/umbracoSettings.config
@@ -65,9 +65,6 @@
True
-
- False
-
text
diff --git a/src/Umbraco.Tests/CoreThings/EnumExtensionsTests.cs b/src/Umbraco.Tests/CoreThings/EnumExtensionsTests.cs
new file mode 100644
index 0000000000..72a55cee85
--- /dev/null
+++ b/src/Umbraco.Tests/CoreThings/EnumExtensionsTests.cs
@@ -0,0 +1,55 @@
+using NUnit.Framework;
+using Umbraco.Web.Trees;
+using Umbraco.Core;
+
+namespace Umbraco.Tests.CoreThings
+{
+ [TestFixture]
+ public class EnumExtensionsTests
+ {
+ [TestCase(TreeUse.Dialog, TreeUse.Dialog, true)]
+ [TestCase(TreeUse.Dialog, TreeUse.Main, false)]
+ [TestCase(TreeUse.Dialog | TreeUse.Main, TreeUse.Dialog, true)]
+ [TestCase(TreeUse.Dialog, TreeUse.Dialog | TreeUse.Main, false)]
+ public void HasFlagTest(TreeUse value, TreeUse test, bool expected)
+ {
+ // the built-in Enum.HasFlag() method determines whether
+ // all bits from are set (other bits can be set too)
+
+ if (expected)
+ Assert.IsTrue(value.HasFlag(test));
+ else
+ Assert.IsFalse(value.HasFlag(test));
+ }
+
+ [TestCase(TreeUse.Dialog, TreeUse.Dialog, true)]
+ [TestCase(TreeUse.Dialog, TreeUse.Main, false)]
+ [TestCase(TreeUse.Dialog | TreeUse.Main, TreeUse.Dialog, true)]
+ [TestCase(TreeUse.Dialog, TreeUse.Dialog | TreeUse.Main, false)]
+ public void HasFlagAllTest(TreeUse value, TreeUse test, bool expected)
+ {
+ // the HasFlagAll() extension method determines whether
+ // all bits from are set (other bits can be set too)
+
+ if (expected)
+ Assert.IsTrue(value.HasFlagAll(test));
+ else
+ Assert.IsFalse(value.HasFlagAll(test));
+ }
+
+ [TestCase(TreeUse.Dialog, TreeUse.Dialog, true)]
+ [TestCase(TreeUse.Dialog, TreeUse.Main, false)]
+ [TestCase(TreeUse.Dialog | TreeUse.Main, TreeUse.Dialog, true)]
+ [TestCase(TreeUse.Dialog, TreeUse.Dialog | TreeUse.Main, true)]
+ public void HasFlagAnyTest(TreeUse value, TreeUse test, bool expected)
+ {
+ // the HasFlagAny() extension method determines whether
+ // at least one bit from is set
+
+ if (expected)
+ Assert.IsTrue(value.HasFlagAny(test));
+ else
+ Assert.IsFalse(value.HasFlagAny(test));
+ }
+ }
+}
diff --git a/src/Umbraco.Tests/CoreThings/UdiTests.cs b/src/Umbraco.Tests/CoreThings/UdiTests.cs
index 35080e8c24..c700b78c4b 100644
--- a/src/Umbraco.Tests/CoreThings/UdiTests.cs
+++ b/src/Umbraco.Tests/CoreThings/UdiTests.cs
@@ -22,7 +22,7 @@ namespace Umbraco.Tests.CoreThings
[SetUp]
public void SetUp()
{
- // fixme - bad in a unit test - but Udi has a static ctor that wants it?!
+ // FIXME: bad in a unit test - but Udi has a static ctor that wants it?!
var container = new Mock();
var globalSettings = SettingsForTests.GenerateMockGlobalSettings();
container.Setup(x => x.GetInstance(typeof(TypeLoader))).Returns(
diff --git a/src/Umbraco.Tests/CoreThings/UriExtensionsTests.cs b/src/Umbraco.Tests/CoreThings/UriExtensionsTests.cs
index f253d44973..be7aec631e 100644
--- a/src/Umbraco.Tests/CoreThings/UriExtensionsTests.cs
+++ b/src/Umbraco.Tests/CoreThings/UriExtensionsTests.cs
@@ -33,7 +33,6 @@ namespace Umbraco.Tests.CoreThings
[TestCase("http://www.domain.com/umbrac", "", false)]
[TestCase("http://www.domain.com/test", "", false)]
[TestCase("http://www.domain.com/test/umbraco", "", false)]
- [TestCase("http://www.domain.com/Umbraco/restServices/blah", "", true)]
[TestCase("http://www.domain.com/Umbraco/Backoffice/blah", "", true)]
[TestCase("http://www.domain.com/Umbraco/anything", "", true)]
[TestCase("http://www.domain.com/Umbraco/anything/", "", true)]
@@ -42,8 +41,6 @@ namespace Umbraco.Tests.CoreThings
[TestCase("http://www.domain.com/myvdir/umbraco/api/blah", "myvdir", false)]
[TestCase("http://www.domain.com/MyVdir/umbraco/api/blah", "/myvdir", false)]
[TestCase("http://www.domain.com/MyVdir/Umbraco/", "myvdir", true)]
- [TestCase("http://www.domain.com/MyVdir/Umbraco/restServices/blah", "/myvdir", true)]
- [TestCase("http://www.domain.com/umbraco/webservices/legacyAjaxCalls.asmx/js", "", true)]
[TestCase("http://www.domain.com/umbraco/test/legacyAjaxCalls.ashx?some=query&blah=js", "", true)]
public void Is_Back_Office_Request(string input, string virtualPath, bool expected)
{
diff --git a/src/Umbraco.Tests/FrontEnd/UmbracoHelperTests.cs b/src/Umbraco.Tests/FrontEnd/UmbracoHelperTests.cs
index 088ef6b54b..1c0b407ac6 100644
--- a/src/Umbraco.Tests/FrontEnd/UmbracoHelperTests.cs
+++ b/src/Umbraco.Tests/FrontEnd/UmbracoHelperTests.cs
@@ -406,7 +406,7 @@ namespace Umbraco.Tests.FrontEnd
private void SetUpDependencyContainer()
{
- // fixme - bad in a unit test - but Udi has a static ctor that wants it?!
+ // FIXME: bad in a unit test - but Udi has a static ctor that wants it?!
var container = new Mock();
var globalSettings = SettingsForTests.GenerateMockGlobalSettings();
diff --git a/src/Umbraco.Tests/IO/FileSystemsTests.cs b/src/Umbraco.Tests/IO/FileSystemsTests.cs
index 52de1bbcfa..1f98fd4443 100644
--- a/src/Umbraco.Tests/IO/FileSystemsTests.cs
+++ b/src/Umbraco.Tests/IO/FileSystemsTests.cs
@@ -122,7 +122,7 @@ namespace Umbraco.Tests.IO
}
- // fixme - don't make sense anymore
+ // FIXME: don't make sense anymore
/*
[Test]
public void Cannot_Get_InvalidFileSystem()
diff --git a/src/Umbraco.Tests/IO/IoHelperTests.cs b/src/Umbraco.Tests/IO/IoHelperTests.cs
index b0e59cbb55..3f510dd57e 100644
--- a/src/Umbraco.Tests/IO/IoHelperTests.cs
+++ b/src/Umbraco.Tests/IO/IoHelperTests.cs
@@ -44,7 +44,6 @@ namespace Umbraco.Tests.IO
Assert.AreEqual(IOHelper.MapPath(SystemDirectories.Scripts, true), IOHelper.MapPath(SystemDirectories.Scripts, false));
Assert.AreEqual(IOHelper.MapPath(SystemDirectories.Umbraco, true), IOHelper.MapPath(SystemDirectories.Umbraco, false));
Assert.AreEqual(IOHelper.MapPath(SystemDirectories.UserControls, true), IOHelper.MapPath(SystemDirectories.UserControls, false));
- Assert.AreEqual(IOHelper.MapPath(SystemDirectories.WebServices, true), IOHelper.MapPath(SystemDirectories.WebServices, false));
}
[Test]
diff --git a/src/Umbraco.Tests/Logging/LogviewerTests.cs b/src/Umbraco.Tests/Logging/LogviewerTests.cs
index 2feac2ae5f..75e2c66a61 100644
--- a/src/Umbraco.Tests/Logging/LogviewerTests.cs
+++ b/src/Umbraco.Tests/Logging/LogviewerTests.cs
@@ -199,7 +199,7 @@ namespace Umbraco.Tests.Logging
Assert.IsNotNull(findItem, "We should have found the saved search, but get no results");
Assert.AreEqual(1, findItem.Count(), "Our list of searches should only contain one result");
- //TODO: Need someone to help me find out why these don't work
+ // TODO: Need someone to help me find out why these don't work
//CollectionAssert.Contains(searches, savedSearch, "Can not find the new search that was saved");
//Assert.That(searches, Contains.Item(savedSearch));
diff --git a/src/Umbraco.Tests/Manifest/ManifestParserTests.cs b/src/Umbraco.Tests/Manifest/ManifestParserTests.cs
index 4e791c0169..6605bc4546 100644
--- a/src/Umbraco.Tests/Manifest/ManifestParserTests.cs
+++ b/src/Umbraco.Tests/Manifest/ManifestParserTests.cs
@@ -7,12 +7,12 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
-using Umbraco.Core.Configuration.Dashboard;
using Umbraco.Core.Logging;
using Umbraco.Core.Manifest;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.PropertyEditors.Validators;
using Umbraco.Core.Services;
+using Umbraco.Core.Dashboards;
namespace Umbraco.Tests.Manifest
{
@@ -337,12 +337,12 @@ javascript: ['~/test.js',/*** some note about stuff asd09823-4**09234*/ '~/test2
Assert.AreEqual(2, config.Count);
Assert.IsTrue(config.ContainsKey("image"));
var c = config["image"];
- Assert.IsInstanceOf(c); // fixme - is this what we want?
+ Assert.IsInstanceOf(c); // FIXME: is this what we want?
Assert.IsTrue(config.ContainsKey("link"));
c = config["link"];
- Assert.IsInstanceOf(c); // fixme - is this what we want?
+ Assert.IsInstanceOf(c); // FIXME: is this what we want?
- // fixme - should we resolveUrl in configs?
+ // FIXME: should we resolveUrl in configs?
}
[Test]
@@ -387,7 +387,6 @@ javascript: ['~/test.js',/*** some note about stuff asd09823-4**09234*/ '~/test2
{
const string json = @"{'dashboards': [
{
- 'name': 'First One',
'alias': 'something',
'view': '~/App_Plugins/MyPackage/Dashboards/one.html',
'sections': [ 'content' ],
@@ -395,7 +394,6 @@ javascript: ['~/test.js',/*** some note about stuff asd09823-4**09234*/ '~/test2
},
{
- 'name': 'Second-One',
'alias': 'something.else',
'weight': -1,
'view': '~/App_Plugins/MyPackage/Dashboards/two.html',
@@ -406,10 +404,9 @@ javascript: ['~/test.js',/*** some note about stuff asd09823-4**09234*/ '~/test2
var manifest = _parser.ParseManifest(json);
Assert.AreEqual(2, manifest.Dashboards.Length);
- Assert.IsInstanceOf(manifest.Dashboards[0]);
+ Assert.IsInstanceOf(manifest.Dashboards[0]);
var db0 = manifest.Dashboards[0];
Assert.AreEqual("something", db0.Alias);
- Assert.AreEqual("First One", db0.Name);
Assert.AreEqual(100, db0.Weight);
Assert.AreEqual("/App_Plugins/MyPackage/Dashboards/one.html", db0.View);
Assert.AreEqual(1, db0.Sections.Length);
@@ -420,10 +417,9 @@ javascript: ['~/test.js',/*** some note about stuff asd09823-4**09234*/ '~/test2
Assert.AreEqual(AccessRuleType.Deny, db0.AccessRules[1].Type);
Assert.AreEqual("foo", db0.AccessRules[1].Value);
- Assert.IsInstanceOf(manifest.Dashboards[1]);
+ Assert.IsInstanceOf(manifest.Dashboards[1]);
var db1 = manifest.Dashboards[1];
Assert.AreEqual("something.else", db1.Alias);
- Assert.AreEqual("Second-One", db1.Name);
Assert.AreEqual(-1, db1.Weight);
Assert.AreEqual("/App_Plugins/MyPackage/Dashboards/two.html", db1.View);
Assert.AreEqual(1, db1.Sections.Length);
diff --git a/src/Umbraco.Tests/Membership/MembershipProviderBaseTests.cs b/src/Umbraco.Tests/Membership/MembershipProviderBaseTests.cs
index f1f46133c3..091ea6f9a0 100644
--- a/src/Umbraco.Tests/Membership/MembershipProviderBaseTests.cs
+++ b/src/Umbraco.Tests/Membership/MembershipProviderBaseTests.cs
@@ -120,8 +120,7 @@ namespace Umbraco.Tests.Membership
Assert.Throws(() => provider.GetPassword("test", "test"));
}
- // fixme
- // in v7 this test relies on ApplicationContext.Current being null, which makes little
+ // FIXME: in v7 this test relies on ApplicationContext.Current being null, which makes little
// sense, not going to port the weird code in MembershipProviderBase.ResetPassword, so
// what shall we do?
[Test]
diff --git a/src/Umbraco.Tests/Misc/UriUtilityTests.cs b/src/Umbraco.Tests/Misc/UriUtilityTests.cs
index 42c69d3967..33a4b45249 100644
--- a/src/Umbraco.Tests/Misc/UriUtilityTests.cs
+++ b/src/Umbraco.Tests/Misc/UriUtilityTests.cs
@@ -7,7 +7,7 @@ using Umbraco.Web;
namespace Umbraco.Tests.Misc
{
- // fixme - not testing virtual directory!
+ // FIXME: not testing virtual directory!
[TestFixture]
public class UriUtilityTests
@@ -60,32 +60,20 @@ namespace Umbraco.Tests.Misc
Assert.AreEqual(expectedUri.ToString(), resultUri.ToString());
}
- // test directoryUrl false, trailingSlash false
- [TestCase("/", "/", false, false)]
- [TestCase("/home", "/home.aspx", false, false)]
- [TestCase("/home/sub1", "/home/sub1.aspx", false, false)]
-
- // test directoryUrl false, trailingSlash true
- [TestCase("/", "/", false, true)]
- [TestCase("/home", "/home.aspx", false, true)]
- [TestCase("/home/sub1", "/home/sub1.aspx", false, true)]
// test directoryUrl true, trailingSlash false
- [TestCase("/", "/", true, false)]
- [TestCase("/home", "/home", true, false)]
- [TestCase("/home/sub1", "/home/sub1", true, false)]
+ [TestCase("/", "/", false)]
+ [TestCase("/home", "/home", false)]
+ [TestCase("/home/sub1", "/home/sub1", false)]
// test directoryUrl true, trailingSlash true
- [TestCase("/", "/", true, true)]
- [TestCase("/home", "/home/", true, true)]
- [TestCase("/home/sub1", "/home/sub1/", true, true)]
+ [TestCase("/", "/", true)]
+ [TestCase("/home", "/home/", true)]
+ [TestCase("/home/sub1", "/home/sub1/", true)]
- public void Uri_From_Umbraco(string sourceUrl, string expectedUrl, bool directoryUrls, bool trailingSlash)
+ public void Uri_From_Umbraco(string sourceUrl, string expectedUrl, bool trailingSlash)
{
- ConfigurationManager.AppSettings.Set("umbracoUseDirectoryUrls", directoryUrls ? "true" : "false");
-
var globalConfig = Mock.Get(SettingsForTests.GenerateMockGlobalSettings());
- globalConfig.Setup(x => x.UseDirectoryUrls).Returns(directoryUrls);
var settings = SettingsForTests.GenerateMockUmbracoSettings();
var requestMock = Mock.Get(settings.RequestHandler);
diff --git a/src/Umbraco.Tests/Models/LightEntityTest.cs b/src/Umbraco.Tests/Models/LightEntityTest.cs
index 1ec9f05822..f1752a7681 100644
--- a/src/Umbraco.Tests/Models/LightEntityTest.cs
+++ b/src/Umbraco.Tests/Models/LightEntityTest.cs
@@ -42,7 +42,7 @@ namespace Umbraco.Tests.Models
var result = ss.ToStream(item);
var json = result.ResultStream.ToJsonString();
- Debug.Print(json); // fixme compare with v7
+ Debug.Print(json); // FIXME: compare with v7
}
}
}
diff --git a/src/Umbraco.Tests/Models/Mapping/ContentTypeModelMappingTests.cs b/src/Umbraco.Tests/Models/Mapping/ContentTypeModelMappingTests.cs
index b2d1440010..0de416ed72 100644
--- a/src/Umbraco.Tests/Models/Mapping/ContentTypeModelMappingTests.cs
+++ b/src/Umbraco.Tests/Models/Mapping/ContentTypeModelMappingTests.cs
@@ -32,7 +32,7 @@ namespace Umbraco.Tests.Models.Mapping
{
base.SetUp();
- // fixme - are we initializing mappers that... have already been?
+ // FIXME: are we initializing mappers that... have already been?
Mapper.Reset();
Mapper.Initialize(configuration =>
{
@@ -97,7 +97,7 @@ namespace Umbraco.Tests.Models.Mapping
Assert.AreEqual(display.CreateDate, result.CreateDate);
Assert.AreEqual(display.UpdateDate, result.UpdateDate);
- //TODO: Now we need to assert all of the more complicated parts
+ // TODO: Now we need to assert all of the more complicated parts
Assert.AreEqual(display.Groups.Count(), result.PropertyGroups.Count);
for (var i = 0; i < display.Groups.Count(); i++)
{
@@ -157,7 +157,7 @@ namespace Umbraco.Tests.Models.Mapping
Assert.AreEqual(display.CreateDate, result.CreateDate);
Assert.AreEqual(display.UpdateDate, result.UpdateDate);
- //TODO: Now we need to assert all of the more complicated parts
+ // TODO: Now we need to assert all of the more complicated parts
Assert.AreEqual(display.Groups.Count(), result.PropertyGroups.Count);
for (var i = 0; i < display.Groups.Count(); i++)
{
@@ -221,7 +221,7 @@ namespace Umbraco.Tests.Models.Mapping
Assert.AreEqual(display.CreateDate, result.CreateDate);
Assert.AreEqual(display.UpdateDate, result.UpdateDate);
- //TODO: Now we need to assert all of the more complicated parts
+ // TODO: Now we need to assert all of the more complicated parts
Assert.AreEqual(display.Groups.Count(), result.PropertyGroups.Count);
for (var i = 0; i < display.Groups.Count(); i++)
{
@@ -276,7 +276,7 @@ namespace Umbraco.Tests.Models.Mapping
//Assert
- //TODO: Now we need to assert all of the more complicated parts
+ // TODO: Now we need to assert all of the more complicated parts
Assert.AreEqual(display.Groups.Count(x => x.Inherited == false), result.PropertyGroups.Count);
}
@@ -303,7 +303,7 @@ namespace Umbraco.Tests.Models.Mapping
//Assert
- //TODO: Now we need to assert all of the more complicated parts
+ // TODO: Now we need to assert all of the more complicated parts
Assert.AreEqual(display.Groups.Count(x => x.Inherited == false), result.PropertyGroups.Count);
}
@@ -337,7 +337,7 @@ namespace Umbraco.Tests.Models.Mapping
Assert.AreEqual(memberType.CreateDate, result.CreateDate);
Assert.AreEqual(memberType.UpdateDate, result.UpdateDate);
- //TODO: Now we need to assert all of the more complicated parts
+ // TODO: Now we need to assert all of the more complicated parts
Assert.AreEqual(memberType.PropertyGroups.Count(), result.Groups.Count());
for (var i = 0; i < memberType.PropertyGroups.Count(); i++)
@@ -393,7 +393,7 @@ namespace Umbraco.Tests.Models.Mapping
Assert.AreEqual(mediaType.CreateDate, result.CreateDate);
Assert.AreEqual(mediaType.UpdateDate, result.UpdateDate);
- //TODO: Now we need to assert all of the more complicated parts
+ // TODO: Now we need to assert all of the more complicated parts
Assert.AreEqual(mediaType.PropertyGroups.Count(), result.Groups.Count());
for (var i = 0; i < mediaType.PropertyGroups.Count(); i++)
@@ -447,7 +447,7 @@ namespace Umbraco.Tests.Models.Mapping
Assert.AreEqual(contentType.UpdateDate, result.UpdateDate);
Assert.AreEqual(contentType.DefaultTemplate.Alias, result.DefaultTemplate.Alias);
- //TODO: Now we need to assert all of the more complicated parts
+ // TODO: Now we need to assert all of the more complicated parts
Assert.AreEqual(contentType.PropertyGroups.Count, result.Groups.Count());
for (var i = 0; i < contentType.PropertyGroups.Count; i++)
@@ -748,7 +748,7 @@ namespace Umbraco.Tests.Models.Mapping
Assert.AreEqual(contentType.CreateDate, result.CreateDate);
Assert.AreEqual(contentType.UpdateDate, result.UpdateDate);
- //TODO: Now we need to assert all of the more complicated parts
+ // TODO: Now we need to assert all of the more complicated parts
Assert.AreEqual(contentType.CompositionPropertyGroups.Select(x => x.Name).Distinct().Count(), result.Groups.Count(x => x.IsGenericProperties == false));
Assert.AreEqual(1, result.Groups.Count(x => x.IsGenericProperties));
@@ -830,7 +830,7 @@ namespace Umbraco.Tests.Models.Mapping
Assert.AreEqual(contentType.UpdateDate, result.UpdateDate);
Assert.AreEqual(contentType.DefaultTemplate.Alias, result.DefaultTemplate.Alias);
- //TODO: Now we need to assert all of the more complicated parts
+ // TODO: Now we need to assert all of the more complicated parts
Assert.AreEqual(contentType.CompositionPropertyGroups.Select(x => x.Name).Distinct().Count(), result.Groups.Count(x => x.IsGenericProperties == false));
Assert.AreEqual(1, result.Groups.Count(x => x.IsGenericProperties));
diff --git a/src/Umbraco.Tests/Models/Mapping/UserModelMapperTests.cs b/src/Umbraco.Tests/Models/Mapping/UserModelMapperTests.cs
index f1dea9b587..bdab736cd1 100644
--- a/src/Umbraco.Tests/Models/Mapping/UserModelMapperTests.cs
+++ b/src/Umbraco.Tests/Models/Mapping/UserModelMapperTests.cs
@@ -28,7 +28,7 @@ namespace Umbraco.Tests.Models.Mapping
var userGroupSave = JsonConvert.DeserializeObject(json.Replace("@@@ID@@@", userGroup.Id.ToString()));
// failed, AutoMapper complained, "Unable to cast object of type 'WhereSelectArrayIterator`2[System.Char,System.String]' to type 'System.Collections.IList'".
- // fixmed: added ToList() in UserGroupFactory
+ // FIXME: added ToList() in UserGroupFactory
Mapper.Map(userGroupSave, userGroup);
}
}
diff --git a/src/Umbraco.Tests/Packaging/CreatedPackagesRepositoryTests.cs b/src/Umbraco.Tests/Packaging/CreatedPackagesRepositoryTests.cs
index 010572abec..df4071281c 100644
--- a/src/Umbraco.Tests/Packaging/CreatedPackagesRepositoryTests.cs
+++ b/src/Umbraco.Tests/Packaging/CreatedPackagesRepositoryTests.cs
@@ -137,7 +137,7 @@ namespace Umbraco.Tests.Packaging
def = PackageBuilder.GetById(def.Id);
Assert.AreEqual("updated", def.Name);
Assert.AreEqual(2, def.Files.Count);
- //TODO: There's a whole lot more assertions to be done
+ // TODO: There's a whole lot more assertions to be done
}
@@ -191,7 +191,7 @@ namespace Umbraco.Tests.Packaging
Assert.AreEqual("", xml.Element("umbPackage").Element("Actions").ToString(SaveOptions.DisableFormatting));
- //TODO: There's a whole lot more assertions to be done
+ // TODO: There's a whole lot more assertions to be done
}
}
}
diff --git a/src/Umbraco.Tests/Packaging/PackageInstallationTest.cs b/src/Umbraco.Tests/Packaging/PackageInstallationTest.cs
index 4256a66a2d..731ce73d3d 100644
--- a/src/Umbraco.Tests/Packaging/PackageInstallationTest.cs
+++ b/src/Umbraco.Tests/Packaging/PackageInstallationTest.cs
@@ -126,7 +126,7 @@ namespace Umbraco.Tests.Packaging
Assert.AreEqual(1, preInstallWarnings.FilesReplaced.Count());
Assert.AreEqual("bin\\Auros.DocumentTypePicker.dll", preInstallWarnings.FilesReplaced.First());
- //TODO: More Asserts
+ // TODO: More Asserts
}
[Test]
diff --git a/src/Umbraco.Tests/Persistence/DatabaseContextTests.cs b/src/Umbraco.Tests/Persistence/DatabaseContextTests.cs
index 32689fe192..c276dc35ca 100644
--- a/src/Umbraco.Tests/Persistence/DatabaseContextTests.cs
+++ b/src/Umbraco.Tests/Persistence/DatabaseContextTests.cs
@@ -54,7 +54,7 @@ namespace Umbraco.Tests.Persistence
}
[Test]
- public void CreateDatabase() // fixme - move to DatabaseBuilderTest!
+ public void CreateDatabase() // FIXME: move to DatabaseBuilderTest!
{
var path = TestHelper.CurrentAssemblyDirectory;
AppDomain.CurrentDomain.SetData("DataDirectory", path);
diff --git a/src/Umbraco.Tests/Persistence/NPocoTests/NPocoBulkInsertTests.cs b/src/Umbraco.Tests/Persistence/NPocoTests/NPocoBulkInsertTests.cs
index 3503318888..2a6c1f4e12 100644
--- a/src/Umbraco.Tests/Persistence/NPocoTests/NPocoBulkInsertTests.cs
+++ b/src/Umbraco.Tests/Persistence/NPocoTests/NPocoBulkInsertTests.cs
@@ -12,7 +12,7 @@ using Umbraco.Tests.Testing;
namespace Umbraco.Tests.Persistence.NPocoTests
{
- // fixme.npoco - is this still appropriate?
+ // FIXME: npoco - is this still appropriate?
//
[TestFixture]
[UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)]
diff --git a/src/Umbraco.Tests/Persistence/NPocoTests/NPocoFetchTests.cs b/src/Umbraco.Tests/Persistence/NPocoTests/NPocoFetchTests.cs
index 64bc825c3e..9ee50d1230 100644
--- a/src/Umbraco.Tests/Persistence/NPocoTests/NPocoFetchTests.cs
+++ b/src/Umbraco.Tests/Persistence/NPocoTests/NPocoFetchTests.cs
@@ -370,7 +370,7 @@ namespace Umbraco.Tests.Persistence.NPocoTests
var sql = scope.SqlContext.Sql()
.Select()
- .Append(", COUNT(zbThing2Group.groupId) AS groupCount") // fixme
+ .Append(", COUNT(zbThing2Group.groupId) AS groupCount") // FIXME:
.From()
.InnerJoin().On((t, t2g) => t.Id == t2g.ThingId)
.GroupBy(x => x.Id, x => x.Name);
diff --git a/src/Umbraco.Tests/Persistence/NPocoTests/PetaPocoCachesTest.cs b/src/Umbraco.Tests/Persistence/NPocoTests/PetaPocoCachesTest.cs
index db3b02bacf..f558a64499 100644
--- a/src/Umbraco.Tests/Persistence/NPocoTests/PetaPocoCachesTest.cs
+++ b/src/Umbraco.Tests/Persistence/NPocoTests/PetaPocoCachesTest.cs
@@ -15,7 +15,7 @@ using Umbraco.Tests.Testing;
namespace Umbraco.Tests.Persistence.NPocoTests
{
- // fixme.npoco - what shall we do with those tests?
+ // FIXME: npoco - what shall we do with those tests?
//
[TestFixture, Ignore("fixme - ignored test")]
[UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)]
diff --git a/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs
index 03701dd3b5..96809c7bf6 100644
--- a/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs
+++ b/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs
@@ -59,7 +59,7 @@ namespace Umbraco.Tests.Persistence.Repositories
return new EntityContainerRepository(scopeAccessor, AppCaches.Disabled, Logger, containerEntityType);
}
- //TODO Add test to verify SetDefaultTemplates updates both AllowedTemplates and DefaultTemplate(id).
+ // TODO: Add test to verify SetDefaultTemplates updates both AllowedTemplates and DefaultTemplate(id).
[Test]
public void Maps_Templates_Correctly()
diff --git a/src/Umbraco.Tests/Persistence/Repositories/PublicAccessRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/PublicAccessRepositoryTest.cs
index b7f354a2fb..b140aa078e 100644
--- a/src/Umbraco.Tests/Persistence/Repositories/PublicAccessRepositoryTest.cs
+++ b/src/Umbraco.Tests/Persistence/Repositories/PublicAccessRepositoryTest.cs
@@ -230,7 +230,7 @@ namespace Umbraco.Tests.Persistence.Repositories
//now remove a few rules from a few of the items and then add some more, this will put things 'out of order' which
//we need to verify our sort order is working for the relator
- // fixme - no "relator" in v8?!
+ // FIXME: no "relator" in v8?!
for (int i = 0; i < allEntries.Count; i++)
{
//all the even ones
diff --git a/src/Umbraco.Tests/Persistence/Repositories/RedirectUrlRepositoryTests.cs b/src/Umbraco.Tests/Persistence/Repositories/RedirectUrlRepositoryTests.cs
index 66f6655c77..652209b65b 100644
--- a/src/Umbraco.Tests/Persistence/Repositories/RedirectUrlRepositoryTests.cs
+++ b/src/Umbraco.Tests/Persistence/Repositories/RedirectUrlRepositoryTests.cs
@@ -73,7 +73,7 @@ namespace Umbraco.Tests.Persistence.Repositories
Assert.AreNotEqual(0, rurl.Id);
- // fixme - too fast = same date = key violation?
+ // FIXME: too fast = same date = key violation?
// and... can that happen in real life?
// we don't really *care* about the IX, only supposed to make things faster...
// BUT in realife we AddOrUpdate in a trx so it should be safe, always
@@ -119,7 +119,7 @@ namespace Umbraco.Tests.Persistence.Repositories
Assert.AreNotEqual(0, rurl.Id);
- // fixme - goes too fast and bam, errors, first is blah
+ // FIXME: goes too fast and bam, errors, first is blah
rurl = new RedirectUrl
{
diff --git a/src/Umbraco.Tests/Persistence/Repositories/TagRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/TagRepositoryTest.cs
index b927d23740..6acd63b2b3 100644
--- a/src/Umbraco.Tests/Persistence/Repositories/TagRepositoryTest.cs
+++ b/src/Umbraco.Tests/Persistence/Repositories/TagRepositoryTest.cs
@@ -454,7 +454,7 @@ namespace Umbraco.Tests.Persistence.Repositories
contentType.PropertyTypes.First().Id,
tags, false);
- //TODO: This would be nice to be able to map the ids back but unfortunately we are not doing this
+ // TODO: This would be nice to be able to map the ids back but unfortunately we are not doing this
//var result = repository.GetAll(new[] {tags[0].Id, tags[1].Id, tags[2].Id});
var all = repository.GetMany().ToArray();
diff --git a/src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs
index 4ee6ecf9e3..779ec45a35 100644
--- a/src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs
+++ b/src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs
@@ -234,8 +234,7 @@ namespace Umbraco.Tests.Persistence.Repositories
// Act
var updatedItem = repository.Get(user.Id);
- // fixme
- // this test cannot work, user has 2 sections but the way it's created,
+ // FIXME: this test cannot work, user has 2 sections but the way it's created,
// they don't show, so the comparison with updatedItem fails - fix!
// Assert
diff --git a/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs b/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs
index 129116bf61..b7037eb192 100644
--- a/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs
+++ b/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs
@@ -9,7 +9,6 @@ using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
-using Umbraco.Core.Profiling;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
using Umbraco.Tests.TestHelpers;
diff --git a/src/Umbraco.Tests/Published/NestedContentTests.cs b/src/Umbraco.Tests/Published/NestedContentTests.cs
index 91810d6de1..8f3b9a1df9 100644
--- a/src/Umbraco.Tests/Published/NestedContentTests.cs
+++ b/src/Umbraco.Tests/Published/NestedContentTests.cs
@@ -161,7 +161,7 @@ namespace Umbraco.Tests.Published
new TestPublishedProperty(contentType1.GetPropertyType("property1"), $@"[
{{ ""key"": ""{keyA}"", ""propertyN1"": ""foo"", ""ncContentTypeAlias"": ""contentN1"" }}
]")
- });
+ }, Mock.Of());
var value = content.Value("property1");
// nested single converter returns proper TestModel value
@@ -189,7 +189,8 @@ namespace Umbraco.Tests.Published
{{ ""key"": ""{keyA}"", ""propertyN1"": ""foo"", ""ncContentTypeAlias"": ""contentN1"" }},
{{ ""key"": ""{keyB}"", ""propertyN1"": ""bar"", ""ncContentTypeAlias"": ""contentN1"" }}
]")
- });
+ },
+ Mock.Of());
var value = content.Value("property2");
// nested many converter returns proper IEnumerable value
@@ -249,7 +250,7 @@ namespace Umbraco.Tests.Published
class TestPublishedContent : PublishedContentBase
{
- public TestPublishedContent(PublishedContentType contentType, Guid key, IEnumerable properties)
+ public TestPublishedContent(PublishedContentType contentType, Guid key, IEnumerable properties, IUmbracoContextAccessor umbracoContextAccessor): base(umbracoContextAccessor)
{
ContentType = contentType;
Key = key;
diff --git a/src/Umbraco.Tests/PublishedContent/NuCacheTests.cs b/src/Umbraco.Tests/PublishedContent/NuCacheTests.cs
index ef37a822c1..4f18320fe8 100644
--- a/src/Umbraco.Tests/PublishedContent/NuCacheTests.cs
+++ b/src/Umbraco.Tests/PublishedContent/NuCacheTests.cs
@@ -20,6 +20,7 @@ using Umbraco.Tests.Testing.Objects;
using Umbraco.Tests.Testing.Objects.Accessors;
using Umbraco.Web;
using Umbraco.Web.Cache;
+using Umbraco.Web.PublishedCache;
using Umbraco.Web.PublishedCache.NuCache;
using Umbraco.Web.PublishedCache.NuCache.DataSource;
using Umbraco.Web.Routing;
@@ -29,12 +30,13 @@ namespace Umbraco.Tests.PublishedContent
[TestFixture]
public class NuCacheTests
{
- [Test]
- public void StandaloneVariations()
- {
- // this test implements a full standalone NuCache (based upon a test IDataSource, does not
- // use any local db files, does not rely on any database) - and tests variations
+ private IPublishedSnapshotService _snapshotService;
+ private IVariationContextAccessor _variationAccesor;
+ private ContentType _contentType;
+ private PropertyType _propertyType;
+ private void Init()
+ {
Current.Reset();
Current.UnlockConfigs();
Current.Configs.Add(SettingsForTests.GenerateMockUmbracoSettings);
@@ -46,20 +48,39 @@ namespace Umbraco.Tests.PublishedContent
{
ContentTypeId = 2,
Node = new ContentNode(1, Guid.NewGuid(), 0, "-1,1", 0, -1, DateTime.Now, 0),
- DraftData = new ContentData { Name="It Works2!", Published = false, TemplateId = 0, VersionId = 2, VersionDate = DateTime.Now, WriterId = 0,
+ DraftData = new ContentData
+ {
+ Name = "It Works2!",
+ Published = false,
+ TemplateId = 0,
+ VersionId = 2,
+ VersionDate = DateTime.Now,
+ WriterId = 0,
Properties = new Dictionary { { "prop", new[]
{
new PropertyData { Culture = "", Segment = "", Value = "val2" },
new PropertyData { Culture = "fr-FR", Segment = "", Value = "val-fr2" },
- new PropertyData { Culture = "en-UK", Segment = "", Value = "val-uk2" }
+ new PropertyData { Culture = "en-UK", Segment = "", Value = "val-uk2" },
+ new PropertyData { Culture = "dk-DA", Segment = "", Value = "val-da2" },
+ new PropertyData { Culture = "de-DE", Segment = "", Value = "val-de2" }
} } },
CultureInfos = new Dictionary
{
- { "fr-FR", new CultureVariation { Name = "name-fr2", Date = new DateTime(2018, 01, 03, 01, 00, 00) } },
- { "en-UK", new CultureVariation { Name = "name-uk2", Date = new DateTime(2018, 01, 04, 01, 00, 00) } }
+ // draft data = everything, and IsDraft indicates what's edited
+ { "fr-FR", new CultureVariation { Name = "name-fr2", IsDraft = true, Date = new DateTime(2018, 01, 03, 01, 00, 00) } },
+ { "en-UK", new CultureVariation { Name = "name-uk2", IsDraft = true, Date = new DateTime(2018, 01, 04, 01, 00, 00) } },
+ { "dk-DA", new CultureVariation { Name = "name-da2", IsDraft = true, Date = new DateTime(2018, 01, 05, 01, 00, 00) } },
+ { "de-DE", new CultureVariation { Name = "name-de1", IsDraft = false, Date = new DateTime(2018, 01, 02, 01, 00, 00) } }
}
},
- PublishedData = new ContentData { Name="It Works1!", Published = true, TemplateId = 0, VersionId = 1, VersionDate = DateTime.Now, WriterId = 0,
+ PublishedData = new ContentData
+ {
+ Name = "It Works1!",
+ Published = true,
+ TemplateId = 0,
+ VersionId = 1,
+ VersionDate = DateTime.Now,
+ WriterId = 0,
Properties = new Dictionary { { "prop", new[]
{
new PropertyData { Culture = "", Segment = "", Value = "val1" },
@@ -68,8 +89,10 @@ namespace Umbraco.Tests.PublishedContent
} } },
CultureInfos = new Dictionary
{
- { "fr-FR", new CultureVariation { Name = "name-fr1", Date = new DateTime(2018, 01, 01, 01, 00, 00) } },
- { "en-UK", new CultureVariation { Name = "name-uk1", Date = new DateTime(2018, 01, 02, 01, 00, 00) } }
+ // published data = only what's actually published, and IsDraft has to be false
+ { "fr-FR", new CultureVariation { Name = "name-fr1", IsDraft = false, Date = new DateTime(2018, 01, 01, 01, 00, 00) } },
+ { "en-UK", new CultureVariation { Name = "name-uk1", IsDraft = false, Date = new DateTime(2018, 01, 02, 01, 00, 00) } },
+ { "de-DE", new CultureVariation { Name = "name-de1", IsDraft = false, Date = new DateTime(2018, 01, 02, 01, 00, 00) } }
}
}
};
@@ -88,13 +111,13 @@ namespace Umbraco.Tests.PublishedContent
dataType
};
- var propertyType = new PropertyType("Umbraco.Void.Editor", ValueStorageType.Nvarchar) { Alias = "prop", DataTypeId = 3, Variations = ContentVariation.Culture };
- var contentType = new ContentType(-1) { Id = 2, Alias = "alias-ct", Variations = ContentVariation.Culture };
- contentType.AddPropertyType(propertyType);
+ _propertyType = new PropertyType("Umbraco.Void.Editor", ValueStorageType.Nvarchar) { Alias = "prop", DataTypeId = 3, Variations = ContentVariation.Culture };
+ _contentType = new ContentType(-1) { Id = 2, Alias = "alias-ct", Variations = ContentVariation.Culture };
+ _contentType.AddPropertyType(_propertyType);
var contentTypes = new[]
{
- contentType
+ _contentType
};
var contentTypeService = Mock.Of();
@@ -106,10 +129,10 @@ namespace Umbraco.Tests.PublishedContent
// create a service context
var serviceContext = ServiceContext.CreatePartial(
- dataTypeService : dataTypeService,
+ dataTypeService: dataTypeService,
memberTypeService: Mock.Of(),
memberService: Mock.Of(),
- contentTypeService : contentTypeService,
+ contentTypeService: contentTypeService,
localizationService: Mock.Of()
);
@@ -132,18 +155,19 @@ namespace Umbraco.Tests.PublishedContent
dataTypeService);
// create a variation accessor
- var variationAccessor = new TestVariationContextAccessor();
+ _variationAccesor = new TestVariationContextAccessor();
// at last, create the complete NuCache snapshot service!
var options = new PublishedSnapshotService.Options { IgnoreLocalDb = true };
- var snapshotService = new PublishedSnapshotService(options,
+ _snapshotService = new PublishedSnapshotService(options,
null,
runtime,
serviceContext,
contentTypeFactory,
null,
new TestPublishedSnapshotAccessor(),
- variationAccessor,
+ _variationAccesor,
+ Mock.Of(),
Mock.Of(),
scopeProvider,
Mock.Of(),
@@ -155,12 +179,21 @@ namespace Umbraco.Tests.PublishedContent
new SiteDomainHelper(),
Mock.Of());
- // get a snapshot, get a published content
- var snapshot = snapshotService.CreatePublishedSnapshot(previewToken: null);
- var publishedContent = snapshot.Content.GetById(1);
-
// invariant is the current default
- variationAccessor.VariationContext = new VariationContext();
+ _variationAccesor.VariationContext = new VariationContext();
+ }
+
+ [Test]
+ public void StandaloneVariations()
+ {
+ // this test implements a full standalone NuCache (based upon a test IDataSource, does not
+ // use any local db files, does not rely on any database) - and tests variations
+
+ Init();
+
+ // get a snapshot, get a published content
+ var snapshot = _snapshotService.CreatePublishedSnapshot(previewToken: null);
+ var publishedContent = snapshot.Content.GetById(1);
Assert.IsNotNull(publishedContent);
Assert.AreEqual("It Works1!", publishedContent.Name);
@@ -181,31 +214,31 @@ namespace Umbraco.Tests.PublishedContent
Assert.AreEqual("name-uk2", draftContent.GetCulture("en-UK").Name);
// now french is default
- variationAccessor.VariationContext = new VariationContext("fr-FR");
+ _variationAccesor.VariationContext = new VariationContext("fr-FR");
Assert.AreEqual("val-fr1", publishedContent.Value("prop"));
Assert.AreEqual("name-fr1", publishedContent.GetCulture().Name);
Assert.AreEqual("name-fr1", publishedContent.Name);
Assert.AreEqual(new DateTime(2018, 01, 01, 01, 00, 00), publishedContent.GetCulture().Date);
// now uk is default
- variationAccessor.VariationContext = new VariationContext("en-UK");
+ _variationAccesor.VariationContext = new VariationContext("en-UK");
Assert.AreEqual("val-uk1", publishedContent.Value("prop"));
Assert.AreEqual("name-uk1", publishedContent.GetCulture().Name);
Assert.AreEqual("name-uk1", publishedContent.Name);
Assert.AreEqual(new DateTime(2018, 01, 02, 01, 00, 00), publishedContent.GetCulture().Date);
- // invariant needs to be retrieved explicitely, when it's not default
+ // invariant needs to be retrieved explicitly, when it's not default
Assert.AreEqual("val1", publishedContent.Value("prop", culture: ""));
// but,
// if the content type / property type does not vary, then it's all invariant again
// modify the content type and property type, notify the snapshot service
- contentType.Variations = ContentVariation.Nothing;
- propertyType.Variations = ContentVariation.Nothing;
- snapshotService.Notify(new[] { new ContentTypeCacheRefresher.JsonPayload("IContentType", publishedContent.ContentType.Id, ContentTypeChangeTypes.RefreshMain) });
+ _contentType.Variations = ContentVariation.Nothing;
+ _propertyType.Variations = ContentVariation.Nothing;
+ _snapshotService.Notify(new[] { new ContentTypeCacheRefresher.JsonPayload("IContentType", publishedContent.ContentType.Id, ContentTypeChangeTypes.RefreshMain) });
// get a new snapshot (nothing changed in the old one), get the published content again
- var anotherSnapshot = snapshotService.CreatePublishedSnapshot(previewToken: null);
+ var anotherSnapshot = _snapshotService.CreatePublishedSnapshot(previewToken: null);
var againContent = anotherSnapshot.Content.GetById(1);
Assert.AreEqual(ContentVariation.Nothing, againContent.ContentType.Variations);
@@ -215,5 +248,42 @@ namespace Umbraco.Tests.PublishedContent
Assert.AreEqual("It Works1!", againContent.Name);
Assert.AreEqual("val1", againContent.Value("prop"));
}
+
+ [Test]
+ public void IsDraftIsPublished()
+ {
+ Init();
+
+ // get the published published content
+ var s = _snapshotService.CreatePublishedSnapshot(null);
+ var c1 = s.Content.GetById(1);
+
+ // published content = nothing is draft here
+ Assert.IsFalse(c1.IsDraft("fr-FR"));
+ Assert.IsFalse(c1.IsDraft("en-UK"));
+ Assert.IsFalse(c1.IsDraft("dk-DA"));
+ Assert.IsFalse(c1.IsDraft("de-DE"));
+
+ // and only those with published name, are published
+ Assert.IsTrue(c1.IsPublished("fr-FR"));
+ Assert.IsTrue(c1.IsPublished("en-UK"));
+ Assert.IsFalse(c1.IsDraft("dk-DA"));
+ Assert.IsTrue(c1.IsPublished("de-DE"));
+
+ // get the draft published content
+ var c2 = s.Content.GetById(true, 1);
+
+ // draft content = we have drafts
+ Assert.IsTrue(c2.IsDraft("fr-FR"));
+ Assert.IsTrue(c2.IsDraft("en-UK"));
+ Assert.IsTrue(c2.IsDraft("dk-DA"));
+ Assert.IsFalse(c2.IsDraft("de-DE")); // except for the one that does not
+
+ // and only those with published name, are published
+ Assert.IsTrue(c2.IsPublished("fr-FR"));
+ Assert.IsTrue(c2.IsPublished("en-UK"));
+ Assert.IsFalse(c2.IsPublished("dk-DA"));
+ Assert.IsTrue(c2.IsPublished("de-DE"));
+ }
}
}
diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentLanguageVariantTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentLanguageVariantTests.cs
index 42703f9bae..ac1c57d409 100644
--- a/src/Umbraco.Tests/PublishedContent/PublishedContentLanguageVariantTests.cs
+++ b/src/Umbraco.Tests/PublishedContent/PublishedContentLanguageVariantTests.cs
@@ -335,7 +335,7 @@ namespace Umbraco.Tests.PublishedContent
{
var content = UmbracoContext.Current.ContentCache.GetAtRoot().First().Children.First();
- // hack the value, pretend the converter would return something
+ // HACK: the value, pretend the converter would return something
var prop = content.GetProperty("welcomeText") as SolidPublishedPropertyWithLanguageVariants;
Assert.IsNotNull(prop);
prop.SetValue("nl", "nope"); // HasValue false but getting value returns this
diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs
index d18c6b6668..c5bcd29589 100644
--- a/src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs
+++ b/src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs
@@ -20,7 +20,7 @@ namespace Umbraco.Tests.PublishedContent
{
base.Compose();
- // fixme - what about the if (PropertyValueConvertersResolver.HasCurrent == false) ??
+ // FIXME: what about the if (PropertyValueConvertersResolver.HasCurrent == false) ??
// can we risk double - registering and then, what happens?
Composition.WithCollectionBuilder()
diff --git a/src/Umbraco.Tests/PublishedContent/PublishedMediaTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedMediaTests.cs
index dfb51e83fb..bc1d8c2b70 100644
--- a/src/Umbraco.Tests/PublishedContent/PublishedMediaTests.cs
+++ b/src/Umbraco.Tests/PublishedContent/PublishedMediaTests.cs
@@ -69,7 +69,7 @@ namespace Umbraco.Tests.PublishedContent
{
var cache = new PublishedMediaCache(new XmlStore((XmlDocument)null, null, null, null),
ServiceContext.MediaService, ServiceContext.UserService, new DictionaryAppCache(), ContentTypesCache,
- Factory.GetInstance());
+ Factory.GetInstance(), Factory.GetInstance());
var doc = cache.GetById(id);
Assert.IsNotNull(doc);
return doc;
@@ -482,7 +482,7 @@ namespace Umbraco.Tests.PublishedContent
");
var node = xml.DescendantsAndSelf("Image").Single(x => (int)x.Attribute("id") == nodeId);
- var publishedMedia = new PublishedMediaCache(new XmlStore((XmlDocument)null, null, null, null), ServiceContext.MediaService, ServiceContext.UserService, new DictionaryAppCache(), ContentTypesCache, Factory.GetInstance());
+ var publishedMedia = new PublishedMediaCache(new XmlStore((XmlDocument)null, null, null, null), ServiceContext.MediaService, ServiceContext.UserService, new DictionaryAppCache(), ContentTypesCache, Factory.GetInstance(), Factory.GetInstance());
var nav = node.CreateNavigator();
@@ -502,7 +502,7 @@ namespace Umbraco.Tests.PublishedContent
var errorXml = new XElement("error", string.Format("No media is maching '{0}'", 1234));
var nav = errorXml.CreateNavigator();
- var publishedMedia = new PublishedMediaCache(new XmlStore((XmlDocument)null, null, null, null), ServiceContext.MediaService, ServiceContext.UserService, new DictionaryAppCache(), ContentTypesCache, Factory.GetInstance());
+ var publishedMedia = new PublishedMediaCache(new XmlStore((XmlDocument)null, null, null, null), ServiceContext.MediaService, ServiceContext.UserService, new DictionaryAppCache(), ContentTypesCache, Factory.GetInstance(), Factory.GetInstance());
var converted = publishedMedia.ConvertFromXPathNodeIterator(nav.Select("/"), 1234);
Assert.IsNull(converted);
diff --git a/src/Umbraco.Tests/PublishedContent/PublishedRouterTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedRouterTests.cs
index 0e360bae58..d8dbabb569 100644
--- a/src/Umbraco.Tests/PublishedContent/PublishedRouterTests.cs
+++ b/src/Umbraco.Tests/PublishedContent/PublishedRouterTests.cs
@@ -51,7 +51,7 @@ namespace Umbraco.Tests.PublishedContent
request.PublishedContent = content.Object;
publishedRouter.ConfigureRequest(request);
- Assert.IsNotNull(request.UmbracoPage);
+ Assert.IsNotNull(request.LegacyContentHashTable);
}
private Mock GetPublishedContentMock()
diff --git a/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs b/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs
index 2d14aa1c08..0b98ec64b6 100644
--- a/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs
+++ b/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs
@@ -28,7 +28,7 @@ namespace Umbraco.Tests.Publishing
[Test]
public void Can_Publish_And_Update_Xml_Cache()
{
- //TODO Create new test
+ // TODO: Create new test
}
public IEnumerable CreateTestData()
diff --git a/src/Umbraco.Tests/Routing/ContentFinderByAliasTests.cs b/src/Umbraco.Tests/Routing/ContentFinderByAliasTests.cs
index 4059cb1858..2aa01916fb 100644
--- a/src/Umbraco.Tests/Routing/ContentFinderByAliasTests.cs
+++ b/src/Umbraco.Tests/Routing/ContentFinderByAliasTests.cs
@@ -9,7 +9,7 @@ using Umbraco.Web.Routing;
namespace Umbraco.Tests.Routing
{
- //TODO: We should be able to decouple this from the base db tests since we're just mocking the services now
+ // TODO: We should be able to decouple this from the base db tests since we're just mocking the services now
[TestFixture]
public class ContentFinderByAliasTests : UrlRoutingTestBase
diff --git a/src/Umbraco.Tests/Routing/ContentFinderByPageIdQueryTests.cs b/src/Umbraco.Tests/Routing/ContentFinderByPageIdQueryTests.cs
index 8bbd7c6679..c1abb5a3a5 100644
--- a/src/Umbraco.Tests/Routing/ContentFinderByPageIdQueryTests.cs
+++ b/src/Umbraco.Tests/Routing/ContentFinderByPageIdQueryTests.cs
@@ -10,9 +10,9 @@ namespace Umbraco.Tests.Routing
{
[TestCase("/?umbPageId=1046", 1046)]
[TestCase("/?UMBPAGEID=1046", 1046)]
- [TestCase("/default.aspx?umbPageId=1046", 1046)] //TODO: Should this match??
- [TestCase("/some/other/page?umbPageId=1046", 1046)] //TODO: Should this match??
- [TestCase("/some/other/page.aspx?umbPageId=1046", 1046)] //TODO: Should this match??
+ [TestCase("/default.aspx?umbPageId=1046", 1046)] // TODO: Should this match??
+ [TestCase("/some/other/page?umbPageId=1046", 1046)] // TODO: Should this match??
+ [TestCase("/some/other/page.aspx?umbPageId=1046", 1046)] // TODO: Should this match??
public void Lookup_By_Page_Id(string urlAsString, int nodeMatch)
{
var umbracoContext = GetUmbracoContext(urlAsString);
diff --git a/src/Umbraco.Tests/Routing/ContentFinderByUrlTests.cs b/src/Umbraco.Tests/Routing/ContentFinderByUrlTests.cs
index fa8beea2c2..85168e4490 100644
--- a/src/Umbraco.Tests/Routing/ContentFinderByUrlTests.cs
+++ b/src/Umbraco.Tests/Routing/ContentFinderByUrlTests.cs
@@ -39,7 +39,7 @@ namespace Umbraco.Tests.Routing
Assert.IsTrue(Current.Configs.Global().HideTopLevelNodeFromPath);
- // fixme debugging - going further down, the routes cache is NOT empty?!
+ // FIXME: debugging - going further down, the routes cache is NOT empty?!
if (urlString == "/home/sub1")
System.Diagnostics.Debugger.Break();
diff --git a/src/Umbraco.Tests/Routing/GetContentUrlsTests.cs b/src/Umbraco.Tests/Routing/GetContentUrlsTests.cs
index 8e9e52258c..46b10929cf 100644
--- a/src/Umbraco.Tests/Routing/GetContentUrlsTests.cs
+++ b/src/Umbraco.Tests/Routing/GetContentUrlsTests.cs
@@ -45,7 +45,7 @@ namespace Umbraco.Tests.Routing
{
var contentType = MockedContentTypes.CreateBasicContentType();
var content = MockedContent.CreateBasicContent(contentType);
- content.Id = 1046; //fixme: we are using this ID only because it's built into the test XML published cache
+ content.Id = 1046; // FIXME: we are using this ID only because it's built into the test XML published cache
content.Path = "-1,1046";
var umbContext = GetUmbracoContext("http://localhost:8000");
@@ -66,7 +66,7 @@ namespace Umbraco.Tests.Routing
{
var contentType = MockedContentTypes.CreateBasicContentType();
var content = MockedContent.CreateBasicContent(contentType);
- content.Id = 1046; //fixme: we are using this ID only because it's built into the test XML published cache
+ content.Id = 1046; // FIXME: we are using this ID only because it's built into the test XML published cache
content.Path = "-1,1046";
content.Published = true;
@@ -92,13 +92,13 @@ namespace Umbraco.Tests.Routing
{
var contentType = MockedContentTypes.CreateBasicContentType();
var parent = MockedContent.CreateBasicContent(contentType);
- parent.Id = 1046; //fixme: we are using this ID only because it's built into the test XML published cache
+ parent.Id = 1046; // FIXME: we are using this ID only because it's built into the test XML published cache
parent.Name = "home";
parent.Path = "-1,1046";
parent.Published = true;
var child = MockedContent.CreateBasicContent(contentType);
child.Name = "sub1";
- child.Id = 1173; //fixme: we are using this ID only because it's built into the test XML published cache
+ child.Id = 1173; // FIXME: we are using this ID only because it's built into the test XML published cache
child.Path = "-1,1046,1173";
child.Published = true;
@@ -119,7 +119,7 @@ namespace Umbraco.Tests.Routing
Assert.IsTrue(urls[0].IsUrl);
}
- //TODO: We need a lot of tests here, the above was just to get started with being able to unit test this method
+ // TODO: We need a lot of tests here, the above was just to get started with being able to unit test this method
// * variant URLs without domains assigned, what happens?
// * variant URLs with domains assigned, but also having more languages installed than there are domains/cultures assigned
// * variant URLs with an ancestor culture unpublished
diff --git a/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs b/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs
index e681c8556d..71e3836b3d 100644
--- a/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs
+++ b/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs
@@ -57,7 +57,7 @@ namespace Umbraco.Tests.Routing
base.Compose();
// set the default RenderMvcController
- Current.DefaultRenderMvcControllerType = typeof(RenderMvcController); // fixme WRONG!
+ Current.DefaultRenderMvcControllerType = typeof(RenderMvcController); // FIXME: Wrong!
var surfaceControllerTypes = new SurfaceControllerTypeCollection(Composition.TypeLoader.GetSurfaceControllers());
Composition.RegisterUnique(surfaceControllerTypes);
@@ -97,7 +97,6 @@ namespace Umbraco.Tests.Routing
var frequest = publishedRouter.CreateRequest(umbracoContext);
frequest.PublishedContent = umbracoContext.ContentCache.GetById(1174);
frequest.TemplateModel = template;
- frequest.RenderingEngine = RenderingEngine.Mvc;
var handler = new RenderRouteHandler(umbracoContext, new TestControllerFactory(umbracoContext, Mock.Of()));
@@ -110,7 +109,7 @@ namespace Umbraco.Tests.Routing
//test all template name styles to match the ActionName
- //[TestCase("home-\\234^^*32page")] //TODO: This fails!
+ //[TestCase("home-\\234^^*32page")] // TODO: This fails!
[TestCase("home-page")]
[TestCase("home-page")]
[TestCase("home-page")]
diff --git a/src/Umbraco.Tests/Routing/RoutesCacheTests.cs b/src/Umbraco.Tests/Routing/RoutesCacheTests.cs
index 68e80076dd..76c2a45ab2 100644
--- a/src/Umbraco.Tests/Routing/RoutesCacheTests.cs
+++ b/src/Umbraco.Tests/Routing/RoutesCacheTests.cs
@@ -22,7 +22,7 @@ namespace Umbraco.Tests.Routing
var cache = umbracoContext.PublishedSnapshot.Content as PublishedContentCache;
if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the Xml one is supported.");
- // fixme not sure?
+ // FIXME: not sure?
//PublishedContentCache.UnitTesting = false; // else does not write to routes cache
//Assert.IsFalse(PublishedContentCache.UnitTesting);
diff --git a/src/Umbraco.Tests/Routing/UmbracoModuleTests.cs b/src/Umbraco.Tests/Routing/UmbracoModuleTests.cs
index 659c7aa2db..ff610cbc00 100644
--- a/src/Umbraco.Tests/Routing/UmbracoModuleTests.cs
+++ b/src/Umbraco.Tests/Routing/UmbracoModuleTests.cs
@@ -28,7 +28,7 @@ namespace Umbraco.Tests.Routing
{
base.SetUp();
- // fixme - be able to get the UmbracoModule from the container. any reason settings were from testobjects?
+ // FIXME: be able to get the UmbracoModule from the container. any reason settings were from testobjects?
//create the module
var logger = Mock.Of();
var globalSettings = TestObjects.GetGlobalSettings();
@@ -44,7 +44,7 @@ namespace Umbraco.Tests.Routing
new UrlProviderCollection(new IUrlProvider[0]),
runtime,
logger,
- null, // fixme - PublishedRouter complexities...
+ null, // FIXME: PublishedRouter complexities...
Mock.Of()
);
diff --git a/src/Umbraco.Tests/Routing/UrlProviderTests.cs b/src/Umbraco.Tests/Routing/UrlProviderTests.cs
index 819ea0b01c..f223f2fbea 100644
--- a/src/Umbraco.Tests/Routing/UrlProviderTests.cs
+++ b/src/Umbraco.Tests/Routing/UrlProviderTests.cs
@@ -42,7 +42,6 @@ namespace Umbraco.Tests.Routing
public void Ensure_Cache_Is_Correct()
{
var globalSettings = Mock.Get(Factory.GetInstance()); //this will modify the IGlobalSettings instance stored in the container
- globalSettings.Setup(x => x.UseDirectoryUrls).Returns(true);
globalSettings.Setup(x => x.HideTopLevelNodeFromPath).Returns(false);
var umbracoSettings = Current.Configs.Settings();
@@ -106,7 +105,6 @@ namespace Umbraco.Tests.Routing
public void Get_Url_Not_Hiding_Top_Level(int nodeId, string niceUrlMatch)
{
var globalSettings = Mock.Get(Factory.GetInstance()); //this will modify the IGlobalSettings instance stored in the container
- globalSettings.Setup(x => x.UseDirectoryUrls).Returns(true);
globalSettings.Setup(x => x.HideTopLevelNodeFromPath).Returns(false);
var umbracoSettings = Current.Configs.Settings();
@@ -137,7 +135,6 @@ namespace Umbraco.Tests.Routing
public void Get_Url_Hiding_Top_Level(int nodeId, string niceUrlMatch)
{
var globalSettings = Mock.Get(Factory.GetInstance()); //this will modify the IGlobalSettings instance stored in the container
- globalSettings.Setup(x => x.UseDirectoryUrls).Returns(true);
globalSettings.Setup(x => x.HideTopLevelNodeFromPath).Returns(true);
var umbracoSettings = Current.Configs.Settings();
@@ -160,7 +157,6 @@ namespace Umbraco.Tests.Routing
const string currentUri = "http://example.us/test";
var globalSettings = Mock.Get(Factory.GetInstance()); //this will modify the IGlobalSettings instance stored in the container
- globalSettings.Setup(x => x.UseDirectoryUrls).Returns(true);
globalSettings.Setup(x => x.HideTopLevelNodeFromPath).Returns(false);
var umbracoSettings = Current.Configs.Settings();
@@ -209,7 +205,6 @@ namespace Umbraco.Tests.Routing
const string currentUri = "http://example.fr/test";
var globalSettings = Mock.Get(Factory.GetInstance()); //this will modify the IGlobalSettings instance stored in the container
- globalSettings.Setup(x => x.UseDirectoryUrls).Returns(true);
globalSettings.Setup(x => x.HideTopLevelNodeFromPath).Returns(false);
var umbracoSettings = Current.Configs.Settings();
@@ -267,7 +262,6 @@ namespace Umbraco.Tests.Routing
const string currentUri = "http://example.us/test";
var globalSettings = Mock.Get(Factory.GetInstance()); //this will modify the IGlobalSettings instance stored in the container
- globalSettings.Setup(x => x.UseDirectoryUrls).Returns(true);
globalSettings.Setup(x => x.HideTopLevelNodeFromPath).Returns(false);
var umbracoSettings = Current.Configs.Settings();
@@ -321,7 +315,6 @@ namespace Umbraco.Tests.Routing
public void Get_Url_Relative_Or_Absolute()
{
var globalSettings = Mock.Get(Factory.GetInstance()); //this will modify the IGlobalSettings instance stored in the container
- globalSettings.Setup(x => x.UseDirectoryUrls).Returns(true);
globalSettings.Setup(x => x.HideTopLevelNodeFromPath).Returns(false);
var umbracoSettings = Current.Configs.Settings();
@@ -348,7 +341,6 @@ namespace Umbraco.Tests.Routing
public void Get_Url_Unpublished()
{
var globalSettings = Mock.Get(Factory.GetInstance()); //this will modify the IGlobalSettings instance stored in the container
- globalSettings.Setup(x => x.UseDirectoryUrls).Returns(true);
globalSettings.Setup(x => x.HideTopLevelNodeFromPath).Returns(false);
var umbracoSettings = Current.Configs.Settings();
diff --git a/src/Umbraco.Tests/Routing/UrlsProviderWithDomainsTests.cs b/src/Umbraco.Tests/Routing/UrlsProviderWithDomainsTests.cs
index ba646f6d94..dc9a52835b 100644
--- a/src/Umbraco.Tests/Routing/UrlsProviderWithDomainsTests.cs
+++ b/src/Umbraco.Tests/Routing/UrlsProviderWithDomainsTests.cs
@@ -180,7 +180,6 @@ namespace Umbraco.Tests.Routing
request.Setup(x => x.UseDomainPrefixes).Returns(false);
var globalSettings = Mock.Get(Factory.GetInstance()); //this will modify the IGlobalSettings instance stored in the container
- globalSettings.Setup(x => x.UseDirectoryUrls).Returns(true);
globalSettings.Setup(x => x.HideTopLevelNodeFromPath).Returns(false); // ignored w/domains
var umbracoContext = GetUmbracoContext("/test", 1111, umbracoSettings: settings, urlProviders: new[]
@@ -215,7 +214,6 @@ namespace Umbraco.Tests.Routing
request.Setup(x => x.UseDomainPrefixes).Returns(false);
var globalSettings = Mock.Get(Factory.GetInstance()); //this will modify the IGlobalSettings instance stored in the container
- globalSettings.Setup(x => x.UseDirectoryUrls).Returns(true);
globalSettings.Setup(x => x.HideTopLevelNodeFromPath).Returns(false); // ignored w/domains
var umbracoContext = GetUmbracoContext("/test", 1111, umbracoSettings: settings, urlProviders: new[]
@@ -242,7 +240,6 @@ namespace Umbraco.Tests.Routing
request.Setup(x => x.UseDomainPrefixes).Returns(false);
var globalSettings = Mock.Get(Factory.GetInstance()); //this will modify the IGlobalSettings instance stored in the container
- globalSettings.Setup(x => x.UseDirectoryUrls).Returns(true);
globalSettings.Setup(x => x.HideTopLevelNodeFromPath).Returns(false); // ignored w/domains
var umbracoContext = GetUmbracoContext("/test", 1111, umbracoSettings: settings, urlProviders: new[]
@@ -275,7 +272,6 @@ namespace Umbraco.Tests.Routing
request.Setup(x => x.UseDomainPrefixes).Returns(false);
var globalSettings = Mock.Get(Factory.GetInstance()); //this will modify the IGlobalSettings instance stored in the container
- globalSettings.Setup(x => x.UseDirectoryUrls).Returns(true);
globalSettings.Setup(x => x.HideTopLevelNodeFromPath).Returns(false); // ignored w/domains
var umbracoContext = GetUmbracoContext("/test", 1111, umbracoSettings: settings, urlProviders: new[]
@@ -298,7 +294,6 @@ namespace Umbraco.Tests.Routing
request.Setup(x => x.UseDomainPrefixes).Returns(false);
var globalSettings = Mock.Get(Factory.GetInstance()); //this will modify the IGlobalSettings instance stored in the container
- globalSettings.Setup(x => x.UseDirectoryUrls).Returns(true);
globalSettings.Setup(x => x.HideTopLevelNodeFromPath).Returns(false); // ignored w/domains
var umbracoContext = GetUmbracoContext("/test", 1111, umbracoSettings: settings, urlProviders: new[]
@@ -364,7 +359,6 @@ namespace Umbraco.Tests.Routing
requestMock.Setup(x => x.UseDomainPrefixes).Returns(false);
var globalSettings = Mock.Get(Factory.GetInstance()); //this will modify the IGlobalSettings instance stored in the container
- globalSettings.Setup(x => x.UseDirectoryUrls).Returns(true);
globalSettings.Setup(x => x.HideTopLevelNodeFromPath).Returns(false); // ignored w/domains
var umbracoContext = GetUmbracoContext("http://domain1.com/test", 1111, umbracoSettings: settings, urlProviders: new[]
@@ -395,7 +389,6 @@ namespace Umbraco.Tests.Routing
var settings = SettingsForTests.GenerateMockUmbracoSettings();
var globalSettings = Mock.Get(Factory.GetInstance()); //this will modify the IGlobalSettings instance stored in the container
- globalSettings.Setup(x => x.UseDirectoryUrls).Returns(true);
globalSettings.Setup(x => x.HideTopLevelNodeFromPath).Returns(false); // ignored w/domains
var umbracoContext = GetUmbracoContext("http://domain1.com/en/test", 1111, umbracoSettings: settings, urlProviders: new[]
diff --git a/src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs b/src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs
index e28a6485d6..bb06ff894b 100644
--- a/src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs
+++ b/src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs
@@ -31,7 +31,6 @@ namespace Umbraco.Tests.Routing
public void DoNotPolluteCache()
{
var globalSettings = Mock.Get(Factory.GetInstance()); //this will modify the IGlobalSettings instance stored in the container
- globalSettings.Setup(x => x.UseDirectoryUrls).Returns(true);
globalSettings.Setup(x => x.HideTopLevelNodeFromPath).Returns(false);
var settings = SettingsForTests.GenerateMockUmbracoSettings();
diff --git a/src/Umbraco.Tests/Runtimes/CoreRuntimeTests.cs b/src/Umbraco.Tests/Runtimes/CoreRuntimeTests.cs
index c894659865..ee3bca42e9 100644
--- a/src/Umbraco.Tests/Runtimes/CoreRuntimeTests.cs
+++ b/src/Umbraco.Tests/Runtimes/CoreRuntimeTests.cs
@@ -110,7 +110,7 @@ namespace Umbraco.Tests.Runtimes
return configs;
}
- // fixme so how the f* should we do it now?
+ // FIXME: so how the f* should we do it now?
/*
// pretend we have the proper migration
// else BootFailedException because our mock IUmbracoDatabaseFactory does not provide databases
diff --git a/src/Umbraco.Tests/Runtimes/StandaloneTests.cs b/src/Umbraco.Tests/Runtimes/StandaloneTests.cs
index 3a52eea17c..3790a49cfc 100644
--- a/src/Umbraco.Tests/Runtimes/StandaloneTests.cs
+++ b/src/Umbraco.Tests/Runtimes/StandaloneTests.cs
@@ -53,13 +53,13 @@ namespace Umbraco.Tests.Runtimes
// settings
// reset the current version to 0.0.0, clear connection strings
ConfigurationManager.AppSettings["umbracoConfigurationStatus"] = "";
- // fixme we need a better management of settings here (and, true config files?)
+ // FIXME: we need a better management of settings here (and, true config files?)
// create the very basic and essential things we need
var logger = new ConsoleLogger();
var profiler = new LogProfiler(logger);
var profilingLogger = new ProfilingLogger(logger, profiler);
- var appCaches = new AppCaches(); // fixme has HttpRuntime stuff?
+ var appCaches = new AppCaches(); // FIXME: has HttpRuntime stuff?
var databaseFactory = new UmbracoDatabaseFactory(logger, new Lazy(() => factory.GetInstance()));
var typeLoader = new TypeLoader(appCaches.RuntimeCache, LocalTempStorage.Default, profilingLogger);
var mainDom = new SimpleMainDom();
@@ -87,7 +87,7 @@ namespace Umbraco.Tests.Runtimes
composers.Compose();
// must registers stuff that WebRuntimeComponent would register otherwise
- // fixme UmbracoContext creates a snapshot that it does not register with the accessor
+ // FIXME: UmbracoContext creates a snapshot that it does not register with the accessor
// and so, we have to use the UmbracoContextPublishedSnapshotAccessor
// the UmbracoContext does not know about the accessor
// else that would be a catch-22 where they both know about each other?
@@ -177,7 +177,7 @@ namespace Umbraco.Tests.Runtimes
Assert.AreEqual("test", content.Name);
// need an UmbracoCOntext to access the cache
- // fixme - not exactly pretty, should not depend on HttpContext
+ // FIXME: not exactly pretty, should not depend on HttpContext
var httpContext = Mock.Of();
var withUmbracoContext = UmbracoContext.EnsureContext(httpContext);
var umbracoContext = Umbraco.Web.Composing.Current.UmbracoContext;
diff --git a/src/Umbraco.Tests/Runtimes/WebRuntimeComponentTests.cs b/src/Umbraco.Tests/Runtimes/WebRuntimeComponentTests.cs
index 97688a7113..27e5328f6f 100644
--- a/src/Umbraco.Tests/Runtimes/WebRuntimeComponentTests.cs
+++ b/src/Umbraco.Tests/Runtimes/WebRuntimeComponentTests.cs
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.Web.Mvc;
using NUnit.Framework;
-using Umbraco.Core.Profiling;
using Umbraco.Web.Mvc;
using Umbraco.Web.Runtime;
diff --git a/src/Umbraco.Tests/Scoping/PassThroughEventDispatcherTests.cs b/src/Umbraco.Tests/Scoping/PassThroughEventDispatcherTests.cs
index 68e69f4cd6..c955f88f67 100644
--- a/src/Umbraco.Tests/Scoping/PassThroughEventDispatcherTests.cs
+++ b/src/Umbraco.Tests/Scoping/PassThroughEventDispatcherTests.cs
@@ -11,7 +11,7 @@ namespace Umbraco.Tests.Scoping
[NUnit.Framework.Ignore("Cannot dispatch events on NoScope!")]
public class PassThroughEventDispatcherTests
{
- // fixme so... should we remove, or enable, these tests?
+ // FIXME: so... should we remove, or enable, these tests?
// [Test]
// public void TriggersCancelableEvents()
diff --git a/src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs b/src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs
index e8f3463ca7..31681067d6 100644
--- a/src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs
+++ b/src/Umbraco.Tests/Scoping/ScopedNuCacheTests.cs
@@ -43,7 +43,7 @@ namespace Umbraco.Tests.Scoping
// the cache refresher component needs to trigger to refresh caches
// but then, it requires a lot of plumbing ;(
- // fixme - and we cannot inject a DistributedCache yet
+ // FIXME: and we cannot inject a DistributedCache yet
// so doing all this mess
Composition.RegisterUnique();
Composition.RegisterUnique(f => Mock.Of());
@@ -90,6 +90,7 @@ namespace Umbraco.Tests.Scoping
null,
publishedSnapshotAccessor,
Mock.Of(),
+ Mock.Of(),
Logger,
ScopeProvider,
documentRepository, mediaRepository, memberRepository,
diff --git a/src/Umbraco.Tests/Scoping/ScopedRepositoryTests.cs b/src/Umbraco.Tests/Scoping/ScopedRepositoryTests.cs
index dee7a99ad0..b85a79f326 100644
--- a/src/Umbraco.Tests/Scoping/ScopedRepositoryTests.cs
+++ b/src/Umbraco.Tests/Scoping/ScopedRepositoryTests.cs
@@ -29,7 +29,7 @@ namespace Umbraco.Tests.Scoping
// the cache refresher component needs to trigger to refresh caches
// but then, it requires a lot of plumbing ;(
- // fixme - and we cannot inject a DistributedCache yet
+ // FIXME: and we cannot inject a DistributedCache yet
// so doing all this mess
Composition.RegisterUnique();
Composition.RegisterUnique(f => Mock.Of());
diff --git a/src/Umbraco.Tests/Scoping/ScopedXmlTests.cs b/src/Umbraco.Tests/Scoping/ScopedXmlTests.cs
index 568bafa4e6..11479ea3eb 100644
--- a/src/Umbraco.Tests/Scoping/ScopedXmlTests.cs
+++ b/src/Umbraco.Tests/Scoping/ScopedXmlTests.cs
@@ -32,7 +32,7 @@ namespace Umbraco.Tests.Scoping
// the cache refresher component needs to trigger to refresh caches
// but then, it requires a lot of plumbing ;(
- // fixme - and we cannot inject a DistributedCache yet
+ // FIXME: and we cannot inject a DistributedCache yet
// so doing all this mess
Composition.RegisterUnique();
Composition.RegisterUnique(f => Mock.Of());
diff --git a/src/Umbraco.Tests/Security/BackOfficeCookieManagerTests.cs b/src/Umbraco.Tests/Security/BackOfficeCookieManagerTests.cs
index 23e5e472a3..f0409d8928 100644
--- a/src/Umbraco.Tests/Security/BackOfficeCookieManagerTests.cs
+++ b/src/Umbraco.Tests/Security/BackOfficeCookieManagerTests.cs
@@ -69,6 +69,6 @@ namespace Umbraco.Tests.Security
Assert.IsTrue(result);
}
- //TODO : Write remaining tests for `ShouldAuthenticateRequest`
+ // TODO: Write remaining tests for `ShouldAuthenticateRequest`
}
}
diff --git a/src/Umbraco.Tests/Services/ContentServiceTagsTests.cs b/src/Umbraco.Tests/Services/ContentServiceTagsTests.cs
index 62a3526af5..5e97bea2c1 100644
--- a/src/Umbraco.Tests/Services/ContentServiceTagsTests.cs
+++ b/src/Umbraco.Tests/Services/ContentServiceTagsTests.cs
@@ -35,7 +35,7 @@ namespace Umbraco.Tests.Services
{
base.Compose();
- // fixme - do it differently
+ // FIXME: do it differently
Composition.Register(factory => factory.GetInstance