]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 930867: background bugmail generation throws a "Can't store CODE items" error...
authorByron Jones <bjones@mozilla.com>
Tue, 10 Dec 2013 19:28:23 +0000 (03:28 +0800)
committerByron Jones <bjones@mozilla.com>
Tue, 10 Dec 2013 19:28:23 +0000 (03:28 +0800)
r=sgreen, a=sgreen

Bugzilla/BugMail.pm

index 4db332e067e19b2649074b4ba796b296b9b2d104..bdbc21e5a5e46f4a29e1e72cda37ef2b0d7f7e9d 100644 (file)
@@ -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);