From 816eb1e9bd788b2b3468481281793639c824996d Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Mon, 25 Feb 2008 22:06:24 +0000 Subject: Bug 415652: Implement Bugzilla->active_custom_fields - Patch by Frédéric Buclin r/a=mkanat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Bugzilla.pm') diff --git a/Bugzilla.pm b/Bugzilla.pm index c77c039ce..e35c75934 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -430,10 +430,13 @@ sub get_fields { return @$fields; } -sub custom_field_names { - # Get a list of custom fields and convert it into a list of their names. - return map($_->{name}, - @{Bugzilla::Field->match({ custom=>1, obsolete=>0 })}); +sub active_custom_fields { + my $class = shift; + if (!exists $class->request_cache->{active_custom_fields}) { + $class->request_cache->{active_custom_fields} = + Bugzilla::Field->match({ custom => 1, obsolete => 0 }); + } + return @{$class->request_cache->{active_custom_fields}}; } sub hook_args { -- cgit v1.2.3-24-g4f1b