View Issue Details

IDProjectCategoryView StatusLast Update
0006909mantisbtcustom fieldspublic2006-04-03 04:30
ReporterElmar Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Summary0006909: move helper function für custom functions so that custom fields can be manipulated correctly
Description

Hi.

There should be a minimal fix to the mantis codebase because the event handler for custom functions in bug_update.php is in the wrong place. It should move from

...

Handle auto-assigning

if ( ( NEW_ == $t_bug_data->status )
&& ( 0 != $t_bug_data->handler_id )
&& ( ON == config_get( 'auto_set_status_to_assigned' ) ) ) {
$t_bug_data->status = config_get( 'bug_assigned_status' );
}

helper_call_custom_function( 'issue_update_validate', array( $f_bug_id, $t_bug_data, $f_bugnote_text ) );

$t_resolved = config_get( 'bug_resolved_status_threshold' );

$t_custom_status_label = "update"; # default info to check
if ( $t_bug_data->status == $t_resolved ) {
$t_custom_status_label = "resolved";
...

to:

...
// update bug data with fields that may be updated inside bug_resolve(), otherwise changes will be overwritten
// in bug_update() call below.
$t_bug_data->status = bug_get_field( $f_bug_id, 'status' );
$t_bug_data->resolution = bug_get_field( $f_bug_id, 'resolution' );
break;
} # else fall through to default
}
}

helper_call_custom_function( 'issue_update_validate', array( $f_bug_id, $t_bug_data, $f_bugnote_text ) );

Add a bugnote if there is one

if ( ( !is_blank( $f_bugnote_text ) ) && ( false == $t_bug_note_set ) ) {
bugnote_add( $f_bug_id, $f_bugnote_text, $f_private );
}

Because the function is called before custom fields are parsed in the original version you will not be able to access the values in the custom_function file.

Best regards,
Elmar

TagsNo tags attached.

Activities

There are no notes attached to this issue.