From: mkanat%bugzilla.org <> Date: Mon, 14 Dec 2009 23:08:55 +0000 (+0000) Subject: Bug 525420: Cache Bugzilla::Bug::VALIDATORS so that the same hash is returned every... X-Git-Tag: bugzilla-3.5.3~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=426f563ff945f256dae9bd1a0b3774026a93e9c0;p=thirdparty%2Fbugzilla.git 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 --- diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 9768dede42..ab035fcba6 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 => {