From 43c39d7581d7648b0d24c4cd0f684b4ac73fcf0e Mon Sep 17 00:00:00 2001 From: Victor Boctor Date: Tue, 21 Oct 2014 19:25:43 -0700 Subject: [PATCH] mc_issue_update() email missing latest notes The mc_issue_update() could result in updating or adding notes to the issue. Earlier in the method the issue and issue notes are loaded and cached. Then notes are updated. Then email API is called which loads the issue + notes again, but this time it hits stale cache. Fixes #17763 --- api/soap/mc_issue_api.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/soap/mc_issue_api.php b/api/soap/mc_issue_api.php index 08d32e0469..2aafafe308 100644 --- a/api/soap/mc_issue_api.php +++ b/api/soap/mc_issue_api.php @@ -978,6 +978,10 @@ function mc_issue_update( $p_username, $p_password, $p_issue_id, $p_issue ) { bugnote_add( $p_issue_id, $t_note['text'], mci_get_time_tracking_from_note( $p_issue_id, $t_note ), $t_view_state_id == VS_PRIVATE, $note_type, $note_attr, $t_user_id, FALSE ); } } + + # The issue has been cached earlier in the bug_get() call. Flush the cache since it is + # now stale. Otherwise, the email notification will be based on the cached data. + bugnote_clear_cache( $p_issue_id ); } if ( isset ( $p_issue['tags']) && is_array ( $p_issue['tags']) ) {