View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0014273 | mantisbt | code cleanup | public | 2012-05-18 13:07 | 2020-12-30 07:30 |
Reporter | dregad | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.10 | ||||
Target Version | 1.2.11 | Fixed in Version | 1.2.11 | ||
Summary | 0014273: Unnecessary use of array_reverse to display bug revisions | ||||
Description | In bug_revision_view_page.php, the array returned by functions bug_revision_list() and bug_revision_like() is sytematically reversed. Since these 2 functions are not used anywhere else, it is more efficient to modify the SQL to let the functions do the sorting right from the start, and avoid the calls to array_reverse(). Note that the ORDER BY clause has been changed from 'timestamp' to 'id', this guarantees correct display order in case the timestamps are equal. | ||||
Tags | No tags attached. | ||||
MantisBT: master ce6d92de 2012-05-18 07:19 Details Diff |
Remove unnecessary use of array_reverse() to display bug revisions Prior to this commit, in bug_revision_view_page.php the array returned by functions bug_revision_list() and bug_revision_like() was sytematically reversed by calling array_reverse(). Since these 2 functions are not used anywhere else, it is more efficient to modify the SQL so that the functions sort the list as it should be right from the start, thus avoiding the calls to array_reverse(). Note that the ORDER BY clause has been changed from 'timestamp' to 'id', this guarantees correct display order in case the timestamps are equal since by definition the id is a sequential number increased with each revision as it is recorded. Fixes 0014273 |
Affected Issues 0014273 |
|
mod - bug_revision_view_page.php | Diff File | ||
mod - core/bug_revision_api.php | Diff File | ||
MantisBT: master-1.2.x c08e6531 2012-05-18 07:19 Details Diff |
Remove unnecessary use of array_reverse() to display bug revisions Prior to this commit, in bug_revision_view_page.php the array returned by functions bug_revision_list() and bug_revision_like() was sytematically reversed by calling array_reverse(). Since these 2 functions are not used anywhere else, it is more efficient to modify the SQL so that the functions sort the list as it should be right from the start, thus avoiding the calls to array_reverse(). Note that the ORDER BY clause has been changed from 'timestamp' to 'id', this guarantees correct display order in case the timestamps are equal since by definition the id is a sequential number increased with each revision as it is recorded. Fixes 0014273 |
Affected Issues 0014273 |
|
mod - bug_revision_view_page.php | Diff File | ||
mod - core/bug_revision_api.php | Diff File | ||
MantisBT: master 1dbef621 2020-12-05 16:39 Details Diff |
Remove array_reverse to display bug revisions The same change was previously applied to bugnotes and revisions (see Issue 0014273, commit ce6d92de07fc370c5e69dce4794f8a60d180e6a2), but not to bugs. This causes the revisions to be listed in a different order when viewing a bugs by bug_id vs by rev_id, even though it is the same data. For consistency, the change needs to be applied everywhere. |
Affected Issues 0014273 |
|
mod - bug_revision_view_page.php | Diff File |