From e0d898d3883c2e715b72e6a46bb92cd77cf79314 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 2 Jul 2014 16:39:32 +0000 Subject: Bug 1033258 - bzexport fails to leave a comment when attaching a file using the BzAPI compatibility layer --- extensions/BzAPI/lib/Resources/Bug.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'extensions/BzAPI/lib/Resources') 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}; } -- cgit v1.2.3-24-g4f1b