Commit d403dca9 authored by Max Kanat-Alexander's avatar Max Kanat-Alexander

Bug 415813: Implement Bug.update() as an API for WebServices

r=dkl, a=mkanat
parent 33e1f44e
...@@ -265,9 +265,14 @@ use constant MAX_LINE_LENGTH => 254; ...@@ -265,9 +265,14 @@ use constant MAX_LINE_LENGTH => 254;
# of Bugzilla. (These are the field names that the WebService and email_in.pl # of Bugzilla. (These are the field names that the WebService and email_in.pl
# use.) # use.)
use constant FIELD_MAP => { use constant FIELD_MAP => {
blocks => 'blocked',
is_confirmed => 'everconfirmed',
cc_accessible => 'cclist_accessible',
creation_time => 'creation_ts', creation_time => 'creation_ts',
creator => 'reporter', creator => 'reporter',
description => 'comment', description => 'comment',
depends_on => 'dependson',
dupe_of => 'dup_id',
id => 'bug_id', id => 'bug_id',
last_change_time => 'delta_ts', last_change_time => 'delta_ts',
platform => 'rep_platform', platform => 'rep_platform',
...@@ -3706,11 +3711,17 @@ sub LogActivityEntry { ...@@ -3706,11 +3711,17 @@ sub LogActivityEntry {
# Convert WebService API and email_in.pl field names to internal DB field # Convert WebService API and email_in.pl field names to internal DB field
# names. # names.
sub map_fields { sub map_fields {
my ($params) = @_; my ($params, $except) = @_;
my %field_values; my %field_values;
foreach my $field (keys %$params) { foreach my $field (keys %$params) {
my $field_name = FIELD_MAP->{$field} || $field; my $field_name;
if ($except->{$field}) {
$field_name = $field;
}
else {
$field_name = FIELD_MAP->{$field} || $field;
}
$field_values{$field_name} = $params->{$field}; $field_values{$field_name} = $params->{$field};
} }
......
...@@ -66,6 +66,7 @@ use constant WS_ERROR_CODE => { ...@@ -66,6 +66,7 @@ use constant WS_ERROR_CODE => {
alias_in_use => 103, alias_in_use => 103,
alias_is_numeric => 103, alias_is_numeric => 103,
alias_has_comma_or_space => 103, alias_has_comma_or_space => 103,
alias_not_allowed => 103,
# Misc. bug field errors # Misc. bug field errors
illegal_field => 104, illegal_field => 104,
freetext_too_long => 104, freetext_too_long => 104,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment