From 12980d09c44609d4677adf52ab48aa5e16ba7683 Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Tue, 29 Mar 2011 15:59:44 -0700 Subject: [PATCH] Making sure changes to the (CommonPart) Owner field are applied. work item: 17143 --HG-- branch : 1.x --- src/Orchard.Web/Core/Common/Drivers/CommonPartDriver.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Orchard.Web/Core/Common/Drivers/CommonPartDriver.cs b/src/Orchard.Web/Core/Common/Drivers/CommonPartDriver.cs index dbb96be4b..d7e7670f5 100644 --- a/src/Orchard.Web/Core/Common/Drivers/CommonPartDriver.cs +++ b/src/Orchard.Web/Core/Common/Drivers/CommonPartDriver.cs @@ -10,7 +10,6 @@ using Orchard.Services; namespace Orchard.Core.Common.Drivers { public class CommonPartDriver : ContentPartDriver { - private const string TemplatePrefix = "CommonPart"; private readonly IContentManager _contentManager; private readonly IAuthenticationService _authenticationService; private readonly IAuthorizationService _authorizationService; @@ -36,6 +35,10 @@ namespace Orchard.Core.Common.Drivers { public Localizer T { get; set; } public IOrchardServices Services { get; set; } + protected override string Prefix { + get { return "CommonPart"; } + } + protected override DriverResult Display(CommonPart part, string displayType, dynamic shapeHelper) { return Combined( ContentShape("Parts_Common_Metadata", @@ -75,7 +78,7 @@ namespace Orchard.Core.Common.Drivers { if (updater != null) { var priorOwner = model.Owner; - updater.TryUpdateModel(model, TemplatePrefix, null, null); + updater.TryUpdateModel(model, Prefix, null, null); if (model.Owner != null && model.Owner != priorOwner) { var newOwner = _membershipService.GetUser(model.Owner); @@ -104,7 +107,7 @@ namespace Orchard.Core.Common.Drivers { if (updater != null) { var priorContainerId = model.ContainerId; - updater.TryUpdateModel(model, TemplatePrefix, null, null); + updater.TryUpdateModel(model, Prefix, null, null); if (model.ContainerId != null && model.ContainerId != priorContainerId) { var newContainer = _contentManager.Get((int)model.ContainerId, VersionOptions.Latest);