I've just upgraded to Catalyst 5.66 and for some bizarre reason, setting
$c->stash->{template} = 'template' now causes 'template' to be processed
immediately, i.e. before forwarding to the view. This is demonstrated by
controller code similar to the following:

sub edit : Local {
my ( $self, $c ) = @_;
my $resultset = $c->stash->{resultset};
$c->stash->{template} = 'edit';
die 'ok';
$self->SUPER::edit( $c );

And in the template:

WHILE ( item = resultset.next );

I'm using a DBIx::Class based model and use of the
DBIX_CLASS_STORAGE_DBI_DEBUG environment variable reveals (via the test
server's debug output) that an SQL SELECT statement is being run for
each row in the resultset before the die() statement is reached.

The WHERE clause for my resultset is set by $self->SUPER::edit(). In the
above example, the template code is running before the WHERE clause is
set and looping over every record in the resultset's table as a result
(i.e "SELECT * FROM table" as opposed to "SELECT * FROM table WHERE ..." ).

Any ideas as to the cause? The same code did not exhibit this behaviour
prior to the upgrade.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedMar 23, '06 at 9:57a
activeMar 23, '06 at 2:37p

1 user in discussion

Will Hawes: 2 posts



site design / logo © 2021 Grokbase