Skip Menu |

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

Report information
The Basics
Id: 57563
Status: open
Priority: 0/
Queue: Catalyst-View-TD

People
Owner: Nobody in particular
Requestors: matt.follett [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.12
Fixed in: (no value)



Subject: Catalyst::View::TD->render appears to debless parameters
If you call render with a blessed hash as the third parameter an unblessed version of that hash is passed in to the template. I've included a patch to fix this.
Subject: td.patch
137,149c137,146 < my $vars; < if( defined $args and ref $args ) < { < $vars = $args; < } < elsif( $c ) < { < $vars = $c->stash; < } < else < { < $vars = (); < } --- > # The do prevents warnings when $args is undef. > my $vars = { do { > if (ref $args) { > %{ $args } > } elsif ($c) { > %{ $c->stash } > } else { > () > } > } };
Subject: Re: [rt.cpan.org #57563] Catalyst::View::TD->render appears to debless parameters
Date: Mon, 17 May 2010 13:03:49 -0700
To: bug-Catalyst-View-TD [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
On May 17, 2010, at 12:45 PM, Matt Follett via RT wrote: Show quoted text
> If you call render with a blessed hash as the third parameter an > unblessed version of that hash is passed in to the template. I've > included a patch to fix this.
Why would you pass a blessed hash? It's intentional that the values be copied. This is how all the views work, AFAICT. If you want an object, you should pass it as a value in the args, not as the entirety of the args themselves. Or am I missing something subtle about what you're trying to do? Best, David