From f78bc351db35dd8209240eb89bbf45d69e06c0ee Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 26 Mar 2013 12:47:14 +0800 Subject: Bug 854770: fix issues with bugzilla-push --- extensions/Push/lib/Backoff.pm | 2 +- extensions/Push/lib/Connector/TCL.pm | 2 ++ extensions/Push/lib/Connectors.pm | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'extensions/Push/lib') diff --git a/extensions/Push/lib/Backoff.pm b/extensions/Push/lib/Backoff.pm index c0ea15a59..05ee0a775 100644 --- a/extensions/Push/lib/Backoff.pm +++ b/extensions/Push/lib/Backoff.pm @@ -76,7 +76,7 @@ sub inc { my $attempts = $self->attempts + 1; my $seconds = $attempts <= 4 ? 5 ** $attempts : 15 * 60; - my ($date) = $dbh->selectrow_array("SELECT NOW() + " . $dbh->sql_interval($seconds, 'SECOND')); + my ($date) = $dbh->selectrow_array("SELECT " . $dbh->sql_date_math('NOW()', '+', $seconds, 'SECOND')); $self->{next_attempt_ts} = $date; $self->{attempts} = $attempts; diff --git a/extensions/Push/lib/Connector/TCL.pm b/extensions/Push/lib/Connector/TCL.pm index 52c3f3876..6207e2eac 100644 --- a/extensions/Push/lib/Connector/TCL.pm +++ b/extensions/Push/lib/Connector/TCL.pm @@ -20,6 +20,7 @@ use Bugzilla::User; use Bugzilla::Attachment; use Digest::MD5 qw(md5_hex); +use Encode qw(encode_utf8); sub options { return ( @@ -182,6 +183,7 @@ sub send { RootName => 'sync', XMLDecl => 1, ); + $xml = encode_utf8($xml); # generate md5 my $md5 = md5_hex($xml); diff --git a/extensions/Push/lib/Connectors.pm b/extensions/Push/lib/Connectors.pm index e765b4a43..026d3f7f1 100644 --- a/extensions/Push/lib/Connectors.pm +++ b/extensions/Push/lib/Connectors.pm @@ -107,6 +107,7 @@ sub exists { sub by_name { my ($self, $name) = @_; + $self->_load(); return unless exists $self->{objects}->{$name}; return $self->{objects}->{$name}; } -- cgit v1.2.3-24-g4f1b