You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I dont know why, but it seem that the recurring task is created as anon, not as author of the original task so it cannot be recurred further. I change the order of your code to set User.current at the beginning before making new_issue and everything seems OK
In rare case, if the issue has empty start date the calculation of time span yield error. I change is to take create date of the issue as start date on that case. Here are the modification I did
# calculate the original number of days between start and due date
ddate = issue.due_date.blank? ? Time.now.to_date : issue.due_date
sdate = issue.start_date.blank? ? issue.created_on.to_date : issue.start_date
timespan = ddate - sdate #issue.due_date - issue.start_date
while need_to_recur?
usr_id = Setting.plugin_recurring_tasks['journal_attributed_to_user'].blank? ?
issue.author_id : Setting.plugin_recurring_tasks['journal_attributed_to_user'].to_i
defined_user = User.find(usr_id)
old_current_user = User.current
User.current = defined_user
new_issue = issue # default to existing issue
if Setting.plugin_recurring_tasks['reopen_issue'] != "1"
# duplicate issue
new_issue = issue.copy
end
if !Setting.plugin_recurring_tasks['journal_attributed_to_user'].blank?
issue.init_journal(defined_user, "#{l(:recurring_task_created)} => #{new_issue.id}: #{new_issue.subj_date}")
end
new_issue.due_date = next_scheduled_recurrence #41 previous_date_for_recurrence + recurrence_pattern
new_issue.start_date = new_issue.due_date - timespan
...
The text was updated successfully, but these errors were encountered:
The beauty of git is the ability to see exactly what changed in a pull request :-). The description was helpful, but I had to go line-by-line and try to compare... It was easier to reimplement than to try to find exactly what changed.
1 -- confirmed and resolved
2 -- also reported in #90, I fixed it a slightly different way - keeping the existing definition of the next recurrence date, just defaulting to a timespan of 0 if an error occurs during the date calculation.
Hi @nutso, please check the following points
...
The text was updated successfully, but these errors were encountered: