diff --git a/src/Umbraco.Core/Macros/MacroTagParser.cs b/src/Umbraco.Core/Macros/MacroTagParser.cs
index 236a184cc0..94eb6a69bc 100644
--- a/src/Umbraco.Core/Macros/MacroTagParser.cs
+++ b/src/Umbraco.Core/Macros/MacroTagParser.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
+using HtmlAgilityPack;
namespace Umbraco.Core.Macros
{
@@ -10,7 +11,7 @@ namespace Umbraco.Core.Macros
///
internal class MacroTagParser
{
- private static readonly Regex MacroRteContent = new Regex(@"(
.*?)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
private static readonly Regex MacroPersistedFormat = new Regex(@"(<\?UMBRACO_MACRO macroAlias=[""'](\w+?)[""'].+?)(?:/>|>.*?\?UMBRACO_MACRO>)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
///
@@ -88,7 +89,33 @@ namespace Umbraco.Core.Macros
///
internal static string FormatRichTextContentForPersistence(string rteContent)
{
- return MacroRteContent.Replace(rteContent, match =>
+ if (string.IsNullOrEmpty(rteContent))
+ {
+ return string.Empty;
+ }
+
+ var html = new HtmlDocument();
+ html.LoadHtml(rteContent);
+
+ //get all the comment nodes we want
+ var commentNodes = html.DocumentNode.SelectNodes("//comment()[contains(., ' with the comment node itself.
+ foreach (var c in commentNodes)
+ {
+ var div = c.ParentNode;
+ var divContainer = div.ParentNode;
+ divContainer.ReplaceChild(c, div);
+ }
+
+ var parsed = html.DocumentNode.OuterHtml;
+
+ //now replace all the with nothing
+ return MacroRteContent.Replace(parsed, match =>
{
if (match.Groups.Count >= 3)
{
@@ -96,7 +123,7 @@ namespace Umbraco.Core.Macros
return match.Groups[2].Value;
}
//replace with nothing if we couldn't find the syntax for whatever reason
- return "";
+ return string.Empty;
});
}
diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DeleteBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DeleteBuilder.cs
index 03ceaa6a4e..4865182134 100644
--- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DeleteBuilder.cs
+++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DeleteBuilder.cs
@@ -27,7 +27,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete
public IDeleteColumnFromTableSyntax Column(string columnName)
{
- var expression = _databaseProviders == null
+ var expression = _databaseProviders == null
? new DeleteColumnExpression { ColumnNames = { columnName } }
: new DeleteColumnExpression(_context.CurrentDatabaseProvider, _databaseProviders) { ColumnNames = { columnName } };
_context.Expressions.Add(expression);
@@ -36,7 +36,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete
public IDeleteForeignKeyFromTableSyntax ForeignKey()
{
- var expression = _databaseProviders == null
+ var expression = _databaseProviders == null
? new DeleteForeignKeyExpression()
: new DeleteForeignKeyExpression(_context.CurrentDatabaseProvider, _databaseProviders);
_context.Expressions.Add(expression);
@@ -45,7 +45,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete
public IDeleteForeignKeyOnTableSyntax ForeignKey(string foreignKeyName)
{
- var expression = _databaseProviders == null
+ var expression = _databaseProviders == null
? new DeleteForeignKeyExpression { ForeignKey = { Name = foreignKeyName } }
: new DeleteForeignKeyExpression(_context.CurrentDatabaseProvider, _databaseProviders) { ForeignKey = { Name = foreignKeyName } };
_context.Expressions.Add(expression);
@@ -68,17 +68,17 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete
public IDeleteIndexForTableSyntax Index(string indexName)
{
- var expression = new DeleteIndexExpression {Index = {Name = indexName}};
+ var expression = new DeleteIndexExpression { Index = { Name = indexName } };
_context.Expressions.Add(expression);
return new DeleteIndexBuilder(expression);
}
public IDeleteConstraintOnTableSyntax PrimaryKey(string primaryKeyName)
{
- var expression = new DeleteConstraintExpression(ConstraintType.PrimaryKey)
- {
- Constraint = { ConstraintName = primaryKeyName }
- };
+ var expression = new DeleteConstraintExpression(_context.CurrentDatabaseProvider, _databaseProviders, ConstraintType.PrimaryKey)
+ {
+ Constraint = { ConstraintName = primaryKeyName }
+ };
_context.Expressions.Add(expression);
return new DeleteConstraintBuilder(expression);
}
@@ -86,16 +86,16 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete
public IDeleteConstraintOnTableSyntax UniqueConstraint(string constraintName)
{
var expression = new DeleteConstraintExpression(ConstraintType.Unique)
- {
- Constraint = { ConstraintName = constraintName }
- };
+ {
+ Constraint = { ConstraintName = constraintName }
+ };
_context.Expressions.Add(expression);
return new DeleteConstraintBuilder(expression);
}
public IDeleteDefaultConstraintOnTableSyntax DefaultConstraint()
{
- var expression = _databaseProviders == null
+ var expression = _databaseProviders == null
? new DeleteDefaultConstraintExpression()
: new DeleteDefaultConstraintExpression(_context.CurrentDatabaseProvider, _databaseProviders);
_context.Expressions.Add(expression);
diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteConstraintExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteConstraintExpression.cs
index 1f20f6bbb9..39f250532d 100644
--- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteConstraintExpression.cs
+++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteConstraintExpression.cs
@@ -10,13 +10,40 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Expressions
Constraint = new ConstraintDefinition(type);
}
+ public DeleteConstraintExpression(DatabaseProviders current, DatabaseProviders[] databaseProviders, ConstraintType type)
+ : base(current, databaseProviders)
+ {
+ Constraint = new ConstraintDefinition(type);
+ }
+
public ConstraintDefinition Constraint { get; private set; }
public override string ToString()
{
- return string.Format(SqlSyntaxContext.SqlSyntaxProvider.DeleteConstraint,
+ // Test for MySQL primary key situation.
+ if (CurrentDatabaseProvider == DatabaseProviders.MySql)
+ {
+ if (Constraint.IsPrimaryKeyConstraint)
+ {
+ return string.Format(SqlSyntaxContext.SqlSyntaxProvider.DeleteConstraint,
+ SqlSyntaxContext.SqlSyntaxProvider.GetQuotedTableName(Constraint.TableName),
+ "PRIMARY KEY",
+ "");
+ }
+ else
+ {
+ return string.Format(SqlSyntaxContext.SqlSyntaxProvider.DeleteConstraint,
+ SqlSyntaxContext.SqlSyntaxProvider.GetQuotedTableName(Constraint.TableName),
+ "FOREIGN KEY",
+ "");
+ }
+ }
+ else
+ {
+ return string.Format(SqlSyntaxContext.SqlSyntaxProvider.DeleteConstraint,
SqlSyntaxContext.SqlSyntaxProvider.GetQuotedTableName(Constraint.TableName),
SqlSyntaxContext.SqlSyntaxProvider.GetQuotedName(Constraint.ConstraintName));
+ }
}
}
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteForeignKeyExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteForeignKeyExpression.cs
index df79f7c8f7..75eb5d1d1f 100644
--- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteForeignKeyExpression.cs
+++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteForeignKeyExpression.cs
@@ -27,7 +27,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Expressions
if (ForeignKey.ForeignTable == null)
throw new ArgumentNullException("Table name not specified, ensure you have appended the OnTable extension. Format should be Delete.ForeignKey(KeyName).OnTable(TableName)");
- if(CurrentDatabaseProvider == DatabaseProviders.MySql)
+ if (CurrentDatabaseProvider == DatabaseProviders.MySql)
{
//MySql naming "convention" for foreignkeys, which aren't explicitly named
if (string.IsNullOrEmpty(ForeignKey.Name))
@@ -35,7 +35,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Expressions
return string.Format(SqlSyntaxContext.SqlSyntaxProvider.DeleteConstraint,
SqlSyntaxContext.SqlSyntaxProvider.GetQuotedTableName(ForeignKey.ForeignTable),
- "FOREIGN KEY ",
+ "FOREIGN KEY",
SqlSyntaxContext.SqlSyntaxProvider.GetQuotedName(ForeignKey.Name));
}
diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterTagRelationsTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterTagRelationsTable.cs
index 7b23e22504..4a549c7af3 100644
--- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterTagRelationsTable.cs
+++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterTagRelationsTable.cs
@@ -26,11 +26,11 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
//create a new col which we will make a foreign key, but first needs to be populated with data.
Alter.Table("cmsTagRelationship").AddColumn("propertyTypeId").AsInt32().Nullable();
+ //drop the foreign key on umbracoNode. Must drop foreign key first before primary key can be removed in MySql.
+ Delete.ForeignKey("FK_cmsTagRelationship_umbracoNode_id").OnTable("cmsTagRelationship");
+
//we need to drop the primary key
Delete.PrimaryKey("PK_cmsTagRelationship").FromTable("cmsTagRelationship");
-
- //drop the foreign key on umbracoNode
- Delete.ForeignKey("FK_cmsTagRelationship_umbracoNode_id").OnTable("cmsTagRelationship");
}
private void Upgrade()
@@ -57,9 +57,9 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
var propertyTypes = propertyTypeIdRef.Where(x => x.NodeId == tr.NodeId).ToArray();
if (propertyTypes.Length == 0)
{
- LogHelper.Warn("There was no cmsContent reference for cmsTagRelationship for nodeId "
+ LogHelper.Warn("There was no cmsContent reference for cmsTagRelationship for nodeId "
+ tr.NodeId +
- ". The new tag system only supports tags with references to content in the cmsContent and cmsPropertyType tables. This row will be deleted: "
+ ". The new tag system only supports tags with references to content in the cmsContent and cmsPropertyType tables. This row will be deleted: "
+ string.Format("nodeId: {0}, tagId: {1}", tr.NodeId, tr.TagId));
Delete.FromTable("cmsTagRelationship").Row(new { nodeId = tr.NodeId, tagId = tr.TagId });
}
@@ -92,7 +92,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
Alter.Table("cmsTagRelationship").AlterColumn("propertyTypeId").AsInt32().NotNullable();
//we need to re-add the new primary key on all 3 columns
- Create.PrimaryKey("PK_cmsTagRelationship").OnTable("cmsTagRelationship").Columns(new[] {"nodeId", "propertyTypeId", "tagId"});
+ Create.PrimaryKey("PK_cmsTagRelationship").OnTable("cmsTagRelationship").Columns(new[] { "nodeId", "propertyTypeId", "tagId" });
//now we need to add a foreign key to the propertyTypeId column and change it's constraints
Create.ForeignKey("FK_cmsTagRelationship_cmsPropertyType")
@@ -102,7 +102,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
.PrimaryColumn("id")
.OnDelete(Rule.None)
.OnUpdate(Rule.None);
-
+
//now we need to add a foreign key to the nodeId column to cmsContent (intead of the original umbracoNode)
Create.ForeignKey("FK_cmsTagRelationship_cmsContent")
.FromTable("cmsTagRelationship")
diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs b/src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs
index 52ea11e572..8f466e3829 100644
--- a/src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs
+++ b/src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs
@@ -33,7 +33,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
TimeColumnDefinition = "time";
DecimalColumnDefinition = "decimal(38,6)";
GuidColumnDefinition = "char(36)";
-
+
InitColumnTypeMap();
DefaultValueFormat = "DEFAULT '{0}'";
@@ -48,7 +48,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
var items =
db.Fetch(
"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = @TableSchema",
- new {TableSchema = db.Connection.Database});
+ new { TableSchema = db.Connection.Database });
list = items.Select(x => x.TABLE_NAME).Cast().ToList();
}
finally
@@ -67,7 +67,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
var items =
db.Fetch(
"SELECT TABLE_NAME, COLUMN_NAME, ORDINAL_POSITION, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = @TableSchema",
- new {TableSchema = db.Connection.Database});
+ new { TableSchema = db.Connection.Database });
list =
items.Select(
item =>
@@ -90,7 +90,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
var items =
db.Fetch(
"SELECT TABLE_NAME, CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE TABLE_SCHEMA = @TableSchema",
- new {TableSchema = db.Connection.Database});
+ new { TableSchema = db.Connection.Database });
list = items.Select(item => new Tuple(item.TABLE_NAME, item.CONSTRAINT_NAME)).ToList();
}
finally
@@ -109,7 +109,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
var items =
db.Fetch(
"SELECT TABLE_NAME, COLUMN_NAME, CONSTRAINT_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = @TableSchema",
- new {TableSchema = db.Connection.Database});
+ new { TableSchema = db.Connection.Database });
list =
items.Select(
item =>
@@ -133,7 +133,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
db.ExecuteScalar("SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES " +
"WHERE TABLE_NAME = @TableName AND " +
"TABLE_SCHEMA = @TableSchema",
- new {TableName = tableName, TableSchema = db.Connection.Database});
+ new { TableName = tableName, TableSchema = db.Connection.Database });
}
finally
@@ -213,7 +213,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
return string.Format(CreateIndex,
GetQuotedName(name),
- GetQuotedTableName(index.TableName),
+ GetQuotedTableName(index.TableName),
columns);
}
@@ -290,7 +290,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
{
get
{
- throw new NotSupportedException("Default constraints are not supported in MySql");
+ return "ALTER TABLE {0} ALTER COLUMN {1} DROP DEFAULT";
}
}
@@ -303,7 +303,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax
public override string CreateForeignKeyConstraint { get { return "ALTER TABLE {0} ADD FOREIGN KEY ({1}) REFERENCES {2} ({3}){4}{5}"; } }
- public override string DeleteConstraint { get { return "ALTER TABLE {0} DROP {1}{2}"; } }
+ public override string DeleteConstraint { get { return "ALTER TABLE {0} DROP {1} {2}"; } }
public override string DropIndex { get { return "DROP INDEX {0} ON {1}"; } }
@@ -318,11 +318,11 @@ namespace Umbraco.Core.Persistence.SqlSyntax
db.OpenSharedConnection();
// Need 4 @ signs as it is regarded as a parameter, @@ escapes it once, @@@@ escapes it twice
var lowerCaseTableNames = db.Fetch("SELECT @@@@Global.lower_case_table_names");
-
- if(lowerCaseTableNames.Any())
+
+ if (lowerCaseTableNames.Any())
supportsCaseInsensitiveQueries = lowerCaseTableNames.First() == 1;
}
- catch(Exception ex)
+ catch (Exception ex)
{
Logging.LogHelper.Error("Error querying for lower_case support", ex);
}
diff --git a/src/Umbraco.Core/PluginManager.cs b/src/Umbraco.Core/PluginManager.cs
index 2d00d19ee2..d3305af031 100644
--- a/src/Umbraco.Core/PluginManager.cs
+++ b/src/Umbraco.Core/PluginManager.cs
@@ -309,7 +309,7 @@ namespace Umbraco.Core
//return false but specify this exception type so we can detect it
if (typeElement == null)
- return Attempt>.Fail(new CachedPluginNotFoundInFile());
+ return Attempt>.Fail(new CachedPluginNotFoundInFileException());
//return success
return Attempt.Succeed(typeElement.Elements("add")
@@ -459,24 +459,24 @@ namespace Umbraco.Core
private readonly HashSet _types = new HashSet();
private IEnumerable _assemblies;
-
///
- /// Returns all found property editors
+ /// Returns all found property editors (based on the resolved Iparameter editors - this saves a scan)
///
internal IEnumerable ResolvePropertyEditors()
{
//return all proeprty editor types found except for the base property editor type
- return ResolveTypes().ToArray()
- .Except(new[] {typeof (PropertyEditor)});
+ return ResolveTypes()
+ .Where(x => x.IsType())
+ .Except(new[] { typeof(PropertyEditor) });
}
///
- /// Returns all found parameter editors
+ /// Returns all found parameter editors (which includes property editors)
///
internal IEnumerable ResolveParameterEditors()
{
//return all paramter editor types found except for the base property editor type
- return ResolveTypes().ToArray()
+ return ResolveTypes()
.Except(new[] { typeof(ParameterEditor), typeof(PropertyEditor) });
}
@@ -671,8 +671,15 @@ namespace Umbraco.Core
{
//check if the TypeList already exists, if so return it, if not we'll create it
var typeList = _types.SingleOrDefault(x => x.IsTypeList(resolutionType));
+
+ //need to put some logging here to try to figure out why this is happening: http://issues.umbraco.org/issue/U4-3505
+ if (cacheResult && typeList != null)
+ {
+ LogHelper.Debug("Existing typeList found for {0} with resolution type {1}", () => typeof(T), () => resolutionType);
+ }
+
//if we're not caching the result then proceed, or if the type list doesn't exist then proceed
- if (!cacheResult || typeList == null)
+ if (cacheResult == false || typeList == null)
{
//upgrade to a write lock since we're adding to the collection
readLock.UpgradeToWriteLock();
@@ -681,15 +688,17 @@ namespace Umbraco.Core
//we first need to look into our cache file (this has nothing to do with the 'cacheResult' parameter which caches in memory).
//if assemblies have not changed and the cache file actually exists, then proceed to try to lookup by the cache file.
- if (!HaveAssembliesChanged && File.Exists(GetPluginListFilePath()))
+ if (HaveAssembliesChanged == false && File.Exists(GetPluginListFilePath()))
{
var fileCacheResult = TryGetCachedPluginsFromFile(resolutionType);
//here we need to identify if the CachedPluginNotFoundInFile was the exception, if it was then we need to re-scan
//in some cases the plugin will not have been scanned for on application startup, but the assemblies haven't changed
//so in this instance there will never be a result.
- if (fileCacheResult.Exception != null && fileCacheResult.Exception is CachedPluginNotFoundInFile)
+ if (fileCacheResult.Exception != null && fileCacheResult.Exception is CachedPluginNotFoundInFileException)
{
+ LogHelper.Debug("Tried to find typelist for type {0} and resolution {1} in file cache but the type was not found so loading types by assembly scan ", () => typeof(T), () => resolutionType);
+
//we don't have a cache for this so proceed to look them up by scanning
LoadViaScanningAndUpdateCacheFile(typeList, resolutionType, finder);
}
@@ -717,20 +726,22 @@ namespace Umbraco.Core
break;
}
}
- if (!successfullyLoadedFromCache)
+ if (successfullyLoadedFromCache == false)
{
//we need to manually load by scanning if loading from the file was not successful.
LoadViaScanningAndUpdateCacheFile(typeList, resolutionType, finder);
}
else
{
- LogHelper.Debug("Loaded plugin types " + typeof(T).FullName + " from persisted cache");
+ LogHelper.Debug("Loaded plugin types {0} with resolution {1} from persisted cache", () => typeof(T), () => resolutionType);
}
}
}
}
else
{
+ LogHelper.Debug("Assembly changes detected, loading types {0} for resolution {1} by assembly scan", () => typeof(T), () => resolutionType);
+
//we don't have a cache for this so proceed to look them up by scanning
LoadViaScanningAndUpdateCacheFile(typeList, resolutionType, finder);
}
@@ -739,7 +750,10 @@ namespace Umbraco.Core
if (cacheResult)
{
//add the type list to the collection
- _types.Add(typeList);
+ var added = _types.Add(typeList);
+
+ LogHelper.Debug("Caching of typelist for type {0} and resolution {1} was successful = {2}", () => typeof(T), () => resolutionType, () => added);
+
}
}
typesFound = typeList.GetTypes().ToList();
@@ -863,14 +877,14 @@ namespace Umbraco.Core
}
///
- /// Returns true if the current TypeList is of the same type and of the same type
+ /// Returns true if the current TypeList is of the same lookup type
///
///
///
///
public override bool IsTypeList(TypeResolutionKind resolutionType)
{
- return _resolutionType == resolutionType && (typeof(T)).IsType();
+ return _resolutionType == resolutionType && (typeof(T)) == typeof(TLookup);
}
public override IEnumerable GetTypes()
@@ -883,7 +897,7 @@ namespace Umbraco.Core
/// This class is used simply to determine that a plugin was not found in the cache plugin list with the specified
/// TypeResolutionKind.
///
- internal class CachedPluginNotFoundInFile : Exception
+ internal class CachedPluginNotFoundInFileException : Exception
{
}
diff --git a/src/Umbraco.Core/Services/UserService.cs b/src/Umbraco.Core/Services/UserService.cs
index 1a6695fd5c..ec7c957a49 100644
--- a/src/Umbraco.Core/Services/UserService.cs
+++ b/src/Umbraco.Core/Services/UserService.cs
@@ -166,7 +166,8 @@ namespace Umbraco.Core.Services
var uow = _uowProvider.GetUnitOfWork();
var sql = new Sql();
- sql.Select("app").From().Where("[user] = @userID", new {userID = user.Id});
+ sql.Select("app").From()
+ .Where(dto => dto.UserId == (int)user.Id);
return uow.Database.Fetch(sql);
}
diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj
index 3aa3a3d5bc..880673ef6e 100644
--- a/src/Umbraco.Core/Umbraco.Core.csproj
+++ b/src/Umbraco.Core/Umbraco.Core.csproj
@@ -44,6 +44,9 @@
..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.Net4.dll
+
+ ..\packages\HtmlAgilityPack.1.4.6\lib\Net45\HtmlAgilityPack.dll
+
False
..\packages\log4net-mediumtrust.2.0.0\lib\log4net.dll
diff --git a/src/Umbraco.Core/packages.config b/src/Umbraco.Core/packages.config
index 7ad8fc5ac1..cc673f88a1 100644
--- a/src/Umbraco.Core/packages.config
+++ b/src/Umbraco.Core/packages.config
@@ -1,6 +1,7 @@
+
diff --git a/src/Umbraco.Tests/Macros/MacroParserTests.cs b/src/Umbraco.Tests/Macros/MacroParserTests.cs
index 56fc4f2062..78dd51e855 100644
--- a/src/Umbraco.Tests/Macros/MacroParserTests.cs
+++ b/src/Umbraco.Tests/Macros/MacroParserTests.cs
@@ -158,5 +158,22 @@ asdfsdf