View Revisions: Issue #24882

Summary 0024882: relationship_can_resolve_bug function problem
Revision 2018-10-23 13:55 by atrol
Description

In the present implementation, it is assumed that the parent and the child issue are in the same project.
In case this is not the case, the implementation has to be updated in order to retrieve the threshold value of the destination(see proposed implementation below). What do you think ?

for( $i = 0;$i < $t_relationship_count;$i++ ) {
        # verify if each bug in relation BUG_DEPENDANT is already marked as resolved
        if( $t_relationship[$i]->type == BUG_DEPENDANT ) {
            $t_dest_bug_id = $t_relationship[$i]->dest_bug_id;
            $t_status = bug_get_field( $t_dest_bug_id, 'status' );

            #  begin- Get the Project Id of the current child issue (set as destination)
                        $t_dest_bug_project_id = $t_relationship[$i]->dest_project_id;
            #  end- Get the Project Id of the current child issue (set as destination)

            #  begin - Check the bug_resolved_status_threshold of the child issue project (set as destination)
            #if( $t_status < config_get( 'bug_resolved_status_threshold' ) ) {
            if( $t_status < config_get( 'bug_resolved_status_threshold',null, null, $t_dest_bug_project_id) ) {  
            #  end - Check the bug_resolved_status_threshold of the child issue project (set as destination)
                # the bug is NOT marked as resolved/closed

                return false;
            }

        }
    }
Revision 2018-10-23 08:55 by mantisiator
Description

In the present implementation, it is assumed that the parent and the child issue are in the same project.
In case this is not the case, the implementation has to be updated in order to retrieve the threshold value of the destination(see proposed implementation below). What do you think ?

[...]
for( $i = 0;$i < $t_relationship_count;$i++ ) {

verify if each bug in relation BUG_DEPENDANT is already marked as resolved

    if( $t_relationship[$i]->type == BUG_DEPENDANT ) {
        $t_dest_bug_id = $t_relationship[$i]->dest_bug_id;
        $t_status = bug_get_field( $t_dest_bug_id, 'status' );

        #  begin- Get the Project Id of the current child issue (set as destination)
                    $t_dest_bug_project_id = $t_relationship[$i]->dest_project_id;
        #  end- Get the Project Id of the current child issue (set as destination)

        #  begin - Check the bug_resolved_status_threshold of the child issue project (set as destination)
        #if( $t_status &lt; config_get( 'bug_resolved_status_threshold' ) ) {
        if( $t_status &lt; config_get( 'bug_resolved_status_threshold',null, null, $t_dest_bug_project_id) ) {  
        #  end - Check the bug_resolved_status_threshold of the child issue project (set as destination)
            # the bug is NOT marked as resolved/closed

            return false;
        }

    }
}

[..]