diff --git a/bugnote_add.php b/bugnote_add.php index d579232b33..ba8be0eb88 100644 --- a/bugnote_add.php +++ b/bugnote_add.php @@ -59,9 +59,6 @@ trigger_error( ERROR_EMPTY_FIELD, ERROR ); } - # Event integration - event_signal( 'EVENT_BUGNOTE_ADD', array( $f_bug_id, $t_bugnote_id ) ); - form_security_purge( 'bugnote_add' ); print_successful_redirect_to_bug( $f_bug_id ); diff --git a/core/bugnote_api.php b/core/bugnote_api.php index 3f0f0c9607..ebc70b47b3 100644 --- a/core/bugnote_api.php +++ b/core/bugnote_api.php @@ -183,6 +183,9 @@ function bugnote_add( $p_bug_id, $p_bugnote_text, $p_time_tracking = '0:00', $p_ # log new bug history_log_event_special( $p_bug_id, BUGNOTE_ADDED, bugnote_format_id( $t_bugnote_id ) ); + # Event integration + event_signal( 'EVENT_BUGNOTE_ADD', array( $p_bug_id, $t_bugnote_id ) ); + # only send email if the text is not blank, otherwise, it is just recording of time without a comment. if( TRUE == $p_send_email && !is_blank( $p_bugnote_text ) ) { email_bugnote_add( $p_bug_id );