summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Green <sgreen+mozilla@redhat.com>2012-10-12 22:04:17 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2012-10-12 22:04:17 +0200
commitaf1cf8f17877c1705c8cac98e26c6838340379d6 (patch)
treea137bdea7349b69547e11442784e2fe5b2638025
parent938692bf09df0bce9dae7be72925bf2f1eb75dfe (diff)
downloadbugzilla-af1cf8f17877c1705c8cac98e26c6838340379d6.tar.gz
bugzilla-af1cf8f17877c1705c8cac98e26c6838340379d6.tar.xz
Bug 790129: Bugzilla->fields returns fields in random order (the sortkey is ignored)
r/a=LpSolit
-rw-r--r--Bugzilla.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 65ddcc2bc..5b39e4c81 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -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.