View Issue Details

IDProjectCategoryView StatusLast Update
0010878mantisbtapi soappublic2010-02-22 14:34
Reporterkeeskuip Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.1.8 
Target Version1.2.0Fixed in Version1.2.0 
Summary0010878: bugnotes should be updated when mc_issue_update
Description

Bugnotes are always recreated when the soap method "mc_issue_update" is called.
There is a TODO in the code that says:

// TODO: consider supporting updating of bugnotes and detecting the ones that haven't changed.

I implemented this TODO. Please consider incorporating this in the base.

I changed the 2 lines:
$t_view_state_id = mci_get_enum_id_from_objectref( 'view_state', $t_view_state );
bugnote_add( $p_issue_id, $t_note['text'], '0:00', $t_view_state_id == VS_PRIVATE, BUGNOTE, '', $t_user_id, FALSE );

into:

            # update the note if it has an id
             $t_bugnote_updated = false;
             if ( isset( $t_note['id'] ) ) {
                 $t_bugnote_id = $t_note['id'];

                 # Don't allow an update if the note doesn't belong to this bug!
                 if( bugnote_exists( $t_bugnote_id ) && bugnote_get_field( $t_bugnote_id, 'bug_id' ) == $p_issue_id ) {

                     # Update the note:
                     bugnote_set_text( $t_bugnote_id, $t_note['text'] );
                     bugnote_date_update( $t_bugnote_id );
                     bugnote_set_view_state( $t_bugnote_id, $t_view_state_id == VS_PRIVATE );

                     $t_bugnote_updated = true;
                 }
             } 

             if ( $t_bugnote_updated === false ) {

                 $t_view_state_id = mci_get_enum_id_from_objectref( 'view_state', $t_view_state );
                 bugnote_add( $p_issue_id, $t_note['text'], '0:00', $t_view_state_id == VS_PRIVATE, BUGNOTE, '', $t_user_id, FALSE );
             }
Tagspatch

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master 649fc1a9

2009-10-09 20:47

vboctor


Details Diff
Fix 0010878: bugnotes should be updated when mc_issue_update. Affected Issues
0010878
mod - api/soap/mc_issue_api.php Diff File

MantisBT: master-1.2.x 99d8bd07

2009-10-09 20:47

vboctor


Details Diff
Fix 0010878: bugnotes should be updated when mc_issue_update. Affected Issues
0010878
mod - api/soap/mc_issue_api.php Diff File