View Issue Details

IDProjectCategoryView StatusLast Update
0014273mantisbtcode cleanuppublic2020-12-30 07:30
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.10 
Target Version1.2.11Fixed in Version1.2.11 
Summary0014273: 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.

TagsNo tags attached.

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036258

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master ce6d92de

2012-05-18 07:19

dregad


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

dregad


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

dregad


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