[Catalyst] Not getting passed arguments in $c->user methods

Steve Cayford cayfo001 at umn.edu
Mon Jan 8 23:55:33 GMT 2007


Hi,

I'm fairly new with Catalyst, so please forgive me if this is obvious.

I'm using a DBIx::Class "Person" class for the authentication store.
I've extended this Person class using a custom component. (This is
running on mod_perl 1.29 and Apache 1.3.33 on Debian stable.)

That all works well enough, I can access the class and its methods via
$c->user. However, the methods are not getting any arguments other than
$self.

In a catalyst action I tried this code:

-------

$c->log->info( $c->user->return_arg('first') );

my $user_obj
    = $c->model('MacWebDB::Person')->find( $c->user->person_id() );

$c->log->info( $user_obj->return_arg('second') );

-------

where the return_arg method is added to Person via a component:

-------

package UMN::MAC::DBIx::Person;
use base qw( DBIx::Class );

__PACKAGE__->load_components( qw( Person_Component PK::Auto Core ) );

[...]

package DBIx::Class::Person_Component;
use base qw( DBIx::Class );

sub return_arg {
    my ($self, $arg) = @_;
    return "arg: $arg";
}

1;

-------

Then in the log, I find this:

[info] arg:
[info] arg: second

So in both calls, I'm getting the correct method, but only the second
version receives any arguments.

I'm using the following plugins:

use Catalyst  qw/
                    -Debug
                    ConfigLoader
                    Static::Simple

                    Email

                    HTML::Widget

                    Session
                    Session::Store::FastMmap
                    Session::State::Cookie

                    Authentication
                    Authentication::Store::DBIC
                    Authentication::Credential::Password

                    Authorization::Roles

                /
    ;

Thanks for any suggestions.

-Steve



More information about the Catalyst mailing list