Skip to content

Commit

Permalink
Fix order of activities with same timestamp
Browse files Browse the repository at this point in the history
When activities of the same type have the same timestamp, for example
when created from cloning issues, use the element id for sorting.

Fixes: #22441
  • Loading branch information
cproensa authored and vboctor committed Oct 23, 2017
1 parent b1c3160 commit 23db63f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/bug_activity_api.php
Expand Up @@ -187,6 +187,11 @@ function bug_activity_sort( &$p_entries ) {
return $t_order == 'DESC' ? -1 : 1;
}

# same timestamp and same type, probably came from cloning an issue
if( $a['timestamp'] == $b['timestamp'] && $a['type'] == $b['type'] ) {
return (int)$a['id'] - (int)$b['id'];
}

if( $a['user_id'] < $b['user_id'] ) {
return -1;
}
Expand Down

0 comments on commit 23db63f

Please sign in to comment.