Skip to content

Commit

Permalink
Fix printing user lists from filters
Browse files Browse the repository at this point in the history
Commit 1ddb400 introduced a regression,
preventing the users list from being printed on view_all_bug_page.php.

This is due to the fact that when called by filters, $p_user_id is
actually an array of id's, a case that was not documented and not
considered when developping the fix for issue #17574.

Fixes #19638
  • Loading branch information
dregad committed Apr 20, 2015
1 parent 7aaabd3 commit feb65ad
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions core/print_api.php
Expand Up @@ -262,9 +262,9 @@ function print_captcha_input( $p_field_name ) {
/**
* This populates an option list with the appropriate users by access level
* @todo from print_reporter_option_list
* @param integer $p_user_id A user identifier.
* @param integer $p_project_id A project identifier.
* @param integer $p_access An access level.
* @param integer|array $p_user_id A user identifier or a list of them.
* @param integer $p_project_id A project identifier.
* @param integer $p_access An access level.
* @return void
*/
function print_user_option_list( $p_user_id, $p_project_id = null, $p_access = ANYBODY ) {
Expand Down Expand Up @@ -296,8 +296,13 @@ function print_user_option_list( $p_user_id, $p_project_id = null, $p_access = A
$t_users = project_get_all_user_rows( $p_project_id, $p_access );
}

# Ensure the specified user exists in the array
if( $p_user_id != NO_USER && !array_key_exists( $p_user_id, $t_users ) ) {
# Add the specified user ID to the list
# If we have an array of user IDs, then we've been called from a filter
# so don't add anything
if( !is_array( $p_user_id ) &&
$p_user_id != NO_USER &&
!array_key_exists( $p_user_id, $t_users )
) {
$t_users[$p_user_id] = user_get_row( $p_user_id );
}

Expand Down

0 comments on commit feb65ad

Please sign in to comment.