Skip Menu |
 

This queue is for tickets about the Catalyst-View-Component-SubInclude CPAN distribution.

Report information
The Basics
Id: 48251
Status: resolved
Priority: 0/
Queue: Catalyst-View-Component-SubInclude

People
Owner: nilsonsfj [...] cpan.org
Requestors: kane [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.06
Fixed in: 0.07



Subject: subrequest backend brekas for paths that have an :Args attribute
Download (untitled) / with headers
text/plain 1.1k
Here's 2 invocations to subrequest; 1 direct, 1 as the subinclude backend: ### direct $ctx->sub_request('/api/esi/site/header.tt', {}, { data => 44 }); ### via subinclude my $sub = $ctx->{'stash'}->{'subinclude'}; my $snippet = $sub->( '/api/esi', qw[site header.tt], { data => 44 } ); The latter breaks by appending the qw[site header.tt] to the arguments passed to ->uri_for. Here's the monkey patch jayk suggested which fixed it (but perhaps in the wrong spot, or with side effects): sub generate_subinclude { my ($class, $c, $path, @params) = @_; my $stash = {}; croak "subincludes through subrequests require Catalyst::Plugin::SubRequest" unless $c->can('sub_request'); my $args = ref $params[0] eq 'ARRAY' ? shift @params : []; my $dispatcher = $c->dispatcher; my ($action) = $dispatcher->_invoke_as_path( $c, $path, $args ); my $uri = $c->uri_for( $action, $args, @params ); ### XXX changes from here on down my $queryparams = {}; if (ref $params[$#params] ) { $queryparams = pop @params; } $c->sub_request( $uri->path, $stash, $queryparams ); }


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.