From 82a6ee698f52595ce7ec43fabefd222a1f80892a Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Tue, 14 Feb 2012 23:02:15 +0100 Subject: Bug 727240: The POD for Bug.attachments is wrong about the format of the returned data r=dkl a=LpSolit --- Bugzilla/WebService/Bug.pm | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index ea1becc0a..a8c7282ef 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -1274,19 +1274,14 @@ value looks like this: { bugs => { - 1345 => { - attachments => [ - { (attachment) }, - { (attachment) } - ] - }, - 9874 => { - attachments => [ - { (attachment) }, - { (attachment) } - ] - - }, + 1345 => [ + { (attachment) }, + { (attachment) } + ], + 9874 => [ + { (attachment) }, + { (attachment) } + ], }, attachments => { @@ -1297,9 +1292,8 @@ value looks like this: The attachments of any bugs that you specified in the C argument in input are returned in C on output. C is a hash that has integer -bug IDs for keys and contains a single key, C. That key points -to an arrayref that contains attachments as a hash. (Fields for attachments -are described below.) +bug IDs for keys and the values are arrayrefs that contain hashes as attachments. +(Fields for attachments are described below.) For any attachments that you specified directly in C, they are returned in C on output. This is a hash where the attachment -- cgit v1.2.3-24-g4f1b From 0081744381d7f56b4d41f1cdce4bf2c6e3991967 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Wed, 15 Feb 2012 16:26:34 +0100 Subject: Bug 722113: The profile_search table has a wrong index name r=glob a=LpSolit --- Bugzilla/DB/Schema.pm | 2 +- Bugzilla/Install/DB.pm | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index da0c7d207..874a99ce0 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -909,7 +909,7 @@ use constant ABSTRACT_SCHEMA => { list_order => {TYPE => 'MEDIUMTEXT'}, ], INDEXES => [ - profile_search_user_id => [qw(user_id)], + profile_search_user_id_idx => [qw(user_id)], ], }, diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index 44646962b..28c762d28 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -663,6 +663,12 @@ sub update_table_definitions { # 2011-11-28 dkl@mozilla.com - Bug 685611 _fix_notnull_defaults(); + # 2012-02-15 LpSolit@gmail.com - Bug 722113 + if ($dbh->bz_index_info('profile_search', 'profile_search_user_id')) { + $dbh->bz_drop_index('profile_search', 'profile_search_user_id'); + $dbh->bz_add_index('profile_search', 'profile_search_user_id_idx', [qw(user_id)]); + } + ################################################################ # New --TABLE-- changes should go *** A B O V E *** this point # ################################################################ -- cgit v1.2.3-24-g4f1b From 3d4edc9bd64bf54e5c8de528904a428d30503f3a Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Wed, 15 Feb 2012 10:59:08 -0500 Subject: Bug 724464 - JSON-RPC support shouldn't require SOAP::Lite r/a=LpSolit --- Bugzilla/WebService.pm | 20 -------------------- Bugzilla/WebService/Server/XMLRPC.pm | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/Bugzilla/WebService.pm b/Bugzilla/WebService.pm index fe9c3fe09..166707626 100644 --- a/Bugzilla/WebService.pm +++ b/Bugzilla/WebService.pm @@ -21,8 +21,6 @@ package Bugzilla::WebService; use strict; use Bugzilla::WebService::Server; -use XMLRPC::Lite; - # Used by the JSON-RPC server to convert incoming date fields apprpriately. use constant DATE_FIELDS => {}; # Used by the JSON-RPC server to convert incoming base64 fields appropriately. @@ -40,24 +38,6 @@ sub login_exempt { return $class->LOGIN_EXEMPT->{$method}; } -sub type { - my ($self, $type, $value) = @_; - if ($type eq 'dateTime') { - $value = $self->datetime_format_outbound($value); - } - return XMLRPC::Data->type($type)->value($value); -} - -# This is the XML-RPC implementation, see the README in Bugzilla/WebService/. -# Our "base" implementation is in Bugzilla::WebService::Server. -sub datetime_format_outbound { - my $self = shift; - my $value = Bugzilla::WebService::Server->datetime_format_outbound(@_); - # XML-RPC uses an ISO-8601 format that doesn't have any hyphens. - $value =~ s/-//g; - return $value; -} - 1; __END__ diff --git a/Bugzilla/WebService/Server/XMLRPC.pm b/Bugzilla/WebService/Server/XMLRPC.pm index b74d0eebd..5c3677993 100644 --- a/Bugzilla/WebService/Server/XMLRPC.pm +++ b/Bugzilla/WebService/Server/XMLRPC.pm @@ -31,6 +31,20 @@ if ($ENV{MOD_PERL}) { use Bugzilla::WebService::Constants; +# Allow WebService methods to call XMLRPC::Lite's type method directly +BEGIN { + *Bugzilla::WebService::type = sub { + my ($self, $type, $value) = @_; + if ($type eq 'dateTime') { + # This is the XML-RPC implementation, see the README in Bugzilla/WebService/. + # Our "base" implementation is in Bugzilla::WebService::Server. + $value = Bugzilla::WebService::Server->datetime_format_outbound($value); + $value =~ s/-//g; + } + return XMLRPC::Data->type($type)->value($value); + }; +} + sub initialize { my $self = shift; my %retval = $self->SUPER::initialize(@_); -- cgit v1.2.3-24-g4f1b From e9ec8679a651682a64838f97a2cce87ddc6dbd0e Mon Sep 17 00:00:00 2001 From: Marc Schumann Date: Wed, 15 Feb 2012 18:52:57 +0100 Subject: Test 1 fails if PERLLIB contains paths with whitespace. r=gerv; a=LpSolit https://bugzilla.mozilla.org/show_bug.cgi?id=714074 --- t/001compile.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/001compile.t b/t/001compile.t index 9e63da0b4..97a339b2d 100644 --- a/t/001compile.t +++ b/t/001compile.t @@ -62,7 +62,7 @@ sub compile_file { my $libs = ''; if ($ENV{PERL5LIB}) { - $libs = join " ", map { "-I$_" } split /$Config{path_sep}/, $ENV{PERL5LIB}; + $libs = join " ", map { "-I\"$_\"" } split /$Config{path_sep}/, $ENV{PERL5LIB}; } my $perl = qq{"$^X"}; my $output = `$perl $libs -wc$T $file 2>&1`; -- cgit v1.2.3-24-g4f1b From 4622fc071220abaf0defbbde7be6c0c9ecba8aa8 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Thu, 16 Feb 2012 18:32:19 +0100 Subject: Bug 723944: Plain-text only emails are mangled when they contain non-ASCII characters r=glob a=LpSolit --- Bugzilla/Mailer.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm index 5ee6fd2eb..7e42cb609 100644 --- a/Bugzilla/Mailer.pm +++ b/Bugzilla/Mailer.pm @@ -91,7 +91,11 @@ sub MessageToMTA { my ($part) = @_; return if $part->parts > 1; # Top-level my $content_type = $part->content_type || ''; - if ($content_type !~ /;/) { + $content_type =~ /charset=['"](.+)['"]/; + # If no charset is defined or is the default us-ascii, + # then we encode the email to UTF-8 if Bugzilla has utf8 enabled. + # XXX - This is a hack to workaround bug 723944. + if (!$1 || $1 eq 'us-ascii') { my $body = $part->body; if (Bugzilla->params->{'utf8'}) { $part->charset_set('UTF-8'); -- cgit v1.2.3-24-g4f1b