Bug 825718: Fix Bugzilla::Bug->check() wrt caching mechanism

r=LpSolit,r=LpSolit


git-svn-id: svn://10.0.0.236/trunk@264627 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkanat%bugzilla.org 2013-01-07 06:00:42 +00:00
parent 04bb52c2f6
commit 74f6086412
2 changed files with 8 additions and 6 deletions

View File

@ -1 +1 @@
8548
8549

View File

@ -372,14 +372,16 @@ sub cache_key {
sub check {
my $class = shift;
my ($id, $field) = @_;
ThrowUserError('improper_bug_id_field_value', { field => $field }) unless defined $id;
my ($param, $field) = @_;
# Bugzilla::Bug throws lots of special errors, so we don't call
# SUPER::check, we just call our new and do our own checks.
$id = trim($id);
my $self = $class->new($id);
my $id = ref($param)
? ($param->{id} = trim($param->{id}))
: ($param = trim($param));
ThrowUserError('improper_bug_id_field_value', { field => $field }) unless defined $id;
my $self = $class->new($param);
if ($self->{error}) {
# For error messages, use the id that was returned by new(), because