diff --git a/src/Orchard.Web/Core/Scheduling/Services/ScheduledTaskManager.cs b/src/Orchard.Web/Core/Scheduling/Services/ScheduledTaskManager.cs index e8f05bde7..2f2007c36 100644 --- a/src/Orchard.Web/Core/Scheduling/Services/ScheduledTaskManager.cs +++ b/src/Orchard.Web/Core/Scheduling/Services/ScheduledTaskManager.cs @@ -56,7 +56,8 @@ namespace Orchard.Core.Scheduling.Services { } public void DeleteTasks(ContentItem contentItem, Func predicate = null ) { - var tasks = _repository + // if contentItem is null, all tasks are used + var tasks = contentItem == null ? _repository.Table : _repository .Fetch(x => x.ContentItemVersionRecord.ContentItemRecord == contentItem.Record); foreach (var task in tasks) {