View Issue Details

IDProjectCategoryView StatusLast Update
0014356mantisbtreportspublic2014-09-23 18:05
Reporterlinde_gao Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.4 
Target Version1.2.12Fixed in Version1.2.12 
Summary0014356: the statistics result in summary is wrong
Description

For Project XXX ,when click “Advanced Summary ”->” By Severrity”-> per Major defect has about 280. But when click “ Summary”->” Per severity ”-> per Major defect has about 230, the statistics result in summary is wrong.

Additional Information

Environment:

  • Windows Server 2003
  • Appserv 2.5.9
  • mantis 1.2.4
TagsNo tags attached.
Attached Files

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

atrol

atrol

2012-06-07 17:27

developer   ~0032042

I am not able to reproduce the issue with latest stable version of MantisBT (1.2.10 at the moment)
Are you able to reproduce the issue with latest stable version?

linde_gao

linde_gao

2012-06-13 21:40

reporter   ~0032094

Thanks for your reply!
I try not the issue with latest stable version of MantisBT (1.2.10 at the moment).
but I looked up the source code of MantisBT (1.2.10),no different code of mantis 1.2.4 about graph. I have modified function enum_bug_group( $p_enum_string, $p_enum ) of mantis\plugins\MantisGraph\core\graph_api.php ,because our defect status has 80:Postponed,90:Inefficacy,I have added code
"$query = "SELECT COUNT(*)
FROM $t_bug_table
WHERE $p_enum='$t_value' AND
status>'$t_clo_val'$specific_where";
$result2 = db_query( $query );
$t_metrics['Other'][$t_label] = db_result( $result2, 0, 0 );".
Now Statistical data is right.

dregad

dregad

2012-06-14 05:15

developer   ~0032098

Thanks for reporting your solution.

I think your problem may be due to your custom status definition, linked with the related thresholds ($g_bug_resolved_status_threshold and $g_bug_closed_status_threshold), maybe you should check in your setup if everything is defined as it should.

MantisBT makes the assumption that $g_bug_closed_status_threshold is the "final" status, i.e. the last one in the status enum. The graph plugin code you highlighted works fine in such standard setup, but will indeed fail to count some issues in the case a status code higher than $g_bug_closed_status_threshold exists, so there is indeed an issue with the code.

That said, I believe your solution is incorrect as by definition there can be only 3 states for issues: open, resolved or closed. You are introducing a 4th state "Other" which does not really make sense in a global context (or is in any case not properly defined).

I suggest you try the following patch, and let us know if that fixes your problem

<pre>
diff --git a/plugins/MantisGraph/core/graph_api.php b/plugins/MantisGraph/core/graph_api.php
index 13bc10d..a1597a7 100644
--- a/plugins/MantisGraph/core/graph_api.php
+++ b/plugins/MantisGraph/core/graph_api.php
@@ -620,7 +620,7 @@ function enum_bug_group( $p_enum_string, $p_enum ) {
$query = "SELECT COUNT(*)
FROM $t_bug_table
WHERE $p_enum='$t_value' AND

  • status='$t_clo_val' $specific_where";
  • status>='$t_clo_val' $specific_where";
    $result2 = db_query( $query );
    $t_metrics['closed'][$t_label] = db_result( $result2, 0, 0 );
    </pre>
linde_gao

linde_gao

2012-06-14 21:11

reporter   ~0032105

Thank you very much for your explanation and Suggestions.
You are right! We defined state:
$g_status_enum_string = '10:Root Cause is unknown,30:Root Cause is known,40:Resolved ,50:Verified ,60:Validated ,70:Closed ,80:Postponed,90:Inefficacy';
$g_bug_closed_status_threshold in my custom status is not the "final" status.

I have used your patch and after test, data correct!
Now my problem is fixed! Thank you very much again!

dregad

dregad

2012-06-15 08:13

developer   ~0032108

Thanks atrol - used to be the source integration assigned automatically the fixed in version; apparently no longer the case with the last update jreese did.

grangeway

grangeway

2013-04-05 17:56

reporter   ~0036146

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

Related Changesets

MantisBT: master 7beac566

2012-06-14 20:47

dregad


Details Diff
MantisGraph: incorrect issues count in graph by severity

When $g_bug_closed_status_threshold is not the "final" entry in
status_enum_string list, function enum_bug_group() in graph_api.php
computed the number of closed issues incorrectly due to use of '='
operator instead of '>=' in the query's where clause.

Also corrects some trailing whitespace.

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

MantisBT: master-1.2.x b63e1815

2012-06-14 20:47

dregad


Details Diff
MantisGraph: incorrect issues count in graph by severity

When $g_bug_closed_status_threshold is not the "final" entry in
status_enum_string list, function enum_bug_group() in graph_api.php
computed the number of closed issues incorrectly due to use of '='
operator instead of '>=' in the query's where clause.

Also corrects some trailing whitespace.

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

MantisBT: master-2.0.x fbb5e95e

2013-04-06 03:29

Paul Richards


Details Diff
Port of 7beac566f25dc30ffb3224c2823fee77c9223a1b [dregad]:

MantisGraph: incorrect issues count in graph by severity
When $g_bug_closed_status_threshold is not the "final" entry in
status_enum_string list, function enum_bug_group() in graph_api.php
computed the number of closed issues incorrectly due to use of '='
operator instead of '>=' in the query's where clause.

Also corrects some trailing whitespace.

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