Skip to content

Commit 3eb7538

Browse files
committed
Merge pull request #19 from nutso/develop
checking for nil due date on fixed schedule recurrence
2 parents 641cf9c + cc95016 commit 3eb7538

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/models/recurring_task.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def next_scheduled_recurrence
4848

4949
# whether a recurrence needs to be added
5050
def need_to_recur?
51-
if(fixed_schedule and (issue.due_date + recurrence_pattern) <= (Time.now.to_date + 1.day)) then true else issue.closed? end
51+
if(fixed_schedule and (previous_date_for_recurrence + recurrence_pattern) <= (Time.now.to_date + 1.day)) then true else issue.closed? end
5252
end
5353

5454
# check whether a recurrence is needed, and add one if not
@@ -94,6 +94,6 @@ def self.add_recurrences!
9494
# for a fixed schedule, this is the due date
9595
# for a relative schedule, this is the date closed
9696
def previous_date_for_recurrence
97-
if fixed_schedule then issue.due_date else issue.closed_on end
97+
if fixed_schedule and !issue.due_date.nil? then issue.due_date else issue.closed_on end
9898
end
9999
end

init.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
author_url 'https://github.com/nutso/'
1111
url 'https://github.com/nutso/redmine-plugin-recurring-tasks'
1212
description 'Allows you to set a task to recur on a regular schedule, or when marked complete, regenerate a new task due in the future. Plugin is based -- very loosely -- on the periodic tasks plugin published by Tanguy de Courson'
13-
version '1.2'
13+
version '1.2.5'
1414

1515
Redmine::MenuManager.map :top_menu do |menu|
1616
menu.push :recurring_tasks, { :controller => 'recurring_tasks', :action => 'index' }, :caption => 'Recurring Issues', :if => Proc.new { User.current.admin? } # TODO localize string

0 commit comments

Comments
 (0)