summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Field.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-09-24 09:55:05 +0200
committermkanat%bugzilla.org <>2008-09-24 09:55:05 +0200
commit4ab6c90fff265849d9284b5d4f9aca93da231edd (patch)
treec0a4c366a9086560ec3602c65131e28c2c0bd90f /Bugzilla/Field.pm
parentda12b9b0e2661b02133a0ed27f26811e8a79e117 (diff)
downloadbugzilla-4ab6c90fff265849d9284b5d4f9aca93da231edd.tar.gz
bugzilla-4ab6c90fff265849d9284b5d4f9aca93da231edd.tar.xz
Bug 357904: Create an object for a Field Value and have Bugzilla::Field->legal_values use it
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=bbaetz, a=mkanat
Diffstat (limited to 'Bugzilla/Field.pm')
-rw-r--r--Bugzilla/Field.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/Bugzilla/Field.pm b/Bugzilla/Field.pm
index 4b801f13d..bb516b8f4 100644
--- a/Bugzilla/Field.pm
+++ b/Bugzilla/Field.pm
@@ -73,9 +73,10 @@ use strict;
use base qw(Exporter Bugzilla::Object);
@Bugzilla::Field::EXPORT = qw(check_field get_field_id get_legal_field_values);
-use Bugzilla::Util;
use Bugzilla::Constants;
use Bugzilla::Error;
+use Bugzilla::Field::Choice;
+use Bugzilla::Util;
###############################
#### Initialization ####
@@ -364,7 +365,8 @@ sub enter_bug { return $_[0]->{enter_bug} }
=item C<legal_values>
-A reference to an array with valid active values for this field.
+Valid values for this field, as an array of L<Bugzilla::Field::Choice>
+objects.
=back
@@ -374,7 +376,8 @@ sub legal_values {
my $self = shift;
if (!defined $self->{'legal_values'}) {
- $self->{'legal_values'} = get_legal_field_values($self->name);
+ my @values = Bugzilla::Field::Choice->get_all({ field => $self });
+ $self->{'legal_values'} = \@values;
}
return $self->{'legal_values'};
}