View Issue Details

IDProjectCategoryView StatusLast Update
0019638mantisbtfilterspublic2015-09-06 17:37
Reporteratrol Assigned Todregad  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version1.3.0-beta.3 
Target Version1.3.0-beta.3Fixed in Version1.3.0-beta.3 
Summary0019638: Filtering by users throws error
Description

Filtering by "Reporter", "Monitored By" or "Assigned To" does no longer work but throws error

APPLICATION ERROR 0000401
Database query failed. Error received from database was #1054: Unknown column 'Array' in 'where clause' for the query: SELECT * FROM mantis_user_table WHERE id=?.

TagsNo tags attached.

Relationships

related to 0019574 closeddregad Edited Issue's handler is set to blank when user has been demoted 

Activities

atrol

atrol

2015-04-19 08:32

developer   ~0050553

No time for a deeper look at the moment. Might be a side effect from 0019574.

atrol

atrol

2015-04-20 17:29

developer   ~0050571

Reminder sent to: dregad

You missed at least to change this part of function print_user_option_list

        $i = 0;
        while( isset( $t_project_users_list[$i] ) ) {
            $t_users[$t_project_users_list[$i]['id']] = $t_project_users_list[$i];
            $i++;
        }
dregad

dregad

2015-04-20 18:12

developer   ~0050572

Oops. Bad testing.

That being said, I never thought about this case, because the function's documentation doesn't mention that $p_user_id can actually be an array of IDs...

atrol

atrol

2015-04-20 18:23

developer   ~0050573

doesn't mention that $p_user_id can actually be an array of IDs.

??
I thought that the problem is caused by your changes of the return value of function project_get_all_user_rows

  • return array_values( $t_users );
  • return $t_users;

After this change you can no longer index the array by integer i starting from 0

dregad

dregad

2015-04-20 18:53

developer   ~0050574

No, git bisect indicates that the problem is caused by commit 1ddb4008, which is the logic adding the user to the list.

When called from bug edit page, we have a single user id (integer), but filters send an array of user id's, so user_get_row chokes.

dregad

dregad

2015-04-20 18:56

developer   ~0050575

Which doesn't necessarily mean that there isn't also a problem with the loop as well, I'll test that.

dregad

dregad

2015-04-20 19:07

developer   ~0050576

Yep, it's an issue as well, but only when printing a user list for All Projects - the selection list turns out blank, unless there happen to be users with IDs matching the $i sequence number (which was actually the case in my dev box, so I didn't notice the problem). Good catch !

dregad

dregad

2015-04-20 19:22

developer   ~0050577

Just updated the tracker, seems to work properly now. Let me know if you find other issues.

atrol

atrol

2015-04-21 02:29

developer   ~0050578

Looks good at first sight.

Related Changesets

MantisBT: master feb65adc

2015-04-20 14:51

dregad


Details Diff
Fix printing user lists from filters

Commit 1ddb400815dd847adbb302f1dda9b1fe3fdc5945 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 0017574.

Fixes 0019638
Affected Issues
0017574, 0019638
mod - core/print_api.php Diff File

MantisBT: master e2391f6f

2015-04-20 15:10

dregad


Details Diff
Fix regression printing user lists for all projects

This was introduced by commit c0976d063973a97b1ba4a5c3b017d3b3ddab59bc
(see issue 0019574); 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 0019638
Affected Issues
0019574, 0019638
mod - core/print_api.php Diff File