View Issue Details

IDProjectCategoryView StatusLast Update
0008734mantisbtfilterspublic2009-11-19 13:29
Reporterebenius Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version1.1.0 
Summary0008734: Advanced project filter "All Projects" does not match issues in sub projects
Description

If "All Projects" is selected in Advanced Filters / Projects, Mantis does not find all issues. The selection of "[current]" (having "All projects" selected on top of the page) works fine.

Steps To Reproduce

Environment:

You need 3 projects:

Project A (1 issue)
» Project A.a (1 issue)
» » Project A.a.1 (1 issue)

1) Select "All Projects" (upper right corner of the page), click "View Issues", reset the filters, select "Advanced Filters": Currently finds 3 Issues

2) Click on "Project" in the filter panel. Select (by multi selection) each project (means: all entries in the list, except "[current]" and "All Projects"), click on "Apply Filter": Currently finds 3 issue


3) Click on "Project" in the filter panel. Select "All Projects" only, click on "Apply Filter": Currently finds 1 issue

4) Click on "Project" in the filter panel. Repeat the selection from 2) plus "All Projects", click on "Apply Filter": Still finds 1 issue, only


5) Click on "Project" in the filter panel. Select (by multi selection) all sub projects (all levels) click on "Apply Filter": Finds 2 issues, which is the difference between results from 1) & 2) and 3) & 4)

TagsNo tags attached.
Attached Files
issue_8734.patch (931 bytes)   
From a217c342993c1d30d70fbe9e7e349e7acc7e6336 Mon Sep 17 00:00:00 2001
From: Chris Fitch <cfitch@redcom.com>
Date: Thu, 19 Nov 2009 13:19:30 -0500
Subject: [PATCH] Make all projects filter include subprojects


diff --git a/core/filter_api.php b/core/filter_api.php
index 771b079..36a2421 100644
--- a/core/filter_api.php
+++ b/core/filter_api.php
@@ -1107,7 +1107,7 @@ function filter_get_bug_rows( &$p_page_number, &$p_per_page, &$p_page_count, &$p
 			$t_project_ids = array_map( 'db_prepare_int', $t_filter[FILTER_PROPERTY_PROJECT_ID] );
 		}
 
-		$t_include_sub_projects = (( count( $t_project_ids ) == 1 ) && ( $t_project_ids[0] == META_FILTER_CURRENT ) );
+		$t_include_sub_projects = ( ( ( count( $t_project_ids ) == 1 ) && ( $t_project_ids[0] == META_FILTER_CURRENT ) ) || in_array( ALL_PROJECTS, $t_project_ids ) );
 	}
 
 	log_event( LOG_FILTERING, 'project_ids = @P' . implode( ', @P', $t_project_ids ) );
-- 
1.6.0.4

issue_8734.patch (931 bytes)   

Activities

cmfitch1

cmfitch1

2009-11-19 13:29

reporter   ~0023763

I have attached a fix for this issue. Subprojects were only included if [current] was selected as a project. The fix was to included them anytime "All Projects" was selected as well.