diff --git a/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs b/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs index 1b7dbde7ee..d1c99e0717 100644 --- a/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs +++ b/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs @@ -355,19 +355,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; + } } /// 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..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 @@ -53,8 +53,8 @@
- - + +
@@ -63,7 +63,7 @@
@@ -73,7 +73,7 @@
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 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/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); 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 @@ - +