From df49964bf9e5e74049ee4683d539402cd89b8da8 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Mon, 9 Feb 2026 14:19:31 -0500 Subject: [PATCH] added tracker nil check --- config/locales/en.yml | 3 ++- lib/redmine_qbo/patches/issues_controller_patch.rb | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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