=head1 METHODS
-=over 4
-
-=item new($c)
+=head2 new($c)
=cut
return $self->NEXT::new( { %{ $self->config }, %{$arguments} } );
}
-# remember to leave blank lines between the consecutive =item's
-# otherwise the pod tools don't recognize the subsequent =items
+=head2 COMPONENT($c)
+
+=cut
+
+sub COMPONENT {
+ my ( $self, $c ) = @_;
+
+ # Temporary fix, some components does not pass context to constructor
+ my $arguments = ( ref( $_[-1] ) eq 'HASH' ) ? $_[-1] : {};
+
+ if ( my $new = $self->NEXT::COMPONENT( $c, $arguments ) ) {
+ return $new;
+ }
+ else {
+ if ( my $new = $self->new( $c, $arguments ) ) {
+ return $new;
+ }
+ else {
+ my $class = ref $self || $self;
+ my $new = { %{ $self->config }, %{$arguments} };
+ return bless $new, $class;
+ }
+ }
+}
+
+# remember to leave blank lines between the consecutive =head2's
+# otherwise the pod tools don't recognize the subsequent =head2s
-=item $c->config
+=head2 $c->config
-=item $c->config($hashref)
+=head2 $c->config($hashref)
-=item $c->config($key, $value, ...)
+=head2 $c->config($key, $value, ...)
=cut
return $self->_config;
}
-=item $c->process()
+=head2 $c->process()
=cut
. " did not override Catalyst::Component::process" );
}
-=back
-
=head1 SEE ALSO
L<Catalyst>, L<Catalyst::Model>, L<Catalyst::View>, L<Catalyst::Controller>.