[Catalyst] "Can't call method "user_is_restorable"

J. Shirley jshirley at gmail.com
Tue Nov 25 21:00:15 GMT 2008


On Tue, Nov 25, 2008 at 12:35 PM, Mark Beihoffer <mbeihoffer at gmail.com> wrote:
> Here is my yml configuration file, which is currently *not* being
> picked up by ConfigLoader, for some reason.
>
> What can I do to get ConfigLoader to pick up this file? I have Debug
> turned on so I can see it's not happening when the test server starts
> up.
>
> ---
> name: TCLegal
> authentication:
>    dbic:
>        # Note this first definition would be the same as setting
>        # __PACKAGE__->config->{authentication}->{dbic}->{user_class}
> = 'TCLegalDB::User'
>        # in lib/TCLegal.pm (IOW, each hash key becomes a "name:" in
> the YAML file).
>        #
>        # This is the model object created by Catalyst::Model::DBIC from your
>        # schema (you created 'TCLegalDB::User' but as the Catalyst startup
>        # debug messages show, it was loaded as
> 'TCLegal::Model::TCLegalDB::User').
>        # NOTE: Omit 'TCLegal::Model' to avoid a component lookup
> issue in Catalyst 5.66
>        user_class: TCLegalDB::User
>        # This is the name of the field in your 'users' table that
> contains the user's name
>        user_field: username
>        # This is the name of the field in your 'users' table that
> contains the password
>        password_field: password
>        # Other options can go here for hashed passwords
>        # Enabled hashed passwords
>        password_type: hashed
>        # Use the SHA-1 hashing algorithm
>        password_hash_type: SHA-1
> authorization:
>    dbic:
>        # This is the model object created by Catalyst::Model::DBIC from your
>        # schema (you created 'TCLegalDB::Role' but as the Catalyst startup
>        # debug messages show, it was loaded as
> 'TCLegal::Model::TCLegalDB::Role').
>        # NOTE: Omit 'TCLegal::Model' to avoid a component lookup
> issue in Catalyst 5.66
>        role_class: TCLegalDB::Role
>        # The name of the field in the 'roles' table that contains the role name
>        role_field: role
>        # The name of the accessor used to map a role to the users who
> have this role
>        # See the has_many() in TCLegalDB/Role.pm
>        role_rel: map_user_role
>        # The name of the field in the user_role table that references the user
>        user_role_user_field: user_id
>
>
>

Your configuration isn't valid, that's why you are getting that error.
 The real error is that you don't have a proper realm configured, so
the file probably is being loaded but since it isn't really valid
configuration (you don't specify the default realm, or the credential
information).

Try removing this from your YAML and put it in your MyApp.pm following
the configuration example at
http://search.cpan.org/~jayk/Catalyst-Plugin-Authentication-0.10008/lib/Catalyst/Plugin/Authentication.pm#CONFIGURATION

After that worry about putting it in YAML format.

-J



More information about the Catalyst mailing list