From 05ed8e95307f6f517b995c8776c3686104e62c46 Mon Sep 17 00:00:00 2001 From: Jeavon Date: Mon, 20 Jun 2016 13:07:16 +0100 Subject: [PATCH 1/8] Fix for U4-8612 so that Icon shows when installing a local package --- .../src/views/packager/views/install-local.html | 4 ++-- src/Umbraco.Web/Editors/PackageInstallController.cs | 1 + src/Umbraco.Web/Models/LocalPackageInstallModel.cs | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html b/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html index b25facae7f..1900863cfd 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html +++ b/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html @@ -53,8 +53,8 @@
- - + +
diff --git a/src/Umbraco.Web/Editors/PackageInstallController.cs b/src/Umbraco.Web/Editors/PackageInstallController.cs index 41f183eb8c..0d814c8f7f 100644 --- a/src/Umbraco.Web/Editors/PackageInstallController.cs +++ b/src/Umbraco.Web/Editors/PackageInstallController.cs @@ -233,6 +233,7 @@ namespace Umbraco.Web.Editors model.Name = ins.Name; model.Author = ins.Author; model.AuthorUrl = ins.AuthorUrl; + model.IconUrl = ins.IconUrl; model.License = ins.License; model.LicenseUrl = ins.LicenseUrl; model.ReadMe = ins.ReadMe; diff --git a/src/Umbraco.Web/Models/LocalPackageInstallModel.cs b/src/Umbraco.Web/Models/LocalPackageInstallModel.cs index abb7c85cec..819674d3f2 100644 --- a/src/Umbraco.Web/Models/LocalPackageInstallModel.cs +++ b/src/Umbraco.Web/Models/LocalPackageInstallModel.cs @@ -83,5 +83,8 @@ namespace Umbraco.Web.Models [DataMember(Name = "author")] public string Author { get; set; } + + [DataMember(Name = "iconUrl")] + public string IconUrl { get; set; } } } \ No newline at end of file From fed718efb5d8fc4e8d65bb7028efc939ba01ef1f Mon Sep 17 00:00:00 2001 From: Jeavon Date: Mon, 20 Jun 2016 13:17:09 +0100 Subject: [PATCH 2/8] Fix Author link in Local package installer --- .../src/views/packager/views/install-local.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html b/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html index 1900863cfd..62768d7f78 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html +++ b/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html @@ -63,7 +63,7 @@
From 53fbf04a6c3ab02bd7343717bfade94886c2a01f Mon Sep 17 00:00:00 2001 From: Jeavon Date: Mon, 20 Jun 2016 13:20:24 +0100 Subject: [PATCH 3/8] Add target=_blank on license url in local package installer so user doesn't loose their installer if they click the link --- .../src/views/packager/views/install-local.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html b/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html index 62768d7f78..97601d5438 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html +++ b/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html @@ -73,7 +73,7 @@
From 1bfb32dcdcd4e748964dcc5f68be9c8216cfcbc6 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 22 Jun 2016 12:08:51 +0200 Subject: [PATCH 4/8] Merge branch 'U4-8588' of https://github.com/JimBobSquarePants/Umbraco-CMS into JimBobSquarePants-U4-8588 # Conflicts: # build/NuSpecs/UmbracoCms.Core.nuspec # src/Umbraco.Web.UI/packages.config --- build/NuSpecs/UmbracoCms.Core.nuspec | 4 +- .../Logging/ImageProcessorLogger.cs | 46 +++++++++++++++++++ src/Umbraco.Core/Umbraco.Core.csproj | 5 ++ src/Umbraco.Core/packages.config | 1 + src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 8 ++-- src/Umbraco.Web.UI/packages.config | 4 +- 6 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 src/Umbraco.Core/Logging/ImageProcessorLogger.cs diff --git a/build/NuSpecs/UmbracoCms.Core.nuspec b/build/NuSpecs/UmbracoCms.Core.nuspec index a486f8a58b..cbabc01bb7 100644 --- a/build/NuSpecs/UmbracoCms.Core.nuspec +++ b/build/NuSpecs/UmbracoCms.Core.nuspec @@ -32,8 +32,8 @@ - - + + diff --git a/src/Umbraco.Core/Logging/ImageProcessorLogger.cs b/src/Umbraco.Core/Logging/ImageProcessorLogger.cs new file mode 100644 index 0000000000..02ca9c2949 --- /dev/null +++ b/src/Umbraco.Core/Logging/ImageProcessorLogger.cs @@ -0,0 +1,46 @@ +namespace Umbraco.Core.Logging +{ + using System; + using System.Runtime.CompilerServices; + + using ImageProcessor.Common.Exceptions; + + /// + /// A logger for explicitly logging ImageProcessor exceptions. + /// + /// Creating this logger is enough for ImageProcessor to find and replace its in-built debug logger + /// without any additional configuration required. This class currently has to be public in order + /// to do so. + /// + /// + public sealed class ImageProcessorLogger : ImageProcessor.Common.Exceptions.ILogger + { + /// + /// Logs the specified message as an error. + /// + /// The type calling the logger. + /// The message to log. + /// The property or method name calling the log. + /// The line number where the method is called. + public void Log(string text, [CallerMemberName] string callerName = null, [CallerLineNumber] int lineNumber = 0) + { + // Using LogHelper since the ImageProcessor logger expects a parameterless constructor. + var message = string.Format("{0} {1} : {2}", callerName, lineNumber, text); + LogHelper.Error(string.Empty, new ImageProcessingException(message)); + } + + /// + /// Logs the specified message as an error. + /// + /// The type calling the logger. + /// The message to log. + /// The property or method name calling the log. + /// The line number where the method is called. + public void Log(Type type, string text, [CallerMemberName] string callerName = null, [CallerLineNumber] int lineNumber = 0) + { + // Using LogHelper since the ImageProcessor logger expects a parameterless constructor. + var message = string.Format("{0} {1} : {2}", callerName, lineNumber, text); + LogHelper.Error(type, string.Empty, new ImageProcessingException(message)); + } + } +} diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 3e14fc7758..e3cf2206e2 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -52,6 +52,10 @@ ..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll + + ..\packages\ImageProcessor.2.4.1.0\lib\net45\ImageProcessor.dll + True + False ..\packages\log4net-mediumtrust.2.0.0\lib\log4net.dll @@ -353,6 +357,7 @@ + diff --git a/src/Umbraco.Core/packages.config b/src/Umbraco.Core/packages.config index b69be5b5cc..a9241f46c8 100644 --- a/src/Umbraco.Core/packages.config +++ b/src/Umbraco.Core/packages.config @@ -2,6 +2,7 @@ + diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 004b791890..6911829bb8 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -136,12 +136,12 @@ False ..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll - - ..\packages\ImageProcessor.2.3.3.0\lib\net45\ImageProcessor.dll + + ..\packages\ImageProcessor.2.4.1.0\lib\net45\ImageProcessor.dll True - - ..\packages\ImageProcessor.Web.4.5.3.0\lib\net45\ImageProcessor.Web.dll + + ..\packages\ImageProcessor.Web.4.6.1.0\lib\net45\ImageProcessor.Web.dll True diff --git a/src/Umbraco.Web.UI/packages.config b/src/Umbraco.Web.UI/packages.config index e85831fd82..7891f928e8 100644 --- a/src/Umbraco.Web.UI/packages.config +++ b/src/Umbraco.Web.UI/packages.config @@ -5,8 +5,8 @@ - - + + From 1c40d9d0d840fcf1cfc334f8be540aa902ab226f Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 23 Jun 2016 16:53:50 +0200 Subject: [PATCH 5/8] U4-8627 Umbraco.Core.Sync.DatabaseServerMessenger - No last synced Id found when '0' is stored and there are no instructions --- .../Sync/DatabaseServerMessenger.cs | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs b/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs index d8d828b23e..153b90ba5a 100644 --- a/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs +++ b/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs @@ -344,19 +344,39 @@ namespace Umbraco.Core.Sync /// /// Ensure that the last instruction that was processed is still in the database. /// - /// If the last instruction is not in the database anymore, then the messenger + /// + /// If the last instruction is not in the database anymore, then the messenger /// should not try to process any instructions, because some instructions might be lost, - /// and it should instead cold-boot. + /// and it should instead cold-boot. + /// However, if the last synced instruction id is '0' and there are '0' records, then this indicates + /// that it's a fresh site and no user actions have taken place, in this circumstance we do not want to cold + /// boot. See: http://issues.umbraco.org/issue/U4-8627 + /// private void EnsureInstructions() { - var sql = new Sql().Select("*") + if (_lastId == 0) + { + var sql = new Sql().Select("COUNT(*)") + .From(_appContext.DatabaseContext.SqlSyntax); + + var count = _appContext.DatabaseContext.Database.ExecuteScalar(sql); + + //if there are instructions but we haven't synced, then a cold boot is necessary + if (count > 0) + _lastId = -1; + } + else + { + var sql = new Sql().Select("*") .From(_appContext.DatabaseContext.SqlSyntax) .Where(dto => dto.Id == _lastId); - var dtos = _appContext.DatabaseContext.Database.Fetch(sql); + var dtos = _appContext.DatabaseContext.Database.Fetch(sql); - if (dtos.Count == 0) - _lastId = -1; + //if the last synced instruction is not found in the db, then a cold boot is necessary + if (dtos.Count == 0) + _lastId = -1; + } } /// From 44565226fef6d1417d1fa6d242d12cfda6b48a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Kottal?= Date: Fri, 1 Jul 2016 22:14:44 +0200 Subject: [PATCH 6/8] U4-7386: Adds summaries to string functions --- src/Umbraco.Web/UmbracoHelper.cs | 64 +++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs index 6d5e33b239..165b81daba 100644 --- a/src/Umbraco.Web/UmbracoHelper.cs +++ b/src/Umbraco.Web/UmbracoHelper.cs @@ -1081,66 +1081,121 @@ namespace Umbraco.Web return text.ToMd5(); } + /// + /// Strips all html tags from a given string, all contents of the tags will remain. + /// public HtmlString StripHtml(IHtmlString html, params string[] tags) { return StripHtml(html.ToHtmlString(), tags); } + + /// + /// Strips all html tags from a given string, all contents of the tags will remain. + /// public HtmlString StripHtml(DynamicNull html, params string[] tags) { return new HtmlString(string.Empty); } + + /// + /// Strips all html tags from a given string, all contents of the tags will remain. + /// public HtmlString StripHtml(string html, params string[] tags) { return _stringUtilities.StripHtmlTags(html, tags); } - + + /// + /// Will take the first non-null value in the collection and return the value of it. + /// public string Coalesce(params object[] args) { return _stringUtilities.Coalesce(args); } + /// + /// Will take the first non-null value in the collection and return the value of it. + /// public string Concatenate(params object[] args) { return _stringUtilities.Concatenate(args); } + /// + /// Joins any number of int/string/objects into one string and seperates them with the string seperator parameter. + /// public string Join(string seperator, params object[] args) { return _stringUtilities.Join(seperator, args); } + /// + /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them + /// public IHtmlString Truncate(IHtmlString html, int length) { return Truncate(html.ToHtmlString(), length, true, false); } + + /// + /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them + /// public IHtmlString Truncate(IHtmlString html, int length, bool addElipsis) { return Truncate(html.ToHtmlString(), length, addElipsis, false); } + + /// + /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them + /// public IHtmlString Truncate(IHtmlString html, int length, bool addElipsis, bool treatTagsAsContent) { return Truncate(html.ToHtmlString(), length, addElipsis, treatTagsAsContent); } + + /// + /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them + /// public IHtmlString Truncate(DynamicNull html, int length) { return new HtmlString(string.Empty); } + + /// + /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them + /// public IHtmlString Truncate(DynamicNull html, int length, bool addElipsis) { return new HtmlString(string.Empty); } + + /// + /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them + /// public IHtmlString Truncate(DynamicNull html, int length, bool addElipsis, bool treatTagsAsContent) { return new HtmlString(string.Empty); } + + /// + /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them + /// public IHtmlString Truncate(string html, int length) { return Truncate(html, length, true, false); } + + /// + /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them + /// public IHtmlString Truncate(string html, int length, bool addElipsis) { return Truncate(html, length, addElipsis, false); } + + /// + /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them + /// public IHtmlString Truncate(string html, int length, bool addElipsis, bool treatTagsAsContent) { return _stringUtilities.Truncate(html, length, addElipsis, treatTagsAsContent); @@ -1151,10 +1206,17 @@ namespace Umbraco.Web #region If + /// + /// If the test is true, the string valueIfTrue will be returned, otherwise the valueIfFalse will be returned. + /// public HtmlString If(bool test, string valueIfTrue, string valueIfFalse) { return test ? new HtmlString(valueIfTrue) : new HtmlString(valueIfFalse); } + + /// + /// If the test is true, the string valueIfTrue will be returned, otherwise the valueIfFalse will be returned. + /// public HtmlString If(bool test, string valueIfTrue) { return test ? new HtmlString(valueIfTrue) : new HtmlString(string.Empty); From b1b5352e2665c6edada0a6d812de10bcec7ca8aa Mon Sep 17 00:00:00 2001 From: Shannon Date: Mon, 4 Jul 2016 14:38:45 +0200 Subject: [PATCH 7/8] updates to latest Markdown version --- src/Umbraco.Web/Umbraco.Web.csproj | 5 ++--- src/Umbraco.Web/packages.config | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 5c0d308e4f..5a2e0769cc 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -135,9 +135,8 @@ False ..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll - - ..\packages\Markdown.1.14.4\lib\net45\MarkdownSharp.dll - False + + ..\packages\Markdown.1.14.7\lib\net45\MarkdownSharp.dll True diff --git a/src/Umbraco.Web/packages.config b/src/Umbraco.Web/packages.config index 491ef0747a..9dc1e929d7 100644 --- a/src/Umbraco.Web/packages.config +++ b/src/Umbraco.Web/packages.config @@ -6,7 +6,7 @@ - + From f7999389895c7c6ba83056525194c686a18cef2f Mon Sep 17 00:00:00 2001 From: Stephan Date: Tue, 5 Jul 2016 11:44:41 +0200 Subject: [PATCH 8/8] Revert "Merge branch 'U4-8588' ..." This reverts commit 1bfb32dcdcd4e748964dcc5f68be9c8216cfcbc6. --- build/NuSpecs/UmbracoCms.Core.nuspec | 4 +- .../Logging/ImageProcessorLogger.cs | 46 ------------------- src/Umbraco.Core/Umbraco.Core.csproj | 5 -- src/Umbraco.Core/packages.config | 1 - src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 8 ++-- src/Umbraco.Web.UI/packages.config | 4 +- 6 files changed, 8 insertions(+), 60 deletions(-) delete mode 100644 src/Umbraco.Core/Logging/ImageProcessorLogger.cs diff --git a/build/NuSpecs/UmbracoCms.Core.nuspec b/build/NuSpecs/UmbracoCms.Core.nuspec index cbabc01bb7..a486f8a58b 100644 --- a/build/NuSpecs/UmbracoCms.Core.nuspec +++ b/build/NuSpecs/UmbracoCms.Core.nuspec @@ -32,8 +32,8 @@ - - + + diff --git a/src/Umbraco.Core/Logging/ImageProcessorLogger.cs b/src/Umbraco.Core/Logging/ImageProcessorLogger.cs deleted file mode 100644 index 02ca9c2949..0000000000 --- a/src/Umbraco.Core/Logging/ImageProcessorLogger.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace Umbraco.Core.Logging -{ - using System; - using System.Runtime.CompilerServices; - - using ImageProcessor.Common.Exceptions; - - /// - /// A logger for explicitly logging ImageProcessor exceptions. - /// - /// Creating this logger is enough for ImageProcessor to find and replace its in-built debug logger - /// without any additional configuration required. This class currently has to be public in order - /// to do so. - /// - /// - public sealed class ImageProcessorLogger : ImageProcessor.Common.Exceptions.ILogger - { - /// - /// Logs the specified message as an error. - /// - /// The type calling the logger. - /// The message to log. - /// The property or method name calling the log. - /// The line number where the method is called. - public void Log(string text, [CallerMemberName] string callerName = null, [CallerLineNumber] int lineNumber = 0) - { - // Using LogHelper since the ImageProcessor logger expects a parameterless constructor. - var message = string.Format("{0} {1} : {2}", callerName, lineNumber, text); - LogHelper.Error(string.Empty, new ImageProcessingException(message)); - } - - /// - /// Logs the specified message as an error. - /// - /// The type calling the logger. - /// The message to log. - /// The property or method name calling the log. - /// The line number where the method is called. - public void Log(Type type, string text, [CallerMemberName] string callerName = null, [CallerLineNumber] int lineNumber = 0) - { - // Using LogHelper since the ImageProcessor logger expects a parameterless constructor. - var message = string.Format("{0} {1} : {2}", callerName, lineNumber, text); - LogHelper.Error(type, string.Empty, new ImageProcessingException(message)); - } - } -} diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index e3cf2206e2..3e14fc7758 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -52,10 +52,6 @@ ..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll - - ..\packages\ImageProcessor.2.4.1.0\lib\net45\ImageProcessor.dll - True - False ..\packages\log4net-mediumtrust.2.0.0\lib\log4net.dll @@ -357,7 +353,6 @@ - diff --git a/src/Umbraco.Core/packages.config b/src/Umbraco.Core/packages.config index a9241f46c8..b69be5b5cc 100644 --- a/src/Umbraco.Core/packages.config +++ b/src/Umbraco.Core/packages.config @@ -2,7 +2,6 @@ - diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 6911829bb8..004b791890 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -136,12 +136,12 @@ False ..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll - - ..\packages\ImageProcessor.2.4.1.0\lib\net45\ImageProcessor.dll + + ..\packages\ImageProcessor.2.3.3.0\lib\net45\ImageProcessor.dll True - - ..\packages\ImageProcessor.Web.4.6.1.0\lib\net45\ImageProcessor.Web.dll + + ..\packages\ImageProcessor.Web.4.5.3.0\lib\net45\ImageProcessor.Web.dll True diff --git a/src/Umbraco.Web.UI/packages.config b/src/Umbraco.Web.UI/packages.config index 7891f928e8..e85831fd82 100644 --- a/src/Umbraco.Web.UI/packages.config +++ b/src/Umbraco.Web.UI/packages.config @@ -5,8 +5,8 @@ - - + +