diff --git a/config/locales/en.yml b/config/locales/en.yml index c6cebfd..e42e1d1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -100,4 +100,5 @@ en: notice_forbidden: "You do not have permission to access this resource" notice_issue_not_found: "Issue not found" customer_details: "Customer Details" - notice_error_project_nil: "The issue's project is nil, set project to: " \ No newline at end of file + notice_error_project_nil: "The issue's project is nil, set project to: " + notice_error_tracker_nil: "The issue's tracker is nil, set tracker to: " \ No newline at end of file diff --git a/lib/redmine_qbo/patches/issues_controller_patch.rb b/lib/redmine_qbo/patches/issues_controller_patch.rb index 7b9b79d..205b485 100644 --- a/lib/redmine_qbo/patches/issues_controller_patch.rb +++ b/lib/redmine_qbo/patches/issues_controller_patch.rb @@ -24,6 +24,11 @@ module RedmineQbo context[:controller].flash[:error] = I18n.t(:notice_error_project_nil) + context[:issue].project.to_s end + if context[:issue].tracker.nil? + context[:issue].tracker = trackers_for_select(context[:issue]).first + context[:controller].flash[:error] = I18n.t(:notice_error_tracker_nil) + context[:issue].tracker.to_s + end + return context end