Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
use base qw(Bugzilla::Object);
+use Bugzilla::Install::Requirements qw(vers_cmp);
use Bugzilla::Util;
use Bugzilla::Error;
);
use constant NAME_FIELD => 'value';
-use constant LIST_ORDER => NAME_FIELD;
+# This is "id" because it has to be filled in and id is probably the fastest.
+# We do a custom sort in new_from_list below.
+use constant LIST_ORDER => 'id';
sub new {
my $class = shift;
return $class->SUPER::new(@_);
}
+sub new_from_list {
+ my $self = shift;
+ my $list = $self->SUPER::new_from_list(@_);
+ return [sort { vers_cmp(lc($a->name), lc($b->name)) } @$list];
+}
+
sub bug_count {
my $self = shift;
my $dbh = Bugzilla->dbh;