Closed Bug 382037 Opened 17 years ago Closed 17 years ago

Default CC is ignored when creating a bug via the webservice

Categories

(Bugzilla :: WebService, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

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

Details

Attachments

(1 file)

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
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
Attached patch v1Splinter Review
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)
>-    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 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+
Flags: approval3.0+
Flags: approval+
Version: unspecified → 3.0
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
Closed: 17 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.

Attachment

General

Created:
Updated:
Size: