Commit 426f563f authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 525420: Cache Bugzilla::Bug::VALIDATORS so that the same hash is returned…

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 <mkanat@bugzilla.org> r=LpSolit, r=dkl, a=mkanat
parent 7d331618
......@@ -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 => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment