Defect #10084

Disabled trackers of subprojects are listed in project overview

Added by Clemens John about 9 years ago. Updated 3 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Issues
Target version:4.2.0
Resolution:Fixed Affected version:1.2.3

Description

Trackers that are disabled in the main project but enabled in a subproject are shown in the project overview of the main project. I think this is a small issue because you can not create a ticket in one of this trackers in the main project so the containig tickets always are (0/0).

A similar ticket was already fixed some years ago: http://www.redmine.org/issues/2550

You can comprehend this issue here: https://ticket.piraten-nds.de/projects/oldenburg
Only Posteingang, Ideen und Hinweise, Aufgaben and Sonstiges are trackers that are enabled in the main project. All other trackers are disabled in the main project but enabled in one of the sub projects. They should not be shown in the overview of the main project.

Regards
Floh1111

fixed-10084.patch Magnifier (2.25 KB) Yuichi HARADA, 2020-10-29 05:57

10084-v2.patch Magnifier (2.24 KB) Go MAEDA, 2020-12-08 02:58


Related issues

Copied to Redmine - Defect #34185: Trackers of subprojects are not displayed in the Issue su... Closed

Associated revisions

Revision 20635
Added by Go MAEDA 3 months ago

Fix that disabled trackers of subprojects are listed in project overview (#10084).

Patch by Yuichi HARADA.

History

#1 Updated by Go MAEDA about 1 year ago

I think trackers that are not enabled in subprojects should not be displayed in Issue tracking box if "Display subprojects issues on main projects by default" setting is disabled.

However, trackers disabled in the current project but enabled in subprojects should also be displayed in Issue tracking box if the setting is enabled. The reason is that issues with such trackers are displayed in the issues list.

#2 Updated by Go MAEDA 8 months ago

Go MAEDA wrote:

I think trackers that are not enabled in subprojects should not be displayed in Issue tracking box if "Display subprojects issues on main projects by default" setting is disabled.

The summary page (projects/:id/issues/report/tracker) already behave like above. The issue tracking box in the overview page should behave as the same for consistency.

#3 Updated by Go MAEDA 8 months ago

  • Category changed from Accounts / authentication to Projects

#4 Updated by Yuichi HARADA 4 months ago

I have created a patch what trackers are not enabled in the parent project should not be shown in the Issue tracking box if "Display subprojects issues on main projects by default" setting is disabled.

diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 45fbe76aa..4fa48b86b 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -172,9 +172,10 @@ class ProjectsController < ApplicationController
     @principals_by_role = @project.principals_by_role
     @subprojects = @project.children.visible.to_a
     @news = @project.news.limit(5).includes(:author, :project).reorder("#{News.table_name}.created_on DESC").to_a
-    @trackers = @project.rolled_up_trackers.visible
+    with_subprojects = Setting.display_subprojects_issues?
+    @trackers = @project.rolled_up_trackers(with_subprojects).visible

-    cond = @project.project_condition(Setting.display_subprojects_issues?)
+    cond = @project.project_condition(with_subprojects)

     @open_issues_by_tracker = Issue.visible.open.where(cond).group(:tracker).count
     @total_issues_by_tracker = Issue.visible.where(cond).group(:tracker).count

#5 Updated by Yuichi HARADA 4 months ago

  • Copied to Defect #34185: Trackers of subprojects are not displayed in the Issue summary page added

#6 Updated by Go MAEDA 4 months ago

  • Target version set to Candidate for next major release

#7 Updated by Go MAEDA 3 months ago

  • Target version changed from Candidate for next major release to 4.2.0

The patch fixes an issue that trackers that are enabled only in subprojects are displayed in the issue tracking box in the "Overview" page even when Setting.display_subprojects_issues?

I slightly changed the patch:

  • Changed the test name
  • Fix RuboCop's Rails/DynamicFindBy warning

Setting the target version to 4.2.0.

#8 Updated by Go MAEDA 3 months ago

Go MAEDA wrote:

I slightly changed the patch:

  • Changed the test name
  • Fix RuboCop's Rails/DynamicFindBy warning

I forgot to attach the patch.

#9 Updated by Go MAEDA 3 months ago

  • Category changed from Projects to Issues
  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the fix. Thank you.

Also available in: Atom PDF