#19064: Fixing how User content items are updated

The part records where updated but no events were triggered because Publish
was not called correctly. It needed a Get(DraftRequired) and
ContentManager.Publish(user)

Work Item: 19064

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-10-02 11:51:14 -07:00
parent 94185dd8df
commit b57793d890

View File

@@ -229,7 +229,7 @@ namespace Orchard.Users.Controllers {
if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not authorized to manage users")))
return new HttpUnauthorizedResult();
var user = Services.ContentManager.Get<UserPart>(id);
var user = Services.ContentManager.Get<UserPart>(id, VersionOptions.DraftRequired);
string previousName = user.UserName;
dynamic model = Services.ContentManager.UpdateEditor(user, this);
@@ -264,6 +264,8 @@ namespace Orchard.Users.Controllers {
return View((object)model);
}
Services.ContentManager.Publish(user.ContentItem);
Services.Notifier.Information(T("User information updated"));
return RedirectToAction("Index");
}