summaryrefslogtreecommitdiffstats
path: root/extensions/MozReview
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/MozReview')
-rw-r--r--extensions/MozReview/lib/WebService.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/extensions/MozReview/lib/WebService.pm b/extensions/MozReview/lib/WebService.pm
index d814e05d6..24ae5cb5f 100644
--- a/extensions/MozReview/lib/WebService.pm
+++ b/extensions/MozReview/lib/WebService.pm
@@ -29,6 +29,7 @@ use constant PUBLIC_METHODS => qw( attachments );
BEGIN {
*_attachment_to_hash = \&Bugzilla::WebService::Bug::_attachment_to_hash;
+ *_flag_to_hash = \&Bugzilla::WebService::Bug::_flag_to_hash;
}
sub attachments {
@@ -154,6 +155,11 @@ sub attachments {
isprivate => $attachment->{is_private},
});
+ if ($flags) {
+ my ($old_flags, $new_flags) = extract_flags($flags, $bug, $attachment_obj);
+ $attachment_obj->set_flags($old_flags, $new_flags);
+ }
+
push(@created, $attachment_obj);
$attachment_obj->update($timestamp);
@@ -171,7 +177,7 @@ sub attachments {
$bug->send_changes();
my %attachments_created = map { $_->id => $self->_attachment_to_hash($_, $params) } @created;
- my %attachments_modified = map { $_->{id}->value => $_ } @modified;
+ my %attachments_modified = map { (ref $_->{id} ? $_->{id}->value : $_->{id}) => $_ } @modified;
return { attachments_created => \%attachments_created, attachments_modified => \%attachments_modified };
}