summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-02-17 00:48:51 +0100
committerDave Lawrence <dlawrence@mozilla.com>2012-02-17 00:48:51 +0100
commita636e89b6851367fa4e59e1bb646d1ad8d3456a6 (patch)
tree9b8f57862b0cadba10494a98036e902cd7d7c5f9
parent1dcfd9872fe4d43785e76030a89122424ffd4a7d (diff)
parent4622fc071220abaf0defbbde7be6c0c9ecba8aa8 (diff)
downloadbugzilla-a636e89b6851367fa4e59e1bb646d1ad8d3456a6.tar.gz
bugzilla-a636e89b6851367fa4e59e1bb646d1ad8d3456a6.tar.xz
merged with bugzilla/4.2
-rw-r--r--Bugzilla/DB/Schema.pm2
-rw-r--r--Bugzilla/Install/DB.pm6
-rw-r--r--Bugzilla/Mailer.pm6
-rw-r--r--Bugzilla/WebService.pm20
-rw-r--r--Bugzilla/WebService/Bug.pm26
-rw-r--r--Bugzilla/WebService/Server/XMLRPC.pm14
-rw-r--r--t/001compile.t2
7 files changed, 37 insertions, 39 deletions
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 a89be351c..7dc203933 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 #
################################################################
diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm
index cf494aa7f..74c9010c2 100644
--- a/Bugzilla/Mailer.pm
+++ b/Bugzilla/Mailer.pm
@@ -157,7 +157,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');
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/Bug.pm b/Bugzilla/WebService/Bug.pm
index c83ed5b5f..69dcb7d42 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -1337,19 +1337,14 @@ value looks like this:
{
bugs => {
- 1345 => {
- attachments => [
- { (attachment) },
- { (attachment) }
- ]
- },
- 9874 => {
- attachments => [
- { (attachment) },
- { (attachment) }
- ]
-
- },
+ 1345 => [
+ { (attachment) },
+ { (attachment) }
+ ],
+ 9874 => [
+ { (attachment) },
+ { (attachment) }
+ ],
},
attachments => {
@@ -1360,9 +1355,8 @@ value looks like this:
The attachments of any bugs that you specified in the C<ids> argument in
input are returned in C<bugs> on output. C<bugs> is a hash that has integer
-bug IDs for keys and contains a single key, C<attachments>. 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<attachment_ids>, they
are returned in C<attachments> on output. This is a hash where the attachment
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(@_);
diff --git a/t/001compile.t b/t/001compile.t
index 9c5b50e2d..a2176babd 100644
--- a/t/001compile.t
+++ b/t/001compile.t
@@ -67,7 +67,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`;