#18648: User SuperUser in import if owner is not found

Work Item: 18648

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-07-02 17:21:33 -07:00
parent 9b01b302b5
commit ca2bba85f6

View File

@@ -84,6 +84,10 @@ namespace Orchard.Core.Common.Drivers {
var contentIdentity = new ContentIdentity(owner);
part.Owner = _membershipService.GetUser(contentIdentity.Get("User.UserName"));
}
// use the super user if the referenced one doesn't exist
else {
part.Owner = _membershipService.GetUser(Services.WorkContext.CurrentSite.SuperUser);
}
var container = context.Attribute(part.PartDefinition.Name, "Container");
if (container != null) {