]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 790129: Bugzilla->fields returns fields in random order (the sortkey is ignored)
authorSimon Green <sgreen+mozilla@redhat.com>
Fri, 12 Oct 2012 20:04:17 +0000 (22:04 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Fri, 12 Oct 2012 20:04:17 +0000 (22:04 +0200)
r/a=LpSolit

Bugzilla.pm

index 65ddcc2bceebed0e74e47cf61734769b1eb9d28e..5b39e4c8109c42cd88356ead149b362100224ce4 100644 (file)
@@ -592,7 +592,8 @@ sub fields {
         }
     }
 
-    return $do_by_name ? \%requested : [values %requested];
+    return $do_by_name ? \%requested
+        : [sort { $a->sortkey <=> $b->sortkey || $a->name cmp $b->name } values %requested];
 }
 
 sub active_custom_fields {
@@ -847,7 +848,7 @@ in a hashref:
 =item C<by_name>
 
 If false (or not specified), this method will return an arrayref of
-the requested fields. The order of the returned fields is random.
+the requested fields.
 
 If true, this method will return a hashref of fields, where the keys
 are field names and the valules are L<Bugzilla::Field> objects.