diff options
author | Go MAEDA <maeda@farend.jp> | 2024-11-03 07:11:07 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2024-11-03 07:11:07 +0000 |
commit | e5867ffc8d20cbfc075afa9f1151d2266fe9f95d (patch) | |
tree | aa0584c54977cf16c25a6ab26d912c859f0dc7a6 /app | |
parent | c54474eccc970b58ef3c40b620387e522a84b478 (diff) | |
download | redmine-e5867ffc8d20cbfc075afa9f1151d2266fe9f95d.tar.gz redmine-e5867ffc8d20cbfc075afa9f1151d2266fe9f95d.zip |
Improve tracker deletion error message to display projects containing issues under the tracker (#12521).
Patch by Go MAEDA (user:maeda).
git-svn-id: https://svn.redmine.org/redmine/trunk@23181 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/trackers_controller.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/trackers_controller.rb b/app/controllers/trackers_controller.rb index c1415bc2c..824ce93ef 100644 --- a/app/controllers/trackers_controller.rb +++ b/app/controllers/trackers_controller.rb @@ -89,7 +89,11 @@ class TrackersController < ApplicationController def destroy @tracker = Tracker.find(params[:id]) unless @tracker.issues.empty? - flash[:error] = l(:error_can_not_delete_tracker) + projects = Project.joins(:issues).where(issues: {tracker_id: @tracker.id}).sorted.distinct + links = projects.map do |p| + view_context.link_to(p, project_issues_path(p, set_filter: 1, tracker_id: @tracker.id)) + end.join(', ') + flash[:error] = l(:error_can_not_delete_tracker_html, projects: links.html_safe) else @tracker.destroy end |