LP#1306675 TPAC maketext default handler
authorBill Erickson <berick@esilibrary.com>
Thu, 15 May 2014 15:22:16 +0000 (11:22 -0400)
committerBen Shum <bshum@biblio.org>
Wed, 27 Aug 2014 05:14:36 +0000 (01:14 -0400)
Fall back to an unitialized maketext handler, which defaults to the
template language, when OpenILS::WWW::EGWeb::I18N->get_handle fails to
return a response.

Note that why get_handle() returns undef is not yet known.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm

index 8b72e53..0f9e93e 100644 (file)
@@ -90,7 +90,8 @@ sub set_text_handler {
     $r->log->debug("egweb: messages locale = $locale");
 
     return sub {
-        my $lh = OpenILS::WWW::EGWeb::I18N->get_handle($locale);
+        my $lh = OpenILS::WWW::EGWeb::I18N->get_handle($locale) 
+            || OpenILS::WWW::EGWeb::I18N->new;
         return $lh->maketext(@_);
     };
 }