From: Simon Green Date: Fri, 12 Oct 2012 19:59:47 +0000 (+0200) Subject: Bug 790129: Bugzilla->fields returns fields in random order (the sortkey is ignored) X-Git-Tag: bugzilla-4.4rc1~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f62dc7b3cc9bd858f4ef7364a141deb15158fa4;p=thirdparty%2Fbugzilla.git Bug 790129: Bugzilla->fields returns fields in random order (the sortkey is ignored) r/a=LpSolit --- diff --git a/Bugzilla.pm b/Bugzilla.pm index 25b0583898..dacdb5f692 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -591,7 +591,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 { @@ -855,7 +856,7 @@ in a hashref: =item C 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 objects.