From 657f165ffbc346ab28462fec2f4f7b678cf97ea3 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 17 Dec 2012 12:22:11 -0100 Subject: [PATCH 1/9] Created branch 4.11.2 From 51204ee401c8378dbb1cefcd02829abf9e2997d3 Mon Sep 17 00:00:00 2001 From: Stephan Date: Tue, 11 Dec 2012 17:37:33 -0100 Subject: [PATCH 2/9] U4-1212 - bugfix Document.PathPublished --- src/umbraco.cms/businesslogic/web/Document.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/umbraco.cms/businesslogic/web/Document.cs b/src/umbraco.cms/businesslogic/web/Document.cs index 7864d0ef02..ed35422088 100644 --- a/src/umbraco.cms/businesslogic/web/Document.cs +++ b/src/umbraco.cms/businesslogic/web/Document.cs @@ -783,7 +783,7 @@ namespace umbraco.cms.businesslogic.web int x = SqlHelper.ExecuteScalar(@"select count(node.id) - count(doc.nodeid) from umbracoNode as node left join cmsDocument as doc on (node.id=doc.nodeId and doc.published=1) -where '" + Path + ",' like " + SqlHelper.Concat("node.path", "'%'")); +where '" + Path + ",' like " + SqlHelper.Concat("node.path", "',%'")); return (x == 1); } } From a70ef52964b4e1717369ef4a162806f7bed33a54 Mon Sep 17 00:00:00 2001 From: Stephan Date: Fri, 30 Nov 2012 13:33:24 -0100 Subject: [PATCH 3/9] fix xpath syntax error with legacy XML schema --- src/Umbraco.Web/DefaultPublishedContentStore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web/DefaultPublishedContentStore.cs b/src/Umbraco.Web/DefaultPublishedContentStore.cs index 1b8dfddc7c..bb54717c26 100644 --- a/src/Umbraco.Web/DefaultPublishedContentStore.cs +++ b/src/Umbraco.Web/DefaultPublishedContentStore.cs @@ -42,7 +42,7 @@ namespace Umbraco.Web DescendantDocumentById = "//node [@id={0}]"; DescendantDocumentByAlias = "//node[(" + "contains(concat(',',translate(data [@alias='umbracoUrlAlias'], ' ', ''),','),',{0},')" - + " or contains(concat(',',translate(data [@alias='umbracoUrlAlias'], ' ', ''),','),',/{0},'" + + " or contains(concat(',',translate(data [@alias='umbracoUrlAlias'], ' ', ''),','),',/{0},')" + ")]"; ChildDocumentByUrlName = "/node [@urlName='{0}']"; RootDocumentWithLowestSortOrder = "/root/node [not(@sortOrder > ../node/@sortOrder)][1]"; From 06952833ef71df3639cb6dfdb5c7d6f746c9f7c0 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 13 Dec 2012 15:48:46 -0100 Subject: [PATCH 4/9] U4-1212, U4-1312 - fix Document.PathPublished --- src/umbraco.cms/businesslogic/web/Document.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/umbraco.cms/businesslogic/web/Document.cs b/src/umbraco.cms/businesslogic/web/Document.cs index ed35422088..d5a2f362be 100644 --- a/src/umbraco.cms/businesslogic/web/Document.cs +++ b/src/umbraco.cms/businesslogic/web/Document.cs @@ -780,11 +780,15 @@ namespace umbraco.cms.businesslogic.web { get { + // get all nodes in the path to the document, and get all matching published documents + // the difference should be zero if everything is published + // test nodeObjectType to make sure we only count _content_ nodes int x = SqlHelper.ExecuteScalar(@"select count(node.id) - count(doc.nodeid) from umbracoNode as node left join cmsDocument as doc on (node.id=doc.nodeId and doc.published=1) -where '" + Path + ",' like " + SqlHelper.Concat("node.path", "',%'")); - return (x == 1); +where '" + Path + ",' like " + SqlHelper.Concat("node.path", "',%'") + @" +and node.nodeObjectType='C66BA18E-EAF3-4CFF-8A22-41B16D66A972'"); + return (x == 0); } } From db14868324e4aa3e5156c98f7fdf00c37ef8bee0 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Fri, 14 Dec 2012 13:51:01 -0100 Subject: [PATCH 5/9] attributes["macroalias"] would YSOD instead of give back a null --- src/Umbraco.Core/Macros/MacroTagParser.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Umbraco.Core/Macros/MacroTagParser.cs b/src/Umbraco.Core/Macros/MacroTagParser.cs index 62f81ee91d..ad4b180528 100644 --- a/src/Umbraco.Core/Macros/MacroTagParser.cs +++ b/src/Umbraco.Core/Macros/MacroTagParser.cs @@ -66,8 +66,7 @@ namespace Umbraco.Core.Macros } } - - var macroAlias = attributes["macroalias"] ?? attributes["alias"]; + var macroAlias = attributes.ContainsKey("macroalias") ? attributes["macroalias"] : attributes["alias"]; //call the callback now that we have the macro parsed macroFoundCallback(macroAlias, attributes); From 5c0d9785e0a2374182b96c2e8b064185dfcb4f3a Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 17 Dec 2012 09:25:55 -0100 Subject: [PATCH 6/9] Don't check log comment length if it is null.. helped with a broken recycle bin not deleting content because sometimes the title of the content would be null --- src/Umbraco.Web/Routing/PublishedContentRequestBuilder.cs | 5 +++++ src/umbraco.businesslogic/Log.cs | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/Routing/PublishedContentRequestBuilder.cs b/src/Umbraco.Web/Routing/PublishedContentRequestBuilder.cs index d419191f5b..4aa79358a3 100644 --- a/src/Umbraco.Web/Routing/PublishedContentRequestBuilder.cs +++ b/src/Umbraco.Web/Routing/PublishedContentRequestBuilder.cs @@ -201,8 +201,13 @@ namespace Umbraco.Web.Routing // time to read the alternate template alias, from querystring, form, cookie or server vars. // it will be cleared as soon as .PublishedContent change, because then it's not the // expected content anymore and the alternate template does not apply. + if (_umbracoContext.HttpContext.Items["altTemplate"] != null) + _publishedContentRequest.AlternateTemplateAlias = _umbracoContext.HttpContext.Items["altTemplate"].ToString(); + _publishedContentRequest.AlternateTemplateAlias = _umbracoContext.HttpContext.Request["altTemplate"]; + _umbracoContext.HttpContext.Trace.Write(string.Format("test {0}", _publishedContentRequest.AlternateTemplateAlias)); + // handle "not found", follow internal redirects, validate access, template // because these might loop, we have to have some sort of infinite loop detection int i = 0, j = 0; diff --git a/src/umbraco.businesslogic/Log.cs b/src/umbraco.businesslogic/Log.cs index 26dea86a32..ee29e4e157 100644 --- a/src/umbraco.businesslogic/Log.cs +++ b/src/umbraco.businesslogic/Log.cs @@ -87,8 +87,7 @@ namespace umbraco.BusinessLogic if (UmbracoSettings.DisabledLogTypes != null && UmbracoSettings.DisabledLogTypes.SelectSingleNode(String.Format("//logTypeAlias [. = '{0}']", type.ToString().ToLower())) == null) { - - if (comment.Length > 3999) + if (comment != null && comment.Length > 3999) comment = comment.Substring(0, 3955) + "..."; if (UmbracoSettings.EnableAsyncLogging) From 735bd574ffd8ea11a91925cae737ca6611f7f6fb Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 17 Dec 2012 12:29:43 -0100 Subject: [PATCH 7/9] Didn't mean to commit test code, sorry! --- src/Umbraco.Web/Routing/PublishedContentRequestBuilder.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Umbraco.Web/Routing/PublishedContentRequestBuilder.cs b/src/Umbraco.Web/Routing/PublishedContentRequestBuilder.cs index 4aa79358a3..462f8915c9 100644 --- a/src/Umbraco.Web/Routing/PublishedContentRequestBuilder.cs +++ b/src/Umbraco.Web/Routing/PublishedContentRequestBuilder.cs @@ -201,9 +201,6 @@ namespace Umbraco.Web.Routing // time to read the alternate template alias, from querystring, form, cookie or server vars. // it will be cleared as soon as .PublishedContent change, because then it's not the // expected content anymore and the alternate template does not apply. - if (_umbracoContext.HttpContext.Items["altTemplate"] != null) - _publishedContentRequest.AlternateTemplateAlias = _umbracoContext.HttpContext.Items["altTemplate"].ToString(); - _publishedContentRequest.AlternateTemplateAlias = _umbracoContext.HttpContext.Request["altTemplate"]; _umbracoContext.HttpContext.Trace.Write(string.Format("test {0}", _publishedContentRequest.AlternateTemplateAlias)); From 47d1fe70822c3b4ec83dd6a82bf8181fbdd9f631 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Wed, 19 Dec 2012 09:05:23 -0100 Subject: [PATCH 8/9] Fixed U4-703 - Updating or re-installing package causes duplicate trees --- src/umbraco.businesslogic/ApplicationTree.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/umbraco.businesslogic/ApplicationTree.cs b/src/umbraco.businesslogic/ApplicationTree.cs index d5a4ff4ffa..67faf9b7ec 100644 --- a/src/umbraco.businesslogic/ApplicationTree.cs +++ b/src/umbraco.businesslogic/ApplicationTree.cs @@ -260,6 +260,10 @@ namespace umbraco.BusinessLogic LoadXml(doc => { + var el = doc.Root.Elements("add").SingleOrDefault(x => x.Attribute("alias").Value == alias && x.Attribute("application").Value == applicationAlias); + + if (el == null) + { doc.Root.Add(new XElement("add", new XAttribute("silent", silent), new XAttribute("initialize", initialize), @@ -272,6 +276,7 @@ namespace umbraco.BusinessLogic new XAttribute("assembly", assemblyName), new XAttribute("type", type), new XAttribute("action", string.IsNullOrEmpty(action) ? "" : action))); + } }, true); } From c5e7c81c19173505eb9e6d257de1a98635384ea3 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 20 Dec 2012 09:25:50 -0100 Subject: [PATCH 9/9] Notification and tree refresh when unpublishing content --- src/Umbraco.Web.UI/umbraco/config/lang/en.xml | 2 ++ .../umbraco.presentation/umbraco/editContent.aspx.cs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index eeae94e920..cff03cdec8 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -23,6 +23,7 @@ Notifications Public access Publish + Unpublish Reload nodes Republish entire site Permissions @@ -779,6 +780,7 @@ To manage your website, simply open the umbraco back office and start adding con Xslt could not be saved, check file permissions Xslt saved No errors in xslt + Content unpublished Uses CSS syntax ex: h1, .redHeader, .blueTex diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs index 36c89a065b..6ccd3e0ee3 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs @@ -349,6 +349,9 @@ namespace umbraco.cms.presentation library.UnPublishSingleNode(_document.Id); + Current.ClientTools.SyncTree(_document.Path, true); + ClientTools.ShowSpeechBubble(speechBubbleIcon.success, ui.Text("unpublish"), ui.Text("speechBubbles", "contentUnpublished")); + //newPublishStatus.Text = "0"; }