Try to make a SubRequest not have a shallow copy of the stash
Jose Luis Martinez [Wed, 11 May 2011 07:21:57 +0000 (09:21 +0200)]
This change doesn't do any good because the root cause of the shallow copy is
the way Catalyst::Plugin::SubRequest sets the stash (Via $c->stash, that makes
a shallow copy itself). Don't know of a way to say to Catalyst "use this hashref
as the stash".

lib/Catalyst/View/Component/SubInclude/SubRequest.pm

index 777cb35..a34e4e6 100644 (file)
@@ -77,7 +77,7 @@ has keep_stash => (
 
 sub generate_subinclude {
     my ($self, $c, $path, @params) = @_;
-    my $stash = $self->keep_stash ? { %{ $c->stash } } : {};
+    my $stash = $self->keep_stash ? $c->stash : {};
 
     croak "subincludes through subrequests require Catalyst::Plugin::SubRequest"
         unless $c->can('sub_request');