]> 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 19:55:32 +0000 (21:55 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Fri, 12 Oct 2012 19:55:32 +0000 (21:55 +0200)
r/a=LpSolit

Bugzilla.pm

index 84e3f3ab8b02e8987c4b2145e22fdbc76e03b3bf..504472843d6afdd70092741fbe6f9c6de6a45077 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 {
@@ -856,7 +857,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.