summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-12-15 00:08:55 +0100
committermkanat%bugzilla.org <>2009-12-15 00:08:55 +0100
commit426f563ff945f256dae9bd1a0b3774026a93e9c0 (patch)
treeaeb917a5b64b8135620f01a07bcb8893c9b49622 /Bugzilla
parent7d331618db87ff7ae268b3c73d5f07ec122af9c2 (diff)
downloadbugzilla-426f563ff945f256dae9bd1a0b3774026a93e9c0.tar.gz
bugzilla-426f563ff945f256dae9bd1a0b3774026a93e9c0.tar.xz
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
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Bug.pm6
1 files changed, 5 insertions, 1 deletions
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 => {