Merge branch '6.1.3' of https://github.com/umbraco/Umbraco-CMS into 6.1.3

This commit is contained in:
Morten Christensen
2013-07-03 12:34:52 +02:00
4 changed files with 16 additions and 2 deletions

View File

@@ -535,6 +535,11 @@ namespace Umbraco.Core.Models
return ApplicationContext.Current.Services.PackagingService.Export(media);
}
internal static XElement ToDeepXml(this IMedia media)
{
return ApplicationContext.Current.Services.PackagingService.Export(media, true);
}
/// <summary>
/// Creates the xml representation for the <see cref="IContent"/> object
/// </summary>

View File

@@ -28,7 +28,12 @@ namespace Umbraco.Core.Models
}
//This seems to fail during testing
xmlNode.AppendChild(property.PropertyType.DataType(property.Id).Data.ToXMl(xd));
//SD: With the new null checks below, this shouldn't fail anymore.
var dt = property.PropertyType.DataType(property.Id);
if (dt != null && dt.Data != null)
{
xmlNode.AppendChild(dt.Data.ToXMl(xd));
}
var element = xmlNode.GetXElement();
return element;

View File

@@ -20,6 +20,10 @@ namespace Umbraco.Core.Models
{
Mandate.ParameterNotNull(propertyType, "propertyType");
var dataType = ApplicationContext.Current.Services.DataTypeService.GetDataTypeById(propertyType.DataTypeId);
if (dataType == null)
{
return null;
}
dataType.DataTypeDefinitionId = propertyType.DataTypeDefinitionId;
dataType.Data.PropertyId = propertyId;
return dataType;

View File

@@ -45,7 +45,7 @@ namespace UmbracoExamine.DataServices
var xmlMedia = XDocument.Parse("<media></media>");
foreach (var m in _services.MediaService.GetRootMedia())
{
xmlMedia.Root.Add(m.ToXml());
xmlMedia.Root.Add(m.ToDeepXml());
}
var result = ((IEnumerable)xmlMedia.XPathEvaluate(xpath)).Cast<XElement>();
return result.ToXDocument();