From a722f3e3e226a7319f69722de01c06792b3cf2c3 Mon Sep 17 00:00:00 2001 From: edenc Date: Fri, 4 Dec 2009 21:35:06 +0000 Subject: fixed hash deref bug in the base controller --- lib/Reaction/UI/Controller.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Reaction/UI/Controller.pm b/lib/Reaction/UI/Controller.pm index 2d1b843..f428941 100644 --- a/lib/Reaction/UI/Controller.pm +++ b/lib/Reaction/UI/Controller.pm @@ -12,7 +12,7 @@ with 'Catalyst::Component::InstancePerContext'; sub build_per_context_instance { my ($self, $c, @args) = @_; my $class = ref($self) || $self; - my $newself = $class->new($self->_application, {%$self, context => $c, @args}); + my $newself = $class->new($self->_application, {%{$self || {}}, context => $c, @args}); return $newself; } @@ -136,7 +136,7 @@ controller configuration. For example to override the default number of items in a CRUD list action: __PACKAGE__->config( - action => { + action => { list => { ViewPort => { per_page => 50 } }, } ); @@ -160,7 +160,7 @@ TODO: explain how next_action as a scalar gets converted to the redirect arrayre =head2 pop_viewport_to $vp Call L or -L on +L on the C<< $c->stash->{focus_stack} >>. =head2 redirect_to $c, $to, $captures, $args, $attrs @@ -186,7 +186,7 @@ $args if not supplied. =head2 make_context_closure The purpose of this method is to prevent memory leaks. -It weakens the context object, often denoted $c, and passes it as the +It weakens the context object, often denoted $c, and passes it as the first argument to the sub{} that is passed to the make_context_closure method. In other words, @@ -199,7 +199,7 @@ make_context_closure returns sub { $sub_you_gave_it->($weak_c, @_) To further expound up this useful construct consider code written before make_context_closure was created: - on_apply_callback => + on_apply_callback => sub { $self->after_search( $c, @_ ); } -- cgit v1.2.3