[mb-commits] branch, beta, updated. Merge branch 'mbs-5741' into beta Fix invalid use of `with_translations` Allo...
MusicBrainz Git Server <[email protected]> Tue, 15 Jan 2013 11:48:05 +0000
| Newsgroups | gmane.comp.audio.musicbrainz.cvs |
|---|---|
| Message-ID | <E1Tv4zt-0003kK-Dg@wiley> |
The branch, beta has been updated
via http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=307ae1782c63b423774864d8958250543eae7153 (commit)
via http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=67e4160aebc2f03f6f9b89fa66dcd3a0239fde44 (commit)
via http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=ddf62ca934f2916fa4eeaeac9e21bd3faf0f3d15 (commit)
via http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=bc195f8980b361395a2632ef6cc77c593eaed690 (commit)
from http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=c27215820e3ef0ac600d2267539ea23de04b66fd (commit)
Summary of changes:
lib/DBDefs/Default.pm | 11 +-
lib/MusicBrainz/Server.pm | 172 +++++++++++++++++++----------------
lib/MusicBrainz/Server/Connector.pm | 3 +-
lib/MusicBrainz/Server/Model/MB.pm | 6 -
4 files changed, 101 insertions(+), 91 deletions(-)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 307ae1782c63b423774864d8958250543eae7153
Merge: c272158 67e4160
Author: Oliver Charles <[email protected]>
Date: Tue Jan 15 11:47:43 2013 +0000
Merge branch 'mbs-5741' into beta
* mbs-5741:
Fix invalid use of `with_translations`
Allow page timeouts to be configured per page, rather than per app
Consolidate connection opening and closing
commit 67e4160aebc2f03f6f9b89fa66dcd3a0239fde44
Author: Oliver Charles <[email protected]>
Date: Tue Jan 15 11:13:11 2013 +0000
Fix invalid use of `with_translations`
diff --git a/lib/MusicBrainz/Server.pm b/lib/MusicBrainz/Server.pm
index c7468b4..c431264 100644
--- a/lib/MusicBrainz/Server.pm
+++ b/lib/MusicBrainz/Server.pm
@@ -265,8 +265,8 @@ sub _handle_param_unicode_decoding {
}
# Set and unset translation language
-around dispatch => sub {
- my ($orig, $c, @args) = @_;
+sub with_translations {
+ my ($c, $code) = @_;
$_->instance->build_languages_from_header($c->req->headers)
for qw( MusicBrainz::Server::Translation
@@ -285,17 +285,25 @@ around dispatch => sub {
# because s///r is a perl 5.14 feature
my $html_lang = $lang;
$html_lang =~ s/_([A-Z]{2})/-\L$1/;
+
$c->stash(
current_language => $lang,
current_language_html => $html_lang,
use_languages => scalar @{ Translation->instance->all_languages() }
);
- $c->$orig(@args);
+ $code->()
Translation->instance->unset_language();
};
+around dispatch => sub {
+ my ($orig, $c, @args) = @_;
+ $c->with_translations(sub {
+ $c->$orig(@args)
+ });
+};
+
# All warnings should be logged
around dispatch => sub {
my ($orig, $c, @args) = @_;
@@ -319,7 +327,6 @@ after dispatch => sub {
};
# Timeout long running requests
-
around dispatch => sub {
my ($orig, $c, @args) = @_;
-----------------------------------------------------------------------
hooks/post-receive
--
mb_server