From: Francois Gouget Subject: [Tools] testbot/web: Fix the sort order of a job's tasks. Message-Id: Date: Tue, 17 Jan 2017 16:04:24 +0100 (CET) Each entry's id is a numeric value that's equal to step.no*100+task.no. But by default sort performs a string comparison resulting in task (10,1), aka "1001", coming before (1,1), aka "101", which comes before (11,1), aka "1101", etc. Also note that sorting is normally the job of the CollectionBlock but the JobDetails page is bypassing it. Signed-off-by: Francois Gouget --- testbot/web/JobDetails.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl index b43d3756..cf3b4a8c 100644 --- a/testbot/web/JobDetails.pl +++ b/testbot/web/JobDetails.pl @@ -213,7 +213,7 @@ sub SortKeys($$$) { my ($self, $CollectionBlock, $Keys) = @_; - my @SortedKeys = sort @$Keys; + my @SortedKeys = sort { $a <=> $b } @$Keys; return \@SortedKeys; } -- 2.11.0