CC: | "Anthony Gladdish" <a.j.gladdish [...] newcastle.ac.uk> |
Subject: | View doesn't load config from application config |
Date: | Tue, 13 Mar 2007 16:39:59 -0000 |
To: | <bug-Catalyst-View-Mason [...] rt.cpan.org> |
From: | "Carl Vincent" <c.a.vincent [...] newcastle.ac.uk> |
Catalyst-View-Mason doesn't seem to load config data (such as comp_root
and data_dir) from the main application config - this makes it a pain to
deploy apps written with this view.
Debugging the latest version 0.08, it seems when the call NEXT::new is
made, it doesn't have the config added in, even though it's passed.
I've had success with the following changes. Hope they help.
Regards
Carl (IRC: CaptainCarlos)
--- /lib/perl5/site_perl/5.8.8/Catalyst/View/Mason.pm 2007-03-09
11:25:50.000000000 +0000
+++ Mason.pm 2007-03-13 14:48:35.000000000 +0000
@@ -1,9 +1,9 @@
package Catalyst::View::Mason;
use strict;
-use base qw/Catalyst::Base/;
+use base qw/Catalyst::View/;
use HTML::Mason;
use NEXT;
our $VERSION = '0.08';
@@ -72,18 +72,20 @@
=cut
sub new {
my $self = shift;
my $c = shift;
+ my $config = shift;
- $self = $self->NEXT::new(@_);
+ $self = $self->NEXT::new($c,$config);
$self->{output} = '';
my %config = (
comp_root => ( $c->config->{root} . '' ),
data_dir => '/tmp',
%{ $self->config() },
+ %{ $config },
out_method => \$self->{output},
);
$self->template(
HTML::Mason::Interp->new(