maketext filter must be registered as a dynamic filter to properly handle arguments
authorBill Erickson <berick@esilibrary.com>
Mon, 1 Aug 2011 22:35:39 +0000 (18:35 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 1 Aug 2011 22:35:39 +0000 (18:35 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm

index d684ad0..33a5dbb 100644 (file)
@@ -57,7 +57,15 @@ sub handler {
             EGI18N => 'OpenILS::WWW::EGWeb::I18NFilter',
             CGI_utf8 => 'OpenILS::WWW::EGWeb::CGI_utf8'
         },
-        FILTERS => {l => $text_handler}
+        FILTERS => {
+            # Register a dynamic filter factory for our locale::maketext generator
+            l => [
+                sub {
+                    my($ctx, @args) = @_;
+                    return sub { $text_handler->(shift(), @args); }
+                }, 1
+            ]
+        }
     });
 
     unless($tt->process($template, {ctx => $ctx, ENV => \%ENV, l => $text_handler})) {