Merge remote-tracking branch 'origin/temp8-ui-overlay-button-style' into temp8-ui-update-color-to-2019-brandcolor-pink

This commit is contained in:
Niels Lyngsø
2019-01-28 13:15:52 +01:00
560 changed files with 1441 additions and 1307 deletions

View File

@@ -55,7 +55,7 @@
<file src="tools\ClientDependency.config.install.xdt" target="Content\config\ClientDependency.config.install.xdt" />
<file src="tools\Dashboard.config.install.xdt" target="Content\config\Dashboard.config.install.xdt" />
<file src="tools\umbracoSettings.config.install.xdt" target="Content\config\umbracoSettings.config.install.xdt" />
<file src="tools\Views.Web.config.install.xdt" target="Views\Web.config.install.xdt" /> <!-- FIXME Content\ !! and then... transform?! -->
<file src="tools\Views.Web.config.install.xdt" target="Views\Web.config.install.xdt" /> <!-- FIXME: Content\ !! and then... transform?! -->
<!-- UmbracoCms props and targets -->
<file src="build\**" target="build" />

View File

@@ -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"

View File

@@ -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

View File

@@ -31,7 +31,7 @@ namespace Umbraco.Core.Cache
/// </summary>
/// <remarks>
/// <para>Will use HttpContext.Current.</para>
/// 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
/// </remarks>
public HttpRequestAppCache()
{ }

View File

@@ -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()

View File

@@ -15,7 +15,7 @@
/// <summary>
/// One unique instance per request.
/// </summary>
// 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
//

View File

@@ -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.

View File

@@ -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

View File

@@ -31,7 +31,7 @@ namespace Umbraco.Core.Configuration.Grid
{
List<GridEditor> 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<GridEditor>();

View File

@@ -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
}
}

View File

@@ -31,7 +31,7 @@ namespace Umbraco.Core.Configuration
/// <summary>
/// Gets the non-semantic version of the Umbraco code.
/// </summary>
// TODO rename to Version
// TODO: rename to Version
public static Version Current { get; }
/// <summary>
@@ -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;
}

View File

@@ -156,7 +156,7 @@
public const string ThirdParty = "thirdPartyGroup";
}
//TODO: Fill in the rest!
// TODO: Fill in the rest!
}
}
}

View File

@@ -5,11 +5,11 @@ using Umbraco.Core.Models;
namespace Umbraco.Core.Deploy
{
/// <summary>
/// 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.
/// </summary>
/// <remarks>Configurations may contain values such as content identifiers, that would be local
/// <remarks>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.</remarks>
[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
{
/// <summary>

View File

@@ -17,7 +17,7 @@ namespace Umbraco.Core
/// </summary>
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;

View File

@@ -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);
}

View File

@@ -34,7 +34,7 @@ namespace Umbraco.Core.Events
private IMediaFileSystem _mediaFileSystem;
// todo: inject
// TODO: inject
private IMediaFileSystem MediaFileSystem => _mediaFileSystem ?? (_mediaFileSystem = Current.MediaFileSystem);
}
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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?

View File

@@ -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; }

View File

@@ -5,7 +5,7 @@
/// </summary>
public interface IMigrationExpression
{
string Process(IMigrationContext context); // todo: remove that one?
string Process(IMigrationContext context); // TODO: remove that one?
void Execute();
}
}

View File

@@ -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",

View File

@@ -27,7 +27,7 @@ namespace Umbraco.Core.Migrations.Install
public List<TableDefinition> 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<DbIndexDefinition> IndexDefinitions { get; }
public List<string> ValidTables { get; }

View File

@@ -128,14 +128,14 @@ namespace Umbraco.Core.Models
/// <summary>
/// Gets the enumeration of property groups for the entity.
/// todo - remove this proxy method
/// TODO: remove this proxy method
/// </summary>
[IgnoreDataMember]
public IEnumerable<PropertyGroup> PropertyGroups => ContentTypeBase.CompositionPropertyGroups;
/// <summary>
/// Gets the numeration of property types for the entity.
/// todo - remove this proxy method
/// TODO: remove this proxy method
/// </summary>
[IgnoreDataMember]
public IEnumerable<PropertyType> PropertyTypes => ContentTypeBase.CompositionPropertyTypes;

View File

@@ -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)

View File

