summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@redhat.com>2014-07-02 18:39:32 +0200
committerDavid Lawrence <dkl@redhat.com>2014-07-02 18:39:32 +0200
commite0d898d3883c2e715b72e6a46bb92cd77cf79314 (patch)
tree958b79ba59b38d662ecc7f3c1cdb7187699ccf2b
parent48577f23ee0cccfcc476cbac477a9b30c5194fa9 (diff)
downloadbugzilla-e0d898d3883c2e715b72e6a46bb92cd77cf79314.tar.gz
bugzilla-e0d898d3883c2e715b72e6a46bb92cd77cf79314.tar.xz
Bug 1033258 - bzexport fails to leave a comment when attaching a file using the BzAPI compatibility layer
-rw-r--r--extensions/BzAPI/lib/Resources/Bug.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/extensions/BzAPI/lib/Resources/Bug.pm b/extensions/BzAPI/lib/Resources/Bug.pm
index eed439a00..d9a2604a9 100644
--- a/extensions/BzAPI/lib/Resources/Bug.pm
+++ b/extensions/BzAPI/lib/Resources/Bug.pm
@@ -587,6 +587,12 @@ sub add_attachment_request {
}
}
}
+
+ # Add comment if one is provided
+ if (exists $params->{comments} && scalar @{ $params->{comments} }) {
+ $params->{comment} = $params->{comments}->[0]->{text};
+ delete $params->{comments};
+ }
}
sub update_attachment_request {
@@ -613,8 +619,9 @@ sub update_attachment_request {
}
}
}
+
# Add comment if one is provided
- if ($params->{comments}) {
+ if (exists $params->{comments} && scalar @{ $params->{comments} }) {
$params->{comment} = $params->{comments}->[0]->{text};
delete $params->{comments};
}