Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9f302620f17f
Choose a base ref
...
head repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6ad38733d7ad
Choose a head ref
  • 3 commits
  • 1 file changed
  • 1 contributor

Commits on Oct 6, 2012

  1. Fix #13265: 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.
    dregad committed Oct 6, 2012

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    stepankuzmin Stepan Kuzmin
    Copy the full SHA
    09fcedf View commit details
  2. Optimize and reformat code in changelog_page.php

    - Remove unnecessary variable initializations
    - Reformat SQL statement for better readability
    - Simplify code displaying issue count
    dregad committed Oct 6, 2012

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    stepankuzmin Stepan Kuzmin
    Copy the full SHA
    13aa29f View commit details
  3. Change Log must consistently rely on fixed_in_version

    Change Log used target_version instead of fixed_in_version to manage
    issues' parent/child relationships. This caused unexpected behavior when
    target version did not match fixed in version.
    
    The SQL which retrieves the changelog issues now relies on
    fixed_in_version.
    
    Fixes #14788
    dregad committed Oct 6, 2012

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    stepankuzmin Stepan Kuzmin
    Copy the full SHA
    6ad3873 View commit details
Showing with 14 additions and 17 deletions.
  1. +14 −17 changelog_page.php
31 changes: 14 additions & 17 deletions changelog_page.php
Original file line number Diff line number Diff line change
@@ -200,24 +200,24 @@ function print_project_header_changelog ( $p_project_name ) {
$t_project_header_printed = false;

foreach( $t_version_rows as $t_version_row ) {
$t_issues_planned = 0;
$t_issues_resolved = 0;

$t_version_header_printed = false;

$t_version = $t_version_row['version'];

$t_version_id = $t_version_row['id'];

# Skip all versions except the specified one (if any).
if ( $f_version_id != -1 && $f_version_id != $t_version_id ) {
continue;
}

$query = "SELECT sbt.*, dbt.target_version AS parent_version, $t_relation_table.source_bug_id FROM $t_bug_table sbt
LEFT JOIN $t_relation_table ON sbt.id=$t_relation_table.destination_bug_id AND $t_relation_table.relationship_type=2
LEFT JOIN $t_bug_table dbt ON dbt.id=$t_relation_table.source_bug_id
WHERE sbt.project_id=" . db_param() . " AND sbt.fixed_in_version=" . db_param() . " ORDER BY sbt.status ASC, sbt.last_updated DESC";
$query = "SELECT sbt.*, dbt.fixed_in_version AS parent_version, rt.source_bug_id
FROM $t_bug_table AS sbt
LEFT JOIN $t_relation_table AS rt
ON sbt.id=rt.destination_bug_id AND rt.relationship_type=" . BUG_DEPENDANT . "
LEFT JOIN $t_bug_table AS dbt ON dbt.id=rt.source_bug_id
WHERE sbt.project_id=" . db_param() . "
AND sbt.fixed_in_version=" . db_param() . "
ORDER BY sbt.status ASC, sbt.last_updated DESC";

$t_description = version_get_field( $t_version_id, 'description' );

@@ -251,8 +251,6 @@ function print_project_header_changelog ( $p_project_name ) {
continue;
}

$t_issues_resolved++;

if ( 0 === strcasecmp( $t_parent_version, $t_version ) ) {
$t_issue_ids[] = $t_issue_id;
$t_issue_parents[] = $t_issue_parent;
@@ -266,6 +264,8 @@ function print_project_header_changelog ( $p_project_name ) {

user_cache_array_rows( array_unique( $t_issue_handlers ) );

$t_issues_resolved = count( array_unique( $t_issue_ids ) );

if ( $t_issues_resolved > 0 ) {
if ( !$t_project_header_printed ) {
print_project_header_changelog( $t_project_name );
@@ -280,6 +280,8 @@ function print_project_header_changelog ( $p_project_name ) {
if ( !is_blank( $t_description ) ) {
echo string_display( "<br />$t_description<br /><br />" );
}
} else {
continue;
}

$t_issue_set_ids = array();
@@ -335,13 +337,8 @@ function print_project_header_changelog ( $p_project_name ) {
helper_call_custom_function( 'changelog_print_issue', array( $t_issue_set_id, $t_issue_set_level ) );
}

if ( $t_issues_resolved == 1 ) {
echo "[{$t_issues_resolved} " . lang_get( 'bug' ) . ']';
echo "<br />";
} else if ( $t_issues_resolved > 1 ) {
echo "[{$t_issues_resolved} " . lang_get( 'bugs' ) . ']';
echo "<br />";
}
$t_bug_string = $t_issues_resolved == 1 ? 'bug' : 'bugs';
echo "<br />[$t_issues_resolved " . lang_get( $t_bug_string ) . ']<br />';

}
if ( $t_project_header_printed ) {