[Catalyst] DBIC puking on relationships from objects within TT2 but not from stash objects

apv apv at sedition.com
Sat Jul 7 05:30:38 GMT 2007


False alarm. I figured it out. Have to prefetch relationships when  
putting the user into the session at login or the goodies just ain't  
in the session info.


–Ashley
-- 


On Jul 6, 2007, at 7:04 PM, apv wrote:

> So, in my template I have this and it works fine if I assign  
> "user," a DBIC object, to the stash from the controller.
>
>  [% user.votes %]
>
> But if I do this to get the user inside the template:
>
>  [% user = Catalyst.session.user %]
>  [% user.votes %]
>
> I get this fatal error:
>
>  Couldn't render template "undef error - Can't call method "source"  
> on an
>  undefined value at /Library/Perl/5.8.6/DBIx/Class/ 
> ResultSourceHandle.pm line 62.
>
> I can get all of user's regular columns fine, like email, username,  
> etc. Just not any of its relationships without the fatal.
>
> Seems like it's not a session specific issue (both FastMmap and  
> File engines fail the same way).
>
> Any ideas?
>




More information about the Catalyst mailing list