Skip to content

Commit

Permalink
Issue 10905: Move BUGNOTE_ADD event to bugnote_add() function
Browse files Browse the repository at this point in the history
The BUGNOTE_ADD event is only sent when a bugnote is added from the view
page. Moving it from bugnote_add.php to the bugnote_add() function in
core/bugnote_api.php will ensure that it is sent from the edit page as
well.

Signed-off-by: David Hicks <hickseydr@optusnet.com.au>
  • Loading branch information
Chris Fitch authored and davidhicks committed Sep 4, 2009
1 parent 7f8b202 commit fa25297
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions bugnote_add.php
Expand Up @@ -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 );
3 changes: 3 additions & 0 deletions core/bugnote_api.php
Expand Up @@ -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 );
Expand Down

0 comments on commit fa25297

Please sign in to comment.