[Catalyst] TT2 + CP::Authentication + DBIC gotcha
apv
apv at sedition.com
Fri Jul 13 08:42:50 GMT 2007
Maybe this is expected behavior (if so, I'd love to know why) and it
may give Aristotle a chance to remind us how awful TT2 is (but I
keed!), still maybe it's something worth noting.
This works:
[% IF Catalyst.user_exists %]
[% vote = Catalyst.user.votes({word => w.id}) %]
[% END %]
[% IF vote %]
You rated this “[% vote.rating %]”
[% END %]
and yields, eg: You rated this "good"
This does not:
[% vote = Catalyst.user.votes({word => w.id}) IF Catalyst.user_exists %]
[% IF vote %]
You rated this “[% vote.rating %]”
[% END %]
and yields for all cases (and columns): You rated this ""
The first properly retrieves and displays the rating. The second
retrieves an empty object (or maybe just a "Class::stringy::thing"?
Dumper does nothing with it) of the proper class without any column
values attached. The only difference in all the versions I tried was
the TT2 logic block versus inline IF.
–Ashley
--
More information about the Catalyst
mailing list