@@ -431,7 +431,7 @@ namespace Umbraco.Core.Models
/// PropertyTypes that are not part of a PropertyGroup
/// </summary>
[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;
/// <summary>

View File

@@ -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;

View File

@@ -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!
/// <summary>
/// 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<GridRow> 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<GridControl> Controls { get; set; }

View File

@@ -137,7 +137,7 @@ namespace Umbraco.Core.Models
/// </summary>
IEnumerable<string> EditedCultures { get; }
// todo - these two should move to some kind of service
// TODO: these two should move to some kind of service
/// <summary>
/// Changes the <see cref="IContentType"/> for the current content object

View File

@@ -10,7 +10,7 @@ namespace Umbraco.Core.Models
/// <summary>
/// Gets or sets the content types that compose this content type.
/// </summary>
//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<IContentTypeComposition> ContentTypeComposition { get; set; }
/// <summary>

View File

@@ -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<IdentityUserRole<string>>();
_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<IdentityUserRole<string>>(_groups.Select(x => new IdentityUserRole<string>
{

View File

@@ -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;

View File

@@ -189,7 +189,7 @@ namespace Umbraco.Core.Models
[DataMember]
public IEnumerable<string> 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<T> instead
// TODO: Use TryConvertTo<T> instead
}
set
{
@@ -371,7 +371,7 @@ namespace Umbraco.Core.Models
return tryConvert.Result;
}
return default(DateTime);
//TODO: Use TryConvertTo<T> instead
// TODO: Use TryConvertTo<T> instead
}
set
{
@@ -404,7 +404,7 @@ namespace Umbraco.Core.Models
return tryConvert.Result;
}
return default(DateTime);
//TODO: Use TryConvertTo<T> instead
// TODO: Use TryConvertTo<T> instead
}
set
{
@@ -437,7 +437,7 @@ namespace Umbraco.Core.Models
return tryConvert.Result;
}
return default(DateTime);
//TODO: Use TryConvertTo<T> instead
// TODO: Use TryConvertTo<T> instead
}
set
{
@@ -471,7 +471,7 @@ namespace Umbraco.Core.Models
return tryConvert.Result;
}
return default(int);
//TODO: Use TryConvertTo<T> instead
// TODO: Use TryConvertTo<T> instead
}
set
{

View File

@@ -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

View File

@@ -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();

View File

@@ -27,7 +27,7 @@ namespace Umbraco.Core.Models.Membership
{
SessionTimeout = 60;
_userGroups = new HashSet<IReadOnlyUserGroup>();
_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<IUser> service so
// TODO: Figure out how to support all of this! - we cannot have NotImplementedExceptions because these get used by the IMembershipMemberService<IUser> service so
// we'll just have them as generic get/set which don't interact with the db.
[IgnoreDataMember]

View File

@@ -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<PackageAction> ?
public string Actions { get; set; } // TODO: Should we make this strongly typed to IEnumerable<PackageAction> ?
public PreInstallWarnings Warnings { get; set; } = new PreInstallWarnings();
public List<CompiledPackageFile> Files { get; set; } = new List<CompiledPackageFile>();
public IEnumerable<XElement> Macros { get; set; } //todo: make strongly typed
public IEnumerable<XElement> Templates { get; set; } //todo: make strongly typed
public IEnumerable<XElement> Stylesheets { get; set; } //todo: make strongly typed
public IEnumerable<XElement> DataTypes { get; set; } //todo: make strongly typed
public IEnumerable<XElement> Languages { get; set; } //todo: make strongly typed
public IEnumerable<XElement> DictionaryItems { get; set; } //todo: make strongly typed
public IEnumerable<XElement> DocumentTypes { get; set; } //todo: make strongly typed
public IEnumerable<XElement> Macros { get; set; } // TODO: make strongly typed
public IEnumerable<XElement> Templates { get; set; } // TODO: make strongly typed
public IEnumerable<XElement> Stylesheets { get; set; } // TODO: make strongly typed
public IEnumerable<XElement> DataTypes { get; set; } // TODO: make strongly typed
public IEnumerable<XElement> Languages { get; set; } // TODO: make strongly typed
public IEnumerable<XElement> DictionaryItems { get; set; } // TODO: make strongly typed
public IEnumerable<XElement> DocumentTypes { get; set; } // TODO: make strongly typed
public IEnumerable<CompiledPackageDocument> Documents { get; set; }
}
}

View File

@@ -10,7 +10,7 @@ namespace Umbraco.Core.Models.Packaging
public IEnumerable<string> UnsecureFiles { get; set; } = Enumerable.Empty<string>();
public IEnumerable<string> FilesReplaced { get; set; } = Enumerable.Empty<string>();
//TODO: Shouldn't we detect other conflicting entities too ?
// TODO: Shouldn't we detect other conflicting entities too ?
public IEnumerable<IMacro> ConflictingMacros { get; set; } = Enumerable.Empty<IMacro>();
public IEnumerable<ITemplate> ConflictingTemplates { get; set; } = Enumerable.Empty<ITemplate>();
public IEnumerable<IFile> ConflictingStylesheets { get; set; } = Enumerable.Empty<IFile>();

View File

