From bdbea0ef742a3badba8e8b7d9f0486ec57e212f6 Mon Sep 17 00:00:00 2001 From: Simon Green Date: Fri, 12 Oct 2012 21:55:32 +0200 Subject: Bug 790129: Bugzilla->fields returns fields in random order (the sortkey is ignored) r/a=LpSolit --- Bugzilla.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Bugzilla.pm') diff --git a/Bugzilla.pm b/Bugzilla.pm index 84e3f3ab8..504472843 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 { @@ -856,7 +857,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. -- cgit v1.2.3-24-g4f1b