summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-12-10 20:28:23 +0100
committerByron Jones <bjones@mozilla.com>2013-12-10 20:28:23 +0100
commitf6f5b96671bf9da718129fa6201d9c4a222947f9 (patch)
treeed3709b0c1ce354850b554b2e4a52616bf5d4c76
parentad2cdcdfb3fb4b3ae336847258ed6b2b55f7aa0f (diff)
downloadbugzilla-f6f5b96671bf9da718129fa6201d9c4a222947f9.tar.gz
bugzilla-f6f5b96671bf9da718129fa6201d9c4a222947f9.tar.xz
Bug 930867: background bugmail generation throws a "Can't store CODE items" error on dep_only changes
r=sgreen, a=sgreen
-rw-r--r--Bugzilla/BugMail.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm
index 4db332e06..bdbc21e5a 100644
--- a/Bugzilla/BugMail.pm
+++ b/Bugzilla/BugMail.pm
@@ -383,11 +383,14 @@ sub enqueue {
# we need to flatten all objects to a hash before pushing to the job queue.
# the hashes need to be inflated in the dequeue method.
$vars->{bug} = _flatten_object($vars->{bug});
- $vars->{to_user} = $vars->{to_user}->flatten_to_hash;
+ $vars->{to_user} = _flatten_object($vars->{to_user});
$vars->{changer} = _flatten_object($vars->{changer});
$vars->{new_comments} = [ map { _flatten_object($_) } @{ $vars->{new_comments} } ];
foreach my $diff (@{ $vars->{diffs} }) {
$diff->{who} = _flatten_object($diff->{who});
+ if (exists $diff->{blocker}) {
+ $diff->{blocker} = _flatten_object($diff->{blocker});
+ }
}
Bugzilla->job_queue->insert('bug_mail', { vars => $vars });
}
@@ -404,6 +407,9 @@ sub dequeue {
$vars->{new_comments} = [ map { Bugzilla::Comment->new_from_hash($_) } @{ $vars->{new_comments} } ];
foreach my $diff (@{ $vars->{diffs} }) {
$diff->{who} = Bugzilla::User->new_from_hash($diff->{who});
+ if (exists $diff->{blocker}) {
+ $diff->{blocker} = Bugzilla::Bug->new_from_hash($diff->{blocker});
+ }
}
# generate bugmail and send
MessageToMTA(_generate_bugmail($vars), 1);