Skip to content

Commit

Permalink
Correct resolution comparison when changing issue status
Browse files Browse the repository at this point in the history
Fixes #22468
  • Loading branch information
atrol committed Mar 20, 2017
1 parent f615a31 commit d4c9d7f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bug_change_status_page.php
Expand Up @@ -83,6 +83,7 @@
$t_reopen = config_get( 'bug_reopen_status', null, null, $t_bug->project_id );
$t_resolved = config_get( 'bug_resolved_status_threshold', null, null, $t_bug->project_id );
$t_closed = config_get( 'bug_closed_status_threshold', null, null, $t_bug->project_id );
$t_resolution_fixed = config_get( 'bug_resolution_fixed_threshold', null, null, $t_bug->project_id );
$t_current_user_id = auth_get_current_user_id();

# Ensure user has proper access level before proceeding
Expand Down Expand Up @@ -158,9 +159,9 @@

<?php
$t_current_resolution = $t_bug->resolution;
$t_bug_is_open = $t_current_resolution < $t_resolved;
$t_bug_resolution_is_fixed = $t_current_resolution >= $t_resolution_fixed;

if( $f_new_status >= $t_resolved && ( $f_new_status < $t_closed || $t_bug_is_open ) ) {
if( $f_new_status >= $t_resolved && ( $f_new_status < $t_closed || !$t_bug_resolution_is_fixed ) ) {
?>
<!-- Resolution -->
<div class="field-container">
Expand All @@ -170,7 +171,7 @@
<span class="select">
<select name="resolution">
<?php
$t_resolution = $t_bug_is_open ? config_get( 'bug_resolution_fixed_threshold' ) : $t_current_resolution;
$t_resolution = $t_bug_resolution_is_fixed ? $t_current_resolution : $t_resolution_fixed;

$t_relationships = relationship_get_all_src( $f_bug_id );
foreach( $t_relationships as $t_relationship ) {
Expand Down

0 comments on commit d4c9d7f

Please sign in to comment.