Fix issue with published and modified dates not properly set

--HG--
branch : 1.x
This commit is contained in:
Renaud Paquay
2011-01-06 18:43:26 -08:00
parent 459ee5a0da
commit aa8d357998
3 changed files with 119 additions and 34 deletions

View File

@@ -13,6 +13,7 @@ namespace Orchard.Core.Common.Drivers {
private readonly IAuthenticationService _authenticationService;
private readonly IAuthorizationService _authorizationService;
private readonly IMembershipService _membershipService;
private readonly IClock _clock;
public CommonPartDriver(
IOrchardServices services,
@@ -25,6 +26,7 @@ namespace Orchard.Core.Common.Drivers {
_authenticationService = authenticationService;
_authorizationService = authorizationService;
_membershipService = membershipService;
_clock = clock;
T = NullLocalizer.Instance;
Services = services;
}
@@ -50,6 +52,10 @@ namespace Orchard.Core.Common.Drivers {
}
protected override DriverResult Editor(CommonPart part, IUpdateModel updater, dynamic shapeHelper) {
// this event is hooked so the modified timestamp is changed when an edit-post occurs
part.ModifiedUtc = _clock.UtcNow;
part.VersionModifiedUtc = _clock.UtcNow;
return Combined(
OwnerEditor(part, updater, shapeHelper),
ContainerEditor(part, updater, shapeHelper));