@@ -55,7 +55,7 @@ namespace Umbraco.Core.Models
/// </summary>
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<Property, object>(x => x.Values);
public readonly DelegateEqualityComparer<object> PropertyValueComparer = new DelegateEqualityComparer<object>(
@@ -347,7 +347,7 @@ namespace Umbraco.Core.Models
/// </summary>
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
/// <returns>True is property value is valid, otherwise false</returns>
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);
}

View File

@@ -97,7 +97,7 @@ namespace Umbraco.Core.Models
/// </summary>
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)

View File

@@ -14,12 +14,12 @@ namespace Umbraco.Core.Models
/// </summary>
[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<string, PropertyGroup>, 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()

View File

@@ -14,7 +14,7 @@ namespace Umbraco.Core.Models
/// </summary>
public static class PropertyTagsExtensions
{
// todo: inject
// TODO: inject
private static PropertyEditorCollection PropertyEditors => Current.PropertyEditors;
private static IDataTypeService DataTypeService => Current.Services.DataTypeService;

View File

@@ -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
/// <summary>
/// Determines whether a value is valid for this property type.
/// </summary>
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();
}

View File

@@ -13,13 +13,13 @@ namespace Umbraco.Core.Models
/// </summary>
[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<string, PropertyType>, 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();

View File

@@ -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

View File

@@ -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<string, (int, string)> BuiltinMemberProperties = new Dictionary<string, (int, string)>
{
{ "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
/// <summary>
/// Gets a property type.
/// </summary>
@@ -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
/// <summary>
/// Gets a property type.
/// </summary>

View File

@@ -12,7 +12,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// if the property type changes, then a new class needs to be created.</remarks>
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;

View File

@@ -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);

View File

@@ -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<object>.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);
}

View File

@@ -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<PackagingService>("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());

View File

@@ -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);

View File

@@ -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");

View File

@@ -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";

View File

@@ -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

View File

@@ -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; }

View File

@@ -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)]

View File

@@ -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; }

View File

@@ -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<PropertyTypeReadOnlyDto> PropertyTypes { get; set; }
/* PropertyTypeGroups */
//TODO Add PropertyTypeGroupDto ReadOnly list
// TODO: Add PropertyTypeGroupDto ReadOnly list
[ResultColumn]
[Reference(ReferenceType.Many, ReferenceMemberName = "ContentTypeNodeId")]
public List<PropertyTypeGroupReadOnlyDto> PropertyTypeGroups { get; set; }

View File

@@ -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; }

View File

@@ -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
/// <summary>
/// An exception used to indicate that an umbraco entity could not be found

View File

@@ -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<string>("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)
{

View File

@@ -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))

View File

@@ -17,7 +17,7 @@ namespace Umbraco.Core.Persistence
/// </summary>
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
/// <summary>
/// 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<SqlCeTransaction>(db.Connection.);
var count = 0;

View File

@@ -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
/// <summary>
/// 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

View File

@@ -496,7 +496,7 @@ namespace Umbraco.Core.Persistence
public static Sql<ISqlContext> On<TLeft, TRight>(this Sql<ISqlContext>.SqlJoinClause<ISqlContext> sqlJoin,
Expression<Func<TLeft, object>> leftField, Expression<Func<TRight, object>> rightField)
{
// todo - ugly - should define on SqlContext!
// TODO: ugly - should define on SqlContext!
var xLeft = new Sql<ISqlContext>(sqlJoin.SqlContext).Columns(leftField);
var xRight = new Sql<ISqlContext>(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<TableNameAttribute>();

View File

@@ -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 !
/// <summary>
@@ -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<Func<object>>(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]);

View File

@@ -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

View File

@@ -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?
/// <summary>
/// Clears tags for an item.
/// </summary>
@@ -374,7 +374,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
return GetAliasedField(SqlSyntax.GetFieldName<NodeDto>(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

View File

@@ -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<int> 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",
/// </summary>
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
}
/// <summary>
@@ -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<PropertyTypeDto>(sql);
//TODO Move this to a PropertyTypeFactory
// TODO: Move this to a PropertyTypeFactory
var list = new List<PropertyType>();
foreach (var dto in dtos.Where(x => x.PropertyTypeGroupId <= 0))
{

View File

@@ -26,7 +26,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
{
private readonly Lazy<PropertyEditorCollection> _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<PropertyEditorCollection> 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()

View File

@@ -148,7 +148,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
.On<ContentVersionDto, DocumentVersionDto>((left, right) => left.Id == right.Id && right.Published, "pcv", "pdv"), "pcv")
.On<DocumentDto, ContentVersionDto>((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<ContentVersionCultureVariationDto>(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<string>(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<DocumentCultureVariationDto>().Where<DocumentCultureVariationDto>(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<Guid, IContent>
{
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;

View File

@@ -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<int, IDomain>, IDomainRepository
{

View File

@@ -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<DocumentEntitySlim>());
//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<IEntitySlim> GetMediaByQueryWithoutPropertyData(IQuery<IUmbracoEntity> query)
{
var isContent = false;
@@ -266,7 +266,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
return Database.ExecuteScalar<int>(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<PropertyDataDto>(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<BaseDto> 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)

View File

@@ -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

View File

@@ -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
/// <summary>
/// Occurs before Save

View File

@@ -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<ISqlContext> 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<ISqlContext> 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<Member2MemberGroupDto>().Where<Member2MemberGroupDto>(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<ContentVersionDto>(x => x.VersionDate)

View File

@@ -42,7 +42,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
#region Abstract Methods
protected abstract Sql<ISqlContext> GetBaseQuery(bool isCount); // todo obsolete, use QueryType instead everywhere
protected abstract Sql<ISqlContext> GetBaseQuery(bool isCount); // TODO: obsolete, use QueryType instead everywhere
protected abstract string GetBaseWhereClause();
protected abstract IEnumerable<string> GetDeleteClauses();
protected abstract Guid NodeObjectTypeId { get; }

View File

@@ -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();

View File

@@ -20,7 +20,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
protected override IRepositoryCachePolicy<IServerRegistration, int> 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:

View File

@@ -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

View File

@@ -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++;

View File

@@ -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
/// <param name="userIds">Ids of users</param>
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

View File

@@ -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<UserLoginDto>(u => u.Set(x => x.LoggedOutUtc, DateTime.UtcNow))
.Where<UserLoginDto>(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<UserGroupDto>("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<User2UserGroupDto>("WHERE UserId = @UserId", new { UserId = entity.Id });
foreach (var groupDto in assigned)

View File

@@ -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;

View File

@@ -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<TableNameAttribute>();

View File

@@ -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<UmbracoDatabase>("SQL Trace:\r\n{Sql}", CommandToString(cmd).Replace("{", "{{").Replace("}", "}}")); // todo these escapes should be builtin
_logger.Debug<UmbracoDatabase>("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...)

View File

@@ -22,8 +22,8 @@ namespace Umbraco.Core.Persistence
/// <para>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.</para>
/// </remarks>
//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<IMapperCollection> _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();

View File

@@ -89,7 +89,7 @@ namespace Umbraco.Core.PropertyEditors
/// <para>Technically, it could be cached by datatype but let's keep things
/// simple enough for now.</para>
/// </remarks>
// 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();
/// <inheritdoc />
@@ -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;
}

View File

@@ -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!
/// <summary>
/// Converts a property to Xml fragments.

View File

@@ -46,7 +46,7 @@ namespace Umbraco.Core.PropertyEditors
/// <summary>
/// Gets a value editor.
/// </summary>
IDataValueEditor GetValueEditor(); // todo - should be configured?!
IDataValueEditor GetValueEditor(); // TODO: should be configured?!
/// <summary>
/// Gets a configured value editor.

View File

@@ -47,7 +47,7 @@ namespace Umbraco.Core.PropertyEditors
/// </summary>
/// <remarks>
/// <para>Use this property to add validators, not to validate. Use <see cref="Validate"/> instead.</para>
/// todo replace with AddValidator? WithValidator?
/// TODO: replace with AddValidator? WithValidator?
/// </remarks>
List<IValueValidator> Validators { get; }
@@ -61,7 +61,7 @@ namespace Umbraco.Core.PropertyEditors
/// </summary>
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<XElement> ConvertDbToXml(Property property, IDataTypeService dataTypeService, ILocalizationService localizationService, bool published);
XNode ConvertDbToXml(PropertyType propertyType, object value, IDataTypeService dataTypeService);

View File

@@ -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
}

View File

@@ -43,7 +43,7 @@ namespace Umbraco.Core.PropertyEditors
/// <summary>
/// Gets or sets a value indicating whether to replace the tags entirely.
/// </summary>
// todo: what's the usage?
// TODO: what's the usage?
public bool ReplaceTags { get; set; }
/// <summary>

View File

@@ -23,7 +23,7 @@ namespace Umbraco.Core.PropertyEditors.Validators
/// <inheritdoc />
public IEnumerable<ValidationResult> Validate(object value, string valueType, object dataTypeConfiguration)
{
//TODO: localize these!
// TODO: localize these!
if (value != null)
{
var delimiter = ",";

View File

@@ -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!
}
}

View File

@@ -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 =>
{

View File

@@ -73,7 +73,7 @@ namespace Umbraco.Core.Runtime
// register a server registrar, by default it's the db registrar
composition.RegisterUnique<IServerRegistrar>(f =>
{
// TODO this is a hack, use proper configuration!
// 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"]);

View File

@@ -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);
}

View File

@@ -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<Exception> exceptions = null;
List<IEnlistedObject> orderedEnlisted;
while ((orderedEnlisted = _enlisted.Values.OrderBy(x => x.Priority).ToList()).Count > 0)

Some files were not shown because too many files have changed in this diff Show More