Returning the default value even when the element is found, but not the attribute itself.

This change fixes the issue of a default page size of 0 when setting up a new site.
This commit is contained in:
Sipke Schoorstra
2013-12-16 18:11:19 +00:00
parent 13b73da63b
commit ff7bd9035f

View File

@@ -20,7 +20,8 @@ namespace Orchard.ContentManagement {
? null
: (versioned ? infosetPart.VersionInfoset.Element : infosetPart.Infoset.Element)
.Element(contentPart.GetType().Name);
return el == null ? defaultValue : el.Attr<TProperty>(name);
var attr = el != null ? el.Attribute(name) : default(XAttribute);
return attr == null ? defaultValue : XmlHelper.Parse<TProperty>(attr.Value);
}
public static TProperty Retrieve<TProperty>(this ContentPart contentPart, string name,