mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#18909: Deleting associated publishing tasks when a content item is deleted
Work Item: 18909 --HG-- branch : 1.x
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.PublishLater.Models;
|
||||
using Orchard.PublishLater.Services;
|
||||
using Orchard.Tasks.Scheduling;
|
||||
|
||||
namespace Orchard.PublishLater.Handlers {
|
||||
public class PublishLaterPartHandler : ContentHandler {
|
||||
private readonly IPublishLaterService _publishLaterService;
|
||||
|
||||
public PublishLaterPartHandler(IPublishLaterService publishLaterService) {
|
||||
public PublishLaterPartHandler(
|
||||
IPublishLaterService publishLaterService,
|
||||
IPublishingTaskManager publishingTaskManager) {
|
||||
_publishLaterService = publishLaterService;
|
||||
|
||||
OnLoading<PublishLaterPart>((context, part) => LazyLoadHandlers(part));
|
||||
OnVersioning<PublishLaterPart>((context, part, newVersionPart) => LazyLoadHandlers(newVersionPart));
|
||||
OnRemoved<PublishLaterPart>((context, part) => publishingTaskManager.DeleteTasks(part.ContentItem));
|
||||
}
|
||||
|
||||
protected void LazyLoadHandlers(PublishLaterPart part) {
|
||||
|
Reference in New Issue
Block a user