Subject: | Attribute Methods not Defined |
Date: | Wed, 8 Aug 2007 21:21:02 -0500 |
To: | bug-Catalyst-Model-LDAP [...] rt.cpan.org |
From: | Patrick McDonnell <kc9ddi [...] arrl.net> |
Hello -
In my controller, I have code like this, where the ABEntry model is a
Catalyst-Model-LDAP model, unmodified from whatever the helper script
created:
sub list : Local {
my ( $self, $c ) = @_;
my $mesg = $c->model('ABEntry')->search('(objectClass=someClass)');
$c->stash->{entries} = [$mesg->sorted('cn')];
$c->stash->{template} = 'addressbook/list.tt2';
}
In my TT views, I used to be able to do something like:
<ul>
[% FOREACH entry IN entries %]
<li>[% entry.cn %]</li>
[% END %]
</ul>
Now, that doesn't work, failing with the following error message:
undef error - Can't locate object method Catalyst::Model::LDAP::Entry::cn via
package "Catalyst::Model::LDAP::Entry"
In my TT template, if I replace [% entry.cn %] with [%
entry.get_value('cn') %], the problem is resolved. However, that seems quite
verbose, and it would be nice to have the behavior revert back to the way it
was.
Environment Info:
perl, v5.8.8 built for x86_64-linux-gnu-thread-multi (Debian Etch)
Catalyst::Model::LDAP version 0.15