Default CC is ignored when creating a bug via the webservice

RESOLVED FIXED in Bugzilla 3.0

Status

()

--
major
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: nahor.j+bugmoz, Assigned: mkanat)

Tracking

Bugzilla 3.0
Bug Flags:
approval +
approval3.0 +
blocking3.0.1 +

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
Build Identifier: 

When creating a new bug using the webservice, if there is no "cc" parameter when calling "Bug.create", the emails in the default CC of the product/component is ignored, i.e. the new bug will not have any emails in its CC list.

However, when a "cc" parameter is passed, even if it's an empty array, then the default CC is used, i.e. there will be emails in the  new bug's CC list.

Reproducible: Always
(Assignee)

Comment 1

11 years ago
Yes, this is an error in _check_cc in Bugzilla::Bug.
Severity: normal → major
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking3.0.1+
OS: Windows XP → All
Hardware: PC → All
Target Milestone: --- → Bugzilla 3.0
(Assignee)

Comment 2

11 years ago
Created attachment 266113 [details] [diff] [review]
v1

I'm pretty sure this will fix it, though I can't test it because XMLRPC.sh isn't working right, for some reason.
Assignee: webservice → mkanat
Status: NEW → ASSIGNED
Attachment #266113 - Flags: review?(LpSolit)
(Reporter)

Comment 3

11 years ago
>-    return [] unless $ccs;
>+    return [map {$_->id} $component->initial_cc] unless $ccs;

I don't really know Perl so it may be a stupid idea but what about:
  $ccs = [] unless $ccs;
instead of returning early from the function?

This should make the function less likely to break again because of a new feature like the default CC list.

Comment 4

11 years ago
Comment on attachment 266113 [details] [diff] [review]
v1

>+    return [map {$_->id} $component->initial_cc] unless $ccs;

You must write: @{$component->initial_cc} as $component->initial_cc is an arrayref. Your fix is working fine with @{} added. Please fix that on checkin. r=LpSolit
Attachment #266113 - Flags: review?(LpSolit) → review+

Updated

11 years ago
Flags: approval3.0+
Flags: approval+
Version: unspecified → 3.0
(Assignee)

Comment 5

11 years ago
tip:

Checking in Bugzilla/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v  <--  Bug.pm
new revision: 1.180; previous revision: 1.179
done

3.0:

Checking in Bugzilla/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v  <--  Bug.pm
new revision: 1.171.2.1; previous revision: 1.171
done
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
Summary: Default CC is ignore when create a bug via the webservice → Default CC is ignored when creating a bug via the webservice
You need to log in before you can comment on or make changes to this bug.