[Catalyst] no CDBI iterator in Mason component?

Alan Humphrey alan.humphrey at comcast.net
Thu Apr 21 00:03:43 CEST 2005


I'm returning a CDBI iterator from my Model class.  The iterator works
in that it returns an object.  However, if I try to get a value from the
object I get this error:

[Wed Apr 20 14:54:40 2005] [catalyst] [error] Couldn't render component
"/main" - error was "Can't locate object method "image_file" via package
"bless( {
                 'image_file' => 'images/nobo.jpg',
                 'genus_scientific_name' => 'Colinus',
                 'id' => undef,
                 'species_scientific_name' => 'virginianus',
                 'bird_common_name' => 'Northern Bobwhite'
               }, 'BirdWeb::Admin::M::BirdWebDB::Birds' )
" (perhaps you forgot to load "bless( {
                 'image_file' => 'images/nobo.jpg',
                 'genus_scientific_name' => 'Colinus',
                 'id' => undef,
                 'species_scientific_name' => 'virginianus',
                 'bird_common_name' => 'Northern Bobwhite'
               }, 'BirdWeb::Admin::M::BirdWebDB::Birds' )
"?) at /home/alanh/birdweb/trunk/BirdWeb-Admin/root/main line 17.

The method image_file does exist in the class.

If I return an array of class objects and use them directly then there
is no problem.

Should I give up on using the iterator?

- Alan




More information about the Catalyst mailing list