From 426f563ff945f256dae9bd1a0b3774026a93e9c0 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Mon, 14 Dec 2009 23:08:55 +0000 Subject: Bug 525420: Cache Bugzilla::Bug::VALIDATORS so that the same hash is returned every time within a single page call Patch by Max Kanat-Alexander r=LpSolit, r=dkl, a=mkanat --- Bugzilla/Bug.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Bugzilla') diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 9768dede4..ab035fcba 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -122,6 +122,9 @@ use constant REQUIRED_CREATE_FIELDS => qw( # There are also other, more complex validators that are called # from run_create_validators. sub VALIDATORS { + my $cache = Bugzilla->request_cache; + return $cache->{bug_validators} if defined $cache->{bug_validators}; + my $validators = { alias => \&_check_alias, bug_file_loc => \&_check_bug_file_loc, @@ -163,7 +166,8 @@ sub VALIDATORS { $validators->{$field->name} = $validator; } - return $validators; + $cache->{bug_validators} = $validators; + return $cache->{bug_validators}; }; use constant UPDATE_VALIDATORS => { -- cgit v1.2.3-24-g4f1b