View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017073 | mantisbt | other | public | 2014-03-08 18:10 | 2014-12-05 18:33 |
Reporter | aavagyan | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.17 | ||||
Target Version | 1.2.18 | Fixed in Version | 1.2.18 | ||
Summary | 0017073: Incorrect $specific_where | ||||
Description | I run into problem while using $specific_where variable for my plugin. If user has access to only one project (or if there is only one project in bug tracker), $specific_where contains wrong value. It is used in number of places in Mantis - so this touches not only my plugin. $specific_where is helper_project_specific_where() [helper_api.php] ... Please look on this line: It assumes that the project is first element in array. Now lets look at user_get_all_accessible_projects(). In the case of "All projects", thee following code works: ... Create a combined array where key = value$t_project_ids = array_combine( $t_topprojects, $t_topprojects ); Then function returns $t_project_ids. Thus if "the only" project_id is, for example, 3 then key is also 3 and $t_project_ids[0] is naturally empty. As effect "} else if( 1 == count( $t_project_ids ) ) {" condition from above will work, but $t_project_filter will contain something like "project_id=" -> value is missing at the end. | ||||
Tags | No tags attached. | ||||
To emphasize on point from above. The problem is present only when passing $project_id = ALL_PROJECTS |
|
Hello, and thanks for the bug report. Can you kindly test with the following fix, I have no time to do it at the moment
|
|
Yes, it solves the problem, thanks! |
|
MantisBT: master-1.2.x 85e471e9 2014-03-11 08:24 Details Diff |
Incorrect project-specific where clause If user has access to only one project (or if there is only one project in bug tracker), helper_project_specific_where() function returned an incorrect where clause when $project_id == ALL_PROJECTS. Fixes 0017073 |
Affected Issues 0017073 |
|
mod - core/helper_api.php | Diff File | ||
MantisBT: master c0ad6521 2014-03-11 08:24 Details Diff |
Incorrect project-specific where clause If user has access to only one project (or if there is only one project in bug tracker), helper_project_specific_where() function returned an incorrect where clause when $project_id == ALL_PROJECTS. Fixes 0017073 |
Affected Issues 0017073 |
|
mod - core/helper_api.php | Diff File |