From: <gi...@ma...> - 2009-12-16 09:29:23
|
The branch, master has been updated via 77a0fb65a2076d985d4b1d3a1384376c411d81b9 (commit) from f92e62ecfd9a6cb25a527eb1418fdf4c6553ae43 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 77a0fb65a2076d985d4b1d3a1384376c411d81b9 Author: Victor Boctor <vb...@gm...> Date: Wed Dec 16 01:29:05 2009 -0800 Fixes #11046: notification emails send to an unassigned user. ----------------------------------------------------------------------- Summary of changes: core/user_pref_api.php | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) ----------------------------------------------------------------------- commit 77a0fb65a2076d985d4b1d3a1384376c411d81b9 Author: Victor Boctor <vb...@gm...> Date: Wed Dec 16 01:29:05 2009 -0800 Fixes #11046: notification emails send to an unassigned user. diff --git a/core/user_pref_api.php b/core/user_pref_api.php index 4c90825..aaa070e 100644 --- a/core/user_pref_api.php +++ b/core/user_pref_api.php @@ -200,13 +200,15 @@ function user_pref_cache_array_rows( $p_user_id_array, $p_project_id = ALL_PROJE global $g_cache_user_pref; $c_user_id_array = array(); + # identify the user ids that are not cached already. foreach( $p_user_id_array as $t_user_id ) { if( !isset( $g_cache_user_pref[(int) $t_user_id][(int)$p_project_id] ) ) { $c_user_id_array[(int)$t_user_id] = (int)$t_user_id; } } - if( empty( $c_user_id_array ) ) { + # if all users are already cached, then return + if ( empty( $c_user_id_array ) ) { return; } @@ -219,17 +221,20 @@ function user_pref_cache_array_rows( $p_user_id_array, $p_project_id = ALL_PROJE $result = db_query_bound( $query, Array( (int)$p_project_id ) ); while( $row = db_fetch_array( $result ) ) { - if( !isset( $g_cache_user_pref[(int) $row['id']] ) ) { - $g_cache_user_pref[(int) $row['id']] = array(); + if ( !isset( $g_cache_user_pref[(int) $row['user_id']] ) ) { + $g_cache_user_pref[(int) $row['user_id']] = array(); } - $g_cache_user_pref[(int) $row['id']][(int)$p_project_id] = $row; - unset( $c_user_id_array[(int) $row['id']] ); + + $g_cache_user_pref[(int) $row['user_id']][(int)$p_project_id] = $row; + + # remove found users from required set. + unset( $c_user_id_array[(int) $row['user_id']] ); } + # cache users that are not found as false (i.e. negative cache) foreach( $c_user_id_array as $t_user_id ) { $g_cache_user_pref[(int) $t_user_id][(int)$p_project_id] = false; } - return; } /** ----------------------------------------------------------------------- -- Mantis Bug Tracker |