View Issue Details

IDProjectCategoryView StatusLast Update
0019638mantisbtfilterspublic2015-09-06 17:37
Reporteratrol Assigned Todregad  
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

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

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.


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




2015-04-19 08:32

developer   ~0050553

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



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];


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...



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



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.



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.



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 !



2015-04-20 19:22

developer   ~0050577

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



2015-04-21 02:29

developer   ~0050578

Looks good at first sight.

Related Changesets

MantisBT: master feb65adc

2015-04-20 18:51:07


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 19:10:38


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

Issue History

Date Modified Username Field Change
2015-04-19 08:26 atrol New Issue
2015-04-19 08:32 atrol Note Added: 0050553
2015-04-20 17:29 atrol Note Added: 0050571
2015-04-20 18:11 dregad Assigned To => dregad
2015-04-20 18:11 dregad Status new => assigned
2015-04-20 18:12 dregad Note Added: 0050572
2015-04-20 18:23 atrol Note Added: 0050573
2015-04-20 18:51 dregad Relationship added related to 0019574
2015-04-20 18:52 dregad Product Version 1.3.0-beta.2 => 1.3.0-beta.3
2015-04-20 18:53 dregad Note Added: 0050574
2015-04-20 18:56 dregad Note Added: 0050575
2015-04-20 19:07 dregad Note Added: 0050576
2015-04-20 19:14 dregad Changeset attached => MantisBT master feb65adc
2015-04-20 19:14 dregad Changeset attached => MantisBT master e2391f6f
2015-04-20 19:14 dregad Status assigned => resolved
2015-04-20 19:14 dregad Resolution open => fixed
2015-04-20 19:14 dregad Fixed in Version => 1.3.0-beta.3
2015-04-20 19:22 dregad Note Added: 0050577
2015-04-21 02:29 atrol Note Added: 0050578
2015-09-06 17:37 vboctoradmin Status resolved => closed