summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Version.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2007-02-21 07:53:33 +0100
committermkanat%bugzilla.org <>2007-02-21 07:53:33 +0100
commitc1cec45127bc314a34eca12da2fce5d86710249c (patch)
treedef636bed2739a643daa3354eceec182bdb94910 /Bugzilla/Version.pm
parente0318906110e5c22a7ff822fb9df082672c89832 (diff)
downloadbugzilla-c1cec45127bc314a34eca12da2fce5d86710249c.tar.gz
bugzilla-c1cec45127bc314a34eca12da2fce5d86710249c.tar.xz
Bug 371016: Versions are no longer sorted by version-sort
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'Bugzilla/Version.pm')
-rw-r--r--Bugzilla/Version.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/Bugzilla/Version.pm b/Bugzilla/Version.pm
index f48de9089..ba7631a80 100644
--- a/Bugzilla/Version.pm
+++ b/Bugzilla/Version.pm
@@ -21,6 +21,7 @@ package Bugzilla::Version;
use base qw(Bugzilla::Object);
+use Bugzilla::Install::Requirements qw(vers_cmp);
use Bugzilla::Util;
use Bugzilla::Error;
@@ -39,7 +40,9 @@ use constant DB_COLUMNS => qw(
);
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;
@@ -70,6 +73,12 @@ sub new {
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;