Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid an error if either the issue start_date or the due_date are nil. #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

meineerde
Copy link

This situation can happen on existing data which has a set due_date
but no start_date. The code would then error out with

TypeError: expected numeric or date in
[RUBY_ROOT]/lib/ruby/1.8/date.rb:1252:in minus_without_duration
[GEM_ROOT]/gems/activesupport-2.3.15/lib/active_support/core_ext/date/calculations.rb:88:in -
[PROJECT_ROOT]/vendor/plugins/redmine_better_gantt_chart/lib/redmine_better_gantt_chart/issue_dependency_patch.rb:154:in cache_change
[PROJECT_ROOT]/vendor/plugins/redmine_better_gantt_chart/lib/redmine_better_gantt_chart/issue_dependency_patch.rb:69:in reschedule_dependent_issue
[PROJECT_ROOT]/vendor/plugins/redmine_better_gantt_chart/lib/redmine_better_gantt_chart/issue_dependency_patch.rb:87:in process_child_issues
[GEM_ROOT]/gems/activerecord-2.3.15/lib/active_record/named_scope.rb:114:in each
[GEM_ROOT]/gems/activerecord-2.3.15/lib/active_record/named_scope.rb:114:in __send__
[GEM_ROOT]/gems/activerecord-2.3.15/lib/active_record/named_scope.rb:114:in each
[PROJECT_ROOT]/vendor/plugins/redmine_better_gantt_chart/lib/redmine_better_gantt_chart/issue_dependency_patch.rb:78:in process_child_issues
[PROJECT_ROOT]/vendor/plugins/redmine_better_gantt_chart/lib/redmine_better_gantt_chart/issue_dependency_patch.rb:70:in reschedule_dependent_issue
[PROJECT_ROOT]/vendor/plugins/redmine_better_gantt_chart/lib/redmine_better_gantt_chart/issue_dependency_patch.rb:24:in reschedule_following_issues
[PROJECT_ROOT]/vendor/plugins/redmine_better_gantt_chart/lib/redmine_better_gantt_chart/issue_dependency_patch.rb:33:in cache_and_apply_changes
[PROJECT_ROOT]/vendor/plugins/redmine_better_gantt_chart/lib/redmine_better_gantt_chart/issue_dependency_patch.rb:23:in reschedule_following_issues

This situation can happen on existing data which has a set due_date
but no start_date. The code would then error out with

TypeError: expected numeric or date in
[RUBY_ROOT]/lib/ruby/1.8/date.rb:1252:in minus_without_duration
[GEM_ROOT]/gems/activesupport-2.3.15/lib/active_support/core_ext/date/calculations.rb:88:in -
[PROJECT_ROOT]/vendor/plugins/redmine_better_gantt_chart/lib/redmine_better_gantt_chart/issue_dependency_patch.rb:154:in cache_change
[PROJECT_ROOT]/vendor/plugins/redmine_better_gantt_chart/lib/redmine_better_gantt_chart/issue_dependency_patch.rb:69:in reschedule_dependent_issue
[PROJECT_ROOT]/vendor/plugins/redmine_better_gantt_chart/lib/redmine_better_gantt_chart/issue_dependency_patch.rb:87:in process_child_issues
[GEM_ROOT]/gems/activerecord-2.3.15/lib/active_record/named_scope.rb:114:in each
[GEM_ROOT]/gems/activerecord-2.3.15/lib/active_record/named_scope.rb:114:in __send__
[GEM_ROOT]/gems/activerecord-2.3.15/lib/active_record/named_scope.rb:114:in each
[PROJECT_ROOT]/vendor/plugins/redmine_better_gantt_chart/lib/redmine_better_gantt_chart/issue_dependency_patch.rb:78:in process_child_issues
[PROJECT_ROOT]/vendor/plugins/redmine_better_gantt_chart/lib/redmine_better_gantt_chart/issue_dependency_patch.rb:70:in reschedule_dependent_issue
[PROJECT_ROOT]/vendor/plugins/redmine_better_gantt_chart/lib/redmine_better_gantt_chart/issue_dependency_patch.rb:24:in reschedule_following_issues
[PROJECT_ROOT]/vendor/plugins/redmine_better_gantt_chart/lib/redmine_better_gantt_chart/issue_dependency_patch.rb:33:in cache_and_apply_changes
[PROJECT_ROOT]/vendor/plugins/redmine_better_gantt_chart/lib/redmine_better_gantt_chart/issue_dependency_patch.rb:23:in reschedule_following_issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant