Skip to content

Commit

Permalink
Fix regression printing user lists for all projects
Browse files Browse the repository at this point in the history
This was introduced by commit c0976d0
(see issue #19574); the while loop used to build the associative array
to remove duplicate users from the list failed to take into
consideration that the array returned by project_get_all_user_rows() is
no longer 0-based...

Fixes #19638
  • Loading branch information
dregad committed Apr 20, 2015
1 parent aa70e11 commit e2391f6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions core/print_api.php
Expand Up @@ -283,12 +283,10 @@ function print_user_option_list( $p_user_id, $p_project_id = null, $p_access = A
$t_project_users_list = project_get_all_user_rows( $t_project_id, $p_access );
# Do a 'smart' merge of the project's user list, into an
# associative array (to remove duplicates)
# Use a while loop for better performance
$i = 0;
while( isset( $t_project_users_list[$i] ) ) {
$t_users[$t_project_users_list[$i]['id']] = $t_project_users_list[$i];
$i++;
foreach( $t_project_users_list as $t_id => $t_user ) {
$t_users[$t_id] = $t_user;
}
# Clear the array to release memory
unset( $t_project_users_list );
}
unset( $t_projects );
Expand Down

0 comments on commit e2391f6

Please sign in to comment.