View Issue Details

IDProjectCategoryView StatusLast Update
0013265mantisbtchange logpublic2014-09-23 18:05
ReporterSL-Gundam Assigned Todregad  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
PlatformPHP 5.3.3 ntsOSWindows 7 x64OS Version6.1 (Build 7600)
Product Version1.2.7 
Target Version1.2.12Fixed in Version1.2.12 
Summary0013265: Issues counted more then one time if they have multiple relations
Description

Below the changes in a particular version are the number of issues fixed in that version, for example: "[78 issues]"

This works as it should as long as an issue does not have multiple relations. But if an issue has more then 1 relation then it will be counted by the number of relations it has.

I don't know if this was by design but i feel this is wrong as it confuses users who notice the differences in shown vs counted

Tagspatch
Attached Files
0001-Fix-for-13265-Changelog-Issues-counted-more-then-one.patch (1,070 bytes)   
From d5cb1b3349c8ddb11471002ef14efaa04a3888b9 Mon Sep 17 00:00:00 2001
From: SL-Gundam <slgundam@gmail.com>
Date: Thu, 25 Aug 2011 23:51:43 +0200
Subject: [PATCH] Fix for #13265 - Changelog - Issues counted more then one
 time if they have multiple relations

---
 changelog_page.php |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/changelog_page.php b/changelog_page.php
index c5cc348..4e11692 100644
--- a/changelog_page.php
+++ b/changelog_page.php
@@ -213,8 +213,6 @@ foreach( $t_project_ids as $t_project_id ) {
 				continue;
 			}
 
-			$t_issues_resolved++;
-
 			if ( 0 === strcasecmp( $t_parent_version, $t_version ) ) {
 				$t_issue_ids[] = $t_issue_id;
 				$t_issue_parents[] = $t_issue_parent;
@@ -228,6 +226,8 @@ foreach( $t_project_ids as $t_project_id ) {
 
 		user_cache_array_rows( array_unique( $t_issue_handlers ) );
 
+		$t_issues_resolved = count( $t_issue_ids );
+
 		if ( $t_issues_resolved > 0 ) {
 			if ( !$t_project_header_printed ) {
 				print_project_header_changelog( $t_project_name );
-- 
1.7.6.msysgit.0

Relationships

related to 0014788 closeddregad Change Log must consistently rely on fixed_in_version 
related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 
has duplicate 0013956 closedatrol Counting issues in changelog 

Activities

SL-Gundam

SL-Gundam

2011-08-25 17:57

reporter   ~0029561

I added a small patch which seems to fix this problem. I performed several tests on it and could find no further issues

But the if statement after the removed "$t_issues_resolved++;" does give me some doubts whether the patch will fix all problems concerning the counting of the issues

So please look it over and see what you think

SL-Gundam

SL-Gundam

2011-08-27 15:17

reporter   ~0029567

Patch is for the 1.2.x branch

grangeway

grangeway

2011-08-28 10:03

reporter   ~0029571

That patch looks like it's better logic to me. Commited to git.

SL-Gundam

SL-Gundam

2011-09-25 16:36

reporter   ~0029859

Fix not yet visible in git (checked both the master and 1.2.x branch)

dregad

dregad

2012-10-06 19:14

developer   ~0033061

SL-Gundam, I tested your patch but it does not resolve all cases.

For example, consider the following bugs

  • 0000010: [ca] duplicate test (Test Developer) - resolved.
    • 0000233: [General] tes 14549 (Administrator) - resolved.
    • 0000095: [General] pm test (Test Developer) - resolved.
  • 0000232: [ca] tes 14549 (Administrator) - resolved.
    • 0000233: [General] tes 14549 (Administrator) - resolved.

Changelog displays the count as [5 issues] with or without your patch.

I think the proper way to fix the problem is to count the unique number of bug_id's, which should be easy enough. I'll upload a fix shortly.

While testing I also noticed that the changelog relies on the parent issue's target_version to determine the hierarchy, which I think is not correct. I opened 0014788 to track this.

dregad

dregad

2012-10-06 19:51

developer   ~0033062

Fix committed

grangeway

grangeway

2013-04-05 17:56

reporter   ~0036213

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

Related Changesets

MantisBT: master 09fcedf0

2012-10-06 12:22

dregad


Details Diff
Fix 0013265: Issues count in Changelog

Prior to this, issues having multiple parents were counted more than
once, causing an incorrect count of issues to be reported (changelog
displayed the number of printed lines instead of the number of distinct
issues in the version)

This is an improvement over SL-Gundam's original patch, which did not
cover all cases.
Affected Issues
0013265
mod - changelog_page.php Diff File

MantisBT: master-1.2.x 2f47497a

2012-10-06 12:22

dregad


Details Diff
Fix 0013265: Issues count in Changelog

Prior to this, issues having multiple parents were counted more than
once, causing an incorrect count of issues to be reported (changelog
displayed the number of printed lines instead of the number of distinct
issues in the version)

This is an improvement over SL-Gundam's original patch, which did not
cover all cases.
Affected Issues
0013265
mod - changelog_page.php Diff File