View Issue Details

IDProjectCategoryView StatusLast Update
0012293mantisbtreportspublic2014-09-23 18:05
Reporteristvanb Assigned Torombert  
PrioritylowSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.2 
Target Version1.2.11Fixed in Version1.2.11 
Summary0012293: Not all the categories are displayed
Description

I have some categories applicable for all the projects (bug, documentation etc) and some custom made (Request credentials, request user etc).

When I go to the summary/categories graph, the global categories are not displayed, which is very inconvenient since most of the bug reports use them. (obviously the Advanced summary page has the same issue)

I have tested it with jpgraph and the bundled graph version as well (I assume the query in the background is the same so), I see no differences.

TagsNo tags attached.

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 
has duplicate 0011437 closedatrol graphs by category show "Not enough data to create graph" when using only global categories. 

Activities

istvanb

istvanb

2010-08-25 05:38

reporter   ~0026465

Last edited: 2010-08-25 07:43

Ok, after a small research I have found this:

in the graph_api.php line 756 (under the create_category_summary() funtion) the query does not contain project ID 0 which is the ALL PROJECT. Because of this the global categories are not displayed since they belongs to the ALL PROJECT and just inherited by the rest of the project.

I have modified the the query:

$query = "SELECT id, name
    FROM $t_cat_table
    WHERE $specific_where OR project_id=0
    ORDER BY name";
$result = db_query_bound( $query );
$category_count = db_num_rows( $result );

and the display part as well:
if ( isset($t_metrics[$t_cat_name]) ) {
$t_metrics[$t_cat_name] = $t_metrics[$t_cat_name] + db_result( $result2, 0, 0 );
} else {
if (db_result( $result2, 0, 0 ) > 0)
$t_metrics[$t_cat_name] = db_result( $result2, 0, 0 );

I assume adding the "OR project_id = 0" is not a very elegant solution, however it works. Because this function is only called from the graph plugin it wont break anything else and now it displays the graph properly.

The display part modification will hide all the unused categories, but all the categories are visible which used by at least one issue.

Probably somebody with more experience should also take a look at the problem so create a more robust solution.

VeMag

VeMag

2012-04-30 06:14

reporter   ~0031731

I've made a pull request for this :
https://github.com/mantisbt/mantisbt/pull/47

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036267

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master 0ea8cc50

2012-04-30 10:30

VeMag


Details Diff
Small changes to include global categories in graph
and to hide empty values

Fixes 0012293
Affected Issues
0012293
mod - plugins/MantisGraph/core/graph_api.php Diff File

MantisBT: master-1.2.x c4ad6d83

2012-04-30 10:30

VeMag


Details Diff
Small changes to include global categories in graph
and to hide empty values

Fixes 0012293
Affected Issues
0012293
mod - plugins/MantisGraph/core/graph_api.php Diff File