Merge remote-tracking branch 'origin/6.2.0' into 7.0.2
Conflicts: src/Umbraco.Web.UI/umbraco/controls/GenericProperties/GenericProperty.ascx
This commit is contained in:
@@ -377,8 +377,16 @@ namespace Umbraco.Core.Models
|
||||
//Check against Regular Expression for Legacy DataTypes - Validation exists and value is not null:
|
||||
if(string.IsNullOrEmpty(ValidationRegExp) == false && (value != null && string.IsNullOrEmpty(value.ToString()) == false))
|
||||
{
|
||||
var regexPattern = new Regex(ValidationRegExp);
|
||||
return regexPattern.IsMatch(value.ToString());
|
||||
try
|
||||
{
|
||||
var regexPattern = new Regex(ValidationRegExp);
|
||||
return regexPattern.IsMatch(value.ToString());
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw new Exception(string .Format("Invalid validation expression on property {0}",this.Alias));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//TODO Add PropertyEditor validation when its relevant to introduce
|
||||
|
||||
@@ -31,37 +31,47 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<cc1:Pane runat="server">
|
||||
<cc1:PropertyPanel runat="server" Text="Name">
|
||||
<cc1:Pane ID="Pane1" runat="server">
|
||||
<cc1:PropertyPanel ID="PropertyPanel1" runat="server" Text="Name">
|
||||
<asp:TextBox ID="tbName" runat="server" CssClass="propertyFormInput prop-name"></asp:TextBox>
|
||||
</cc1:PropertyPanel>
|
||||
|
||||
<cc1:PropertyPanel ID="PropertyPanel1" runat="server" Text="Alias">
|
||||
<cc1:PropertyPanel ID="PropertyPanel2" runat="server" Text="Alias">
|
||||
<asp:TextBox ID="tbAlias" runat="server" CssClass="propertyFormInput prop-alias"></asp:TextBox>
|
||||
</cc1:PropertyPanel>
|
||||
|
||||
<cc1:PropertyPanel ID="PropertyPanel2" runat="server" Text="Type">
|
||||
<cc1:PropertyPanel ID="PropertyPanel3" runat="server" Text="Type">
|
||||
<asp:DropDownList ID="ddlTypes" runat="server" CssClass="propertyFormInput"></asp:DropDownList>
|
||||
</cc1:PropertyPanel>
|
||||
|
||||
<cc1:PropertyPanel ID="PropertyPanel3" runat="server" Text="Tab">
|
||||
<cc1:PropertyPanel ID="PropertyPanel4" runat="server" Text="Tab">
|
||||
<asp:DropDownList ID="ddlTab" runat="server" CssClass="propertyFormInput"></asp:DropDownList>
|
||||
</cc1:PropertyPanel>
|
||||
|
||||
<cc1:PropertyPanel ID="PropertyPanel4" runat="server" Text="Mandatory">
|
||||
<cc1:PropertyPanel ID="PropertyPanel5" runat="server" Text="Mandatory">
|
||||
<asp:CheckBox ID="checkMandatory" runat="server"></asp:CheckBox>
|
||||
</cc1:PropertyPanel>
|
||||
|
||||
<cc1:PropertyPanel ID="PropertyPanel5" runat="server" Text="Validation">
|
||||
<cc1:PropertyPanel ID="PropertyPanel6" runat="server" Text="Validation">
|
||||
<asp:TextBox ID="tbValidation" runat="server" TextMode="MultiLine" CssClass="propertyFormInput"></asp:TextBox><br />
|
||||
<asp:CustomValidator runat="server" ID="cvValidation" ControlToValidate="tbValidation" ErrorMessage="Invalid expression" ClientValidationFunction="ValidateValidation" /><br />
|
||||
<small>
|
||||
<asp:HyperLink ID="validationLink" runat="server">Search for a regular expression</asp:HyperLink></small>
|
||||
</cc1:PropertyPanel>
|
||||
|
||||
<cc1:PropertyPanel ID="PropertyPanel6" runat="server" Text="Description">
|
||||
<cc1:PropertyPanel ID="PropertyPanel7" runat="server" Text="Description">
|
||||
<asp:TextBox ID="tbDescription" runat="server" CssClass="propertyFormInput" TextMode="MultiLine"></asp:TextBox>
|
||||
</cc1:PropertyPanel>
|
||||
</cc1:Pane>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</li>
|
||||
function ValidateValidation(sender, args) {
|
||||
try {
|
||||
var patt = new RegExp(args.Value);
|
||||
args.IsValid = true;
|
||||
|
||||
} catch (e) {
|
||||
args.IsValid = false;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Xml.XPath;
|
||||
using umbraco;
|
||||
using umbraco.NodeFactory;
|
||||
using Umbraco.Core;
|
||||
|
||||
@@ -37,17 +36,17 @@ namespace umbraco
|
||||
XPathExpression xPathExpression;
|
||||
|
||||
// Check to see if XPathExpression is in the cache
|
||||
if (HttpContext.Current.Cache[xpath] == null)
|
||||
{
|
||||
if (HttpRuntime.Cache[xpath] == null)
|
||||
{
|
||||
// Build Compiled XPath expression
|
||||
xPathExpression = xPathNavigator.Compile(xpath);
|
||||
|
||||
// Store in Cache
|
||||
HttpContext.Current.Cache[xpath] = xPathExpression;
|
||||
HttpRuntime.Cache[xpath] = xPathExpression;
|
||||
}
|
||||
else // Get from Cache
|
||||
{
|
||||
xPathExpression = (XPathExpression)HttpContext.Current.Cache[xpath];
|
||||
xPathExpression = (XPathExpression)HttpRuntime.Cache[xpath];
|
||||
}
|
||||
|
||||
// [LK] Interested in exploring options to call custom extension methods in XPath expressions.
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace umbraco.cms.businesslogic.web
|
||||
|
||||
public static Domain GetDomain(string DomainName)
|
||||
{
|
||||
return GetDomains().FirstOrDefault(d => d.Name == DomainName);
|
||||
return GetDomains().FirstOrDefault(d => d.Name.InvariantEquals(DomainName));
|
||||
}
|
||||
|
||||
public static int GetRootFromDomain(string DomainName)
|
||||
|
||||
Reference in New Issue
Block a user