diff options
author | Tiago Mello <timello@gmail.com> | 2010-08-24 22:25:49 +0200 |
---|---|---|
committer | Tiago Mello <timello@gmail.com> | 2010-08-24 22:25:49 +0200 |
commit | 85e75aba6a7131da9d63b1f628a27e986bb428c5 (patch) | |
tree | 62ea9dab6305ba21a67b1904523435365b53aae5 /Bugzilla/Bug.pm | |
parent | e09c48b2f7668071264c975f9191cf41b493ef1c (diff) | |
download | bugzilla-85e75aba6a7131da9d63b1f628a27e986bb428c5.tar.gz bugzilla-85e75aba6a7131da9d63b1f628a27e986bb428c5.tar.xz |
Bug 586871: Convert all Bugzilla->get_fields calls to Bugzilla->fields
r/a=mkanat
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r-- | Bugzilla/Bug.pm | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 915ce5307..4c8922352 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -195,11 +195,11 @@ sub VALIDATOR_DEPENDENCIES { version => ['product'], ); - my @custom_deps = Bugzilla->get_fields( - { visibility_field_id => NOT_NULL }); - foreach my $field (@custom_deps) { - $deps{$field->name} = [$field->visibility_field->name]; + foreach my $field (@{ Bugzilla->fields }) { + $deps{$field->name} = [ $field->visibility_field->name ] + if $field->{visibility_field_id}; } + $cache->{bug_validator_dependencies} = \%deps; return \%deps; }; @@ -242,7 +242,7 @@ use constant NUMERIC_COLUMNS => qw( ); sub DATE_COLUMNS { - my @fields = Bugzilla->get_fields({ type => FIELD_TYPE_DATETIME }); + my @fields = @{ Bugzilla->fields({ type => FIELD_TYPE_DATETIME }) }; return map { $_->name } @fields; } @@ -739,9 +739,9 @@ sub run_create_validators { Bugzilla::Hook::process('bug_end_of_create_validators', { params => $params }); - my @mandatory_fields = Bugzilla->get_fields({ is_mandatory => 1, - enter_bug => 1, - obsolete => 0 }); + my @mandatory_fields = @{ Bugzilla->fields({ is_mandatory => 1, + enter_bug => 1, + obsolete => 0 }) }; foreach my $field (@mandatory_fields) { $class->_check_field_is_mandatory($params->{$field->name}, $field, $params); @@ -3501,7 +3501,7 @@ sub bug_alias_to_id { sub editable_bug_fields { my @fields = Bugzilla->dbh->bz_table_columns('bugs'); # Obsolete custom fields are not editable. - my @obsolete_fields = Bugzilla->get_fields({obsolete => 1, custom => 1}); + my @obsolete_fields = @{ Bugzilla->fields({obsolete => 1, custom => 1}) }; @obsolete_fields = map { $_->name } @obsolete_fields; foreach my $remove ("bug_id", "reporter", "creation_ts", "delta_ts", "lastdiffed", @obsolete_fields) @@ -4061,8 +4061,9 @@ sub AUTOLOAD { return $self->{$attr} if defined $self->{$attr}; - $self->{_multi_selects} ||= [Bugzilla->get_fields( - {custom => 1, type => FIELD_TYPE_MULTI_SELECT })]; + $self->{_multi_selects} ||= Bugzilla->fields( + { custom => 1, type => FIELD_TYPE_MULTI_SELECT }); + if ( grep($_->name eq $attr, @{$self->{_multi_selects}}) ) { # There is a bug in Perl 5.10.0, which is fixed in 5.10.1, # which taints $attr at this point. trick_taint() can go |