Merge remote-tracking branch 'origin/6.1.4' into 7.0.0

Conflicts:
	.gitignore
	src/Umbraco.Core/Models/PropertyExtensions.cs
	src/Umbraco.Core/Models/PropertyTypeExtensions.cs
	src/Umbraco.Core/Security/AuthenticationExtensions.cs
	src/Umbraco.Core/Security/UmbracoBackOfficeIdentity.cs
	src/Umbraco.Core/Security/UserData.cs
	src/Umbraco.Core/Umbraco.Core.csproj
	src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs
	src/Umbraco.Tests/TestHelpers/BaseUmbracoApplicationTest.cs
	src/Umbraco.Tests/Umbraco.Tests.csproj
	src/Umbraco.Web/Security/WebSecurity.cs
	src/Umbraco.Web/UmbracoModule.cs
	src/umbraco.businesslogic/BasePages/BasePage.cs
	src/umbraco.cms/businesslogic/datatype/DefaultData.cs
	src/umbraco.sln
This commit is contained in:
Shannon
2013-08-07 10:29:34 +10:00
27 changed files with 540 additions and 200 deletions

View File

@@ -15,7 +15,12 @@ namespace Umbraco.Core.Models
/// <returns>Xml of the property and its value</returns>
public static XElement ToXml(this Property property)
{
string nodeName = UmbracoSettings.UseLegacyXmlSchema ? "data" : property.Alias.ToSafeAlias();
return property.ToXml(ApplicationContext.Current.Services.DataTypeService);
}
internal static XElement ToXml(this Property property, IDataTypeService dataTypeService)
{
var nodeName = UmbracoSettings.UseLegacyXmlSchema ? "data" : property.Alias.ToSafeAlias();
var xd = new XmlDocument();
var xmlNode = xd.CreateNode(XmlNodeType.Element, nodeName, "");
@@ -37,6 +42,16 @@ namespace Umbraco.Core.Models
//var dataType = ApplicationContext.Current.Services.DataTypeService.GetDataTypeDefinitionById(property.PropertyType.DataTypeDefinitionId);
//if (dataType == null) throw new InvalidOperationException("No data type definition found with id " + property.PropertyType.DataTypeDefinitionId);
//We've already got the value for the property so we're going to give it to the
// data type's data property so it doesn't go re-look up the value from the db again.
var defaultData = dt.Data as IDataValueSetter;
if (defaultData != null)
{
defaultData.SetValue(property.Value, property.PropertyType.DataTypeDatabaseType.ToString());
}
xmlNode.AppendChild(dt.Data.ToXMl(xd));
var propertyEditor = PropertyEditorResolver.Current.GetById(property.PropertyType.DataTypeId);
if (propertyEditor != null)
{