From dd40dd964c6d0bdb9fedc540d836714d9d46d277 Mon Sep 17 00:00:00 2001 From: AndyButland Date: Wed, 10 May 2017 17:44:30 +0200 Subject: [PATCH 1/9] Ordered media types when returned for create dialog --- src/Umbraco.Web/Editors/MediaTypeController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Editors/MediaTypeController.cs b/src/Umbraco.Web/Editors/MediaTypeController.cs index 879ffd3d0a..32d3ba6f34 100644 --- a/src/Umbraco.Web/Editors/MediaTypeController.cs +++ b/src/Umbraco.Web/Editors/MediaTypeController.cs @@ -230,7 +230,7 @@ namespace Umbraco.Web.Editors basic.Description = TranslateItem(basic.Description); } - return basics; + return basics.OrderBy(x => x.Name); } /// From ce618d289b8239d7c4396b34d2c334f2cead6acf Mon Sep 17 00:00:00 2001 From: AndyButland Date: Mon, 5 Jun 2017 16:43:17 +0200 Subject: [PATCH 2/9] Extended HttpsCheck healthcheck to check for expiring SSL certificate --- src/Umbraco.Web.UI/umbraco/config/lang/en.xml | 4 +- .../umbraco/config/lang/en_us.xml | 4 +- .../HealthCheck/Checks/Security/HttpsCheck.cs | 42 ++++++++++++++++--- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index d99cd8f43f..22a97054e4 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -1474,8 +1474,10 @@ To manage your website, simply open the Umbraco back office and start adding con Media - Total XML: %0%, Total: %1%, Total invalid: %2% Content - Total XML: %0%, Total published: %1%, Total invalid: %2% - Your site certificate was marked as valid. + Your website's certificate is valid. Certificate validation error: '%0%' + Your website's SSL certificate has expired. + Your website's SSL certificate is expiring in %0% days. Error pinging the URL %0% - '%1%' You are currently %0% viewing the site using the HTTPS scheme. The appSetting 'umbracoUseSSL' is set to 'false' in your web.config file. Once you access this site using the HTTPS scheme, that should be set to 'true'. diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml index 63fc12101f..1847892530 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml @@ -1469,8 +1469,10 @@ To manage your website, simply open the Umbraco back office and start adding con Media - Total XML: %0%, Total: %1%, Total invalid: %2% Content - Total XML: %0%, Total published: %1%, Total invalid: %2% - Your site certificate was marked as valid. + Your website's certificate is valid. Certificate validation error: '%0%' + Your website's SSL certificate has expired. + Your website's SSL certificate is expiring in %0% days. Error pinging the URL %0% - '%1%' You are currently %0% viewing the site using the HTTPS scheme. The appSetting 'umbracoUseSSL' is set to 'false' in your web.config file. Once you access this site using the HTTPS scheme, that should be set to 'true'. diff --git a/src/Umbraco.Web/HealthCheck/Checks/Security/HttpsCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/Security/HttpsCheck.cs index 4e2dc4f8f5..b50fc99a6e 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Security/HttpsCheck.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Security/HttpsCheck.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Net; +using System.Security.Cryptography.X509Certificates; using System.Web; using Umbraco.Core.IO; using Umbraco.Core.Services; @@ -53,7 +54,7 @@ namespace Umbraco.Web.HealthCheck.Checks.Security private HealthCheckStatus CheckForValidCertificate() { var message = string.Empty; - var success = false; + StatusResultType result; var url = HealthCheckContext.HttpContext.Request.Url; // Attempt to access the site over HTTPS to see if it HTTPS is supported @@ -65,7 +66,37 @@ namespace Umbraco.Web.HealthCheck.Checks.Security try { var response = (HttpWebResponse)request.GetResponse(); - success = response.StatusCode == HttpStatusCode.OK; + if (response.StatusCode == HttpStatusCode.OK) + { + // Got a valid response, check now for if certificate expiring within 14 days + // Hat-tip: https://stackoverflow.com/a/15343898/489433 + const int NumberOfDaysForExpiryWarning = 14; + var cert = request.ServicePoint.Certificate; + var cert2 = new X509Certificate2(cert); + var expirationDate = cert2.NotAfter; + + var daysToExpiry = (int)Math.Floor((cert2.NotAfter - DateTime.Now).TotalDays); + if (daysToExpiry <= 0) + { + result = StatusResultType.Error; + message = _textService.Localize("healthcheck/httpsCheckExpiredCertificate"); + } + else if (daysToExpiry < NumberOfDaysForExpiryWarning) + { + result = StatusResultType.Warning; + message = _textService.Localize("healthcheck/httpsCheckExpiringCertificate", new[] { daysToExpiry.ToString() }); + } + else + { + result = StatusResultType.Success; + message = _textService.Localize("healthcheck/httpsCheckValidCertificate"); + } + } + else + { + result = StatusResultType.Error; + message = _textService.Localize("healthcheck/httpsCheckInvalidUrl", new[] { address, response.StatusDescription }); + } } catch (Exception ex) { @@ -80,17 +111,16 @@ namespace Umbraco.Web.HealthCheck.Checks.Security { message = _textService.Localize("healthcheck/httpsCheckInvalidUrl", new[] { address, ex.Message }); } + + result = StatusResultType.Error; } var actions = new List(); - if (success) - message = _textService.Localize("healthcheck/httpsCheckValidCertificate"); - return new HealthCheckStatus(message) { - ResultType = success ? StatusResultType.Success : StatusResultType.Error, + ResultType = result, Actions = actions }; } From 993513b1388d2725cc11dcd864da30665d98cc6d Mon Sep 17 00:00:00 2001 From: Harvey Williams Date: Thu, 8 Jun 2017 15:17:34 +0100 Subject: [PATCH 3/9] Fix for `IsDocumentTypeRecursive` - U4-9997 Potential fix to issue logged on: http://issues.umbraco.org/issue/U4-9997 --- src/Umbraco.Web/PublishedContentExtensions.cs | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/Umbraco.Web/PublishedContentExtensions.cs b/src/Umbraco.Web/PublishedContentExtensions.cs index 36d1306ab6..1c1aa2d5a2 100644 --- a/src/Umbraco.Web/PublishedContentExtensions.cs +++ b/src/Umbraco.Web/PublishedContentExtensions.cs @@ -634,14 +634,10 @@ namespace Umbraco.Web private static bool IsDocumentTypeRecursive(IPublishedContent content, string docTypeAlias) { var contentTypeService = UmbracoContext.Current.Application.Services.ContentTypeService; - var type = contentTypeService.GetContentType(content.DocumentTypeAlias); - while (type != null && type.ParentId > 0) - { - type = contentTypeService.GetContentType(type.ParentId); - if (type.Alias.InvariantEquals(docTypeAlias)) - return true; - } - return false; + var type = contentTypeService.GetContentType(content.DocumentTypeAlias); + if (type.Alias.InvariantEquals(docTypeAlias) || content.IsComposedOf(docTypeAlias)) + return true; + return false; } public static bool IsNull(this IPublishedContent content, string alias, bool recurse) @@ -912,14 +908,14 @@ namespace Umbraco.Web #region Axes: ancestors, ancestors-or-self - // as per XPath 1.0 specs §2.2, + // as per XPath 1.0 specs §2.2, // - the ancestor axis contains the ancestors of the context node; the ancestors of the context node consist // of the parent of context node and the parent's parent and so on; thus, the ancestor axis will always // include the root node, unless the context node is the root node. // - the ancestor-or-self axis contains the context node and the ancestors of the context node; thus, // the ancestor axis will always include the root node. // - // as per XPath 2.0 specs §3.2.1.1, + // as per XPath 2.0 specs §3.2.1.1, // - the ancestor axis is defined as the transitive closure of the parent axis; it contains the ancestors // of the context node (the parent, the parent of the parent, and so on) - The ancestor axis includes the // root node of the tree in which the context node is found, unless the context node is the root node. @@ -929,7 +925,7 @@ namespace Umbraco.Web // the ancestor and ancestor-or-self axis are reverse axes ie they contain the context node or nodes that // are before the context node in document order. // - // document order is defined by §2.4.1 as: + // document order is defined by §2.4.1 as: // - the root node is the first node. // - every node occurs before all of its children and descendants. // - the relative order of siblings is the order in which they occur in the children property of their parent node. @@ -1240,12 +1236,12 @@ namespace Umbraco.Web } - // as per XPath 1.0 specs §2.2, + // as per XPath 1.0 specs §2.2, // - the descendant axis contains the descendants of the context node; a descendant is a child or a child of a child and so on; thus // the descendant axis never contains attribute or namespace nodes. // - the descendant-or-self axis contains the context node and the descendants of the context node. // - // as per XPath 2.0 specs §3.2.1.1, + // as per XPath 2.0 specs §3.2.1.1, // - the descendant axis is defined as the transitive closure of the child axis; it contains the descendants of the context node (the // children, the children of the children, and so on). // - the descendant-or-self axis contains the context node and the descendants of the context node. @@ -1253,7 +1249,7 @@ namespace Umbraco.Web // the descendant and descendant-or-self axis are forward axes ie they contain the context node or nodes that are after the context // node in document order. // - // document order is defined by §2.4.1 as: + // document order is defined by §2.4.1 as: // - the root node is the first node. // - every node occurs before all of its children and descendants. // - the relative order of siblings is the order in which they occur in the children property of their parent node. From 047eb893eb54b0198761d42cb1599773dd2ef466 Mon Sep 17 00:00:00 2001 From: Jeavon Date: Tue, 13 Jun 2017 12:28:59 +0100 Subject: [PATCH 4/9] Switches Umbraco.MediaPicker (double legacy) to being converted by MultipleMediaPickerPropertyConverter so that it actually works Renames MultipleMediaPickerPropertyConverter to LegacyMediaPickerPropertyConverter (delete for v8) --- .../Cache/DataTypeCacheRefresher.cs | 2 +- ...s => LegacyMediaPickerPropertyConverter.cs} | 18 ++++++++++++------ .../MediaPickerPropertyConverter.cs | 4 ---- src/Umbraco.Web/Umbraco.Web.csproj | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) rename src/Umbraco.Web/PropertyEditors/ValueConverters/{MultipleMediaPickerPropertyConverter.cs => LegacyMediaPickerPropertyConverter.cs} (91%) diff --git a/src/Umbraco.Web/Cache/DataTypeCacheRefresher.cs b/src/Umbraco.Web/Cache/DataTypeCacheRefresher.cs index 34ca2ceec0..12fd41a83d 100644 --- a/src/Umbraco.Web/Cache/DataTypeCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/DataTypeCacheRefresher.cs @@ -114,7 +114,7 @@ namespace Umbraco.Web.Cache }); TagsValueConverter.ClearCaches(); - MultipleMediaPickerPropertyConverter.ClearCaches(); + LegacyMediaPickerPropertyConverter.ClearCaches(); SliderValueConverter.ClearCaches(); MediaPickerPropertyConverter.ClearCaches(); diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/MultipleMediaPickerPropertyConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/LegacyMediaPickerPropertyConverter.cs similarity index 91% rename from src/Umbraco.Web/PropertyEditors/ValueConverters/MultipleMediaPickerPropertyConverter.cs rename to src/Umbraco.Web/PropertyEditors/ValueConverters/LegacyMediaPickerPropertyConverter.cs index 161e7178e7..db115f58de 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/MultipleMediaPickerPropertyConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/LegacyMediaPickerPropertyConverter.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // Umbraco // // @@ -24,20 +24,20 @@ using Umbraco.Core.Services; namespace Umbraco.Web.PropertyEditors.ValueConverters { /// - /// The multiple media picker property value converter. + /// The multiple media picker and double legacy media picker property value converter, should be deleted for v8 /// [DefaultPropertyValueConverter(typeof(MustBeStringValueConverter))] - public class MultipleMediaPickerPropertyConverter : PropertyValueConverterBase, IPropertyValueConverterMeta + public class LegacyMediaPickerPropertyConverter : PropertyValueConverterBase, IPropertyValueConverterMeta { private readonly IDataTypeService _dataTypeService; //TODO: Remove this ctor in v8 since the other one will use IoC - public MultipleMediaPickerPropertyConverter() + public LegacyMediaPickerPropertyConverter() : this(ApplicationContext.Current.Services.DataTypeService) { } - public MultipleMediaPickerPropertyConverter(IDataTypeService dataTypeService) + public LegacyMediaPickerPropertyConverter(IDataTypeService dataTypeService) { if (dataTypeService == null) throw new ArgumentNullException("dataTypeService"); _dataTypeService = dataTypeService; @@ -58,6 +58,12 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters { return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.MultipleMediaPickerAlias); } + + if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters) + { + // this is the double legacy media picker, it can pick only single media items + return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.MediaPickerAlias); + } return false; } @@ -109,7 +115,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters ApplicationContext.Current.Services.DataTypeService.GetDataTypeDefinitionById( propertyType.DataTypeId).Name); - LogHelper.Warn(error); + LogHelper.Warn(error); throw new Exception(error); } } diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/MediaPickerPropertyConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/MediaPickerPropertyConverter.cs index 5f54363975..2e9d0c7d96 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/MediaPickerPropertyConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/MediaPickerPropertyConverter.cs @@ -126,10 +126,6 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters if (propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.MediaPicker2Alias)) return true; - if (UmbracoConfig.For.UmbracoSettings().Content.EnablePropertyValueConverters) - { - return propertyType.PropertyEditorAlias.Equals(Constants.PropertyEditors.MediaPickerAlias); - } return false; } diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 0b5652e509..0ee2bfd37d 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -411,7 +411,7 @@ - + From 733aab6eb5327a11322a7fa54e725caf9187559e Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Fri, 7 Jul 2017 18:57:57 +0200 Subject: [PATCH 5/9] Fix vertical separator color and height of icon in custom section --- src/Umbraco.Web.UI.Client/src/less/sections.less | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/sections.less b/src/Umbraco.Web.UI.Client/src/less/sections.less index 51ec5c7436..371f5ac79d 100644 --- a/src/Umbraco.Web.UI.Client/src/less/sections.less +++ b/src/Umbraco.Web.UI.Client/src/less/sections.less @@ -7,7 +7,7 @@ ul.sections { background: @purple; height: 100%; width: 80px; - border-right: 1px solid @purple; + border-right: 1px solid @purple-d1; } ul.sections li { @@ -22,13 +22,16 @@ ul.sections li [class^="icon-"], ul.sections li [class*=" icon-"], ul.sections li img.icon-section { font-size: 30px; - line-height: 20px; /* set line-height to ensure all icons use same line-height */ display: inline-block; margin: 1px 0 0 0; color: @purple-l2; -webkit-transition: all .3s linear; -moz-transition: all .3s linear; transition: all .3s linear; + + &, &:before { + line-height: 20px; /* set line-height to ensure all icons use same line-height */ + } } ul.sections:hover li [class^="icon-"], @@ -168,7 +171,7 @@ ul.sections-tray { width: 80px; & > li:first-child > a { - border-top: 1px solid @purple; + border-top: 1px solid @purple-d1; } & > li { From dd041a6f0977321d6f5ad864c09550378554e374 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Fri, 7 Jul 2017 19:16:42 +0200 Subject: [PATCH 6/9] Ensure it override injected styles from custom font icon --- src/Umbraco.Web.UI.Client/src/less/sections.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/sections.less b/src/Umbraco.Web.UI.Client/src/less/sections.less index 371f5ac79d..d73e24e4ea 100644 --- a/src/Umbraco.Web.UI.Client/src/less/sections.less +++ b/src/Umbraco.Web.UI.Client/src/less/sections.less @@ -30,7 +30,7 @@ ul.sections li img.icon-section { transition: all .3s linear; &, &:before { - line-height: 20px; /* set line-height to ensure all icons use same line-height */ + line-height: 20px !important; /* set line-height to ensure all icons use same line-height */ } } From e28ba446a0a0562f7b9da40220f8cec716b269a5 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Sat, 8 Jul 2017 01:20:26 +0200 Subject: [PATCH 7/9] Open context menu when clicking "Do something else" --- src/Umbraco.Web.UI.Client/src/views/member/create.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/member/create.html b/src/Umbraco.Web.UI.Client/src/views/member/create.html index 2ef2b5f04f..188c6214eb 100644 --- a/src/Umbraco.Web.UI.Client/src/views/member/create.html +++ b/src/Umbraco.Web.UI.Client/src/views/member/create.html @@ -20,7 +20,7 @@ From 8ea1af56ab58312c21fa7e54261b99f16543e96f Mon Sep 17 00:00:00 2001 From: John Kilmister Date: Tue, 11 Jul 2017 16:22:21 +0100 Subject: [PATCH 8/9] U4-10143 - Improved error messages when we retrieve current xml node --- src/Umbraco.Web/umbraco.presentation/library.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/umbraco.presentation/library.cs b/src/Umbraco.Web/umbraco.presentation/library.cs index 38b8b1b95d..4ab89c5c7d 100644 --- a/src/Umbraco.Web/umbraco.presentation/library.cs +++ b/src/Umbraco.Web/umbraco.presentation/library.cs @@ -1393,15 +1393,25 @@ namespace umbraco /// An XpathNodeIterator containing the current page as Xml. public static XPathNodeIterator GetXmlNodeCurrent() { + var pageId = ""; + try { var nav = Umbraco.Web.UmbracoContext.Current.ContentCache.GetXPathNavigator(); - nav.MoveToId(HttpContext.Current.Items["pageID"].ToString()); + var pageIdItem = HttpContext.Current.Items["pageID"]; + + if (pageIdItem == null) + { + throw new NullReferenceException("pageID not found in the current HTTP context"); + } + + pageId = pageIdItem.ToString(); + nav.MoveToId(pageId); return nav.Select("."); } catch (Exception ex) { - LogHelper.Error("Could not retrieve current xml node", ex); + LogHelper.Error(string.Concat("Could not retrieve current xml node for page Id ",pageId), ex); } XmlDocument xd = new XmlDocument(); From cb1d347769265ad78787bcd83b83551699046f22 Mon Sep 17 00:00:00 2001 From: Mike Chambers Date: Mon, 17 Jul 2017 15:54:11 +0100 Subject: [PATCH 9/9] Update treepicker.html resolves U4-10171 can't click remove icon, to remove picker item. --- .../src/views/prevalueeditors/treepicker.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html index 1ffa878818..5ec114fc19 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html @@ -4,7 +4,7 @@ ng-model="renderModel">
  • - + {{node.name}}