use OpenILS::Utils::CStoreEditor qw/:funcs/;
use OpenILS::Utils::Fieldmapper;
use DateTime::Format::ISO8601;
-use CGI qw(-utf8);
+use CGI qw(:all -utf8);
# EGCatLoader sub-modules
use OpenILS::WWW::EGCatLoader::Util;
$self->ctx($ctx);
$self->cgi(new CGI);
- my $msg1 = "LFW XXX: param('query') is " . $self->cgi->param('query');
- $logger->info("LFW XXX: msg1 is " . $msg1);
- $logger->info("LFW XXX: query_string is " . $self->cgi->query_string());
-
OpenILS::Utils::CStoreEditor->init; # just in case
$self->editor(new_editor());
DEBUG => $ctx->{debug_template},
PLUGINS => {
EGI18N => 'OpenILS::WWW::EGWeb::I18NFilter',
- CGIUTF8 => 'OpenILS::WWW::EGWeb::CGIUTF8'
+ CGI_utf8 => 'OpenILS::WWW::EGWeb::CGI_utf8'
}
});
--- /dev/null
+package OpenILS::WWW::EGWeb::CGI_utf8;
+
+# The code in this module is copied from (except for a tiny modification)
+# Template::Plugin::CGI, which is written by:
+#
+# Andy Wardley E<lt>abw@wardley.orgE<gt> L<http://wardley.org/>
+#
+# Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved.
+#
+# This module is free software; you can redistribute it and/or
+# modify it under the same terms as Perl itself.
+
+use strict;
+use warnings;
+use base 'Template::Plugin';
+use CGI qw(:all -utf8);
+
+sub new {
+ my $class = shift;
+ my $context = shift;
+ new CGI(@_);
+}
+
+# monkeypatch CGI::params() method to Do The Right Thing in TT land
+
+sub CGI::params {
+ my $self = shift;
+ local $" = ', ';
+
+ return $self->{ _TT_PARAMS } ||= do {
+ # must call Vars() in a list context to receive
+ # plain list of key/vals rather than a tied hash
+ my $params = { $self->Vars() };
+
+ # convert any null separated values into lists
+ @$params{ keys %$params } = map {
+ /\0/ ? [ split /\0/ ] : $_
+ } values %$params;
+
+ $params;
+ };
+}
+
+1;