<font size=2 face="sans-serif">Well it returns &quot;1&quot; when I change
it to that.</font>
<br>
<br><tt><font size=2>Dimitar Petrov &lt;mitakaa@gmail.com&gt; wrote on
05/31/2012 04:00:31 PM:<br>
<br>
&gt; From:</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Dimitar Petrov &lt;mitakaa@gmail.com&gt;</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; To:</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; The elegant MVC web framework &lt;catalyst@lists.scsys.co.uk&gt;</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Date:</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; 05/31/2012 04:02 PM</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Subject:</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Re: [Catalyst] Deep Recusion error</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Hello Kenneth,</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; actually many_to_many helpers are not considered as relationships.
<br>
&gt; It's just a helper.</font></tt>
<br><tt><font size=2>&gt; What are you trying to achieve? Get all roles
for given user? Does <br>
&gt; $c-&gt;model('authdb::User')-&gt;find({username =&gt; $username})-&gt;roles
do the trick?</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Cheers,</font></tt>
<br><tt><font size=2>&gt; Dimitar</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; On Thu, May 31, 2012 at 10:38 PM, Kenneth S Mclane &lt;ksmclane@us.ibm.com<br>
&gt; &gt; wrote:</font></tt>
<br><tt><font size=2>&gt; Ok, I found that the recursion error is happening
when trying to <br>
&gt; store the role in the session. <br>
&gt; <br>
&gt; my $roles = $c-&gt;model('authdb::User')-&gt;find( { 'username' =&gt;
$username }, { <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; prefetch =&gt; 'roles', <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; columns =&gt; 'roles.role', <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; }); <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; #$c-&gt;session(role =&gt; $roles); <br>
&gt; <br>
&gt; When I comment it out the error goes away. I switched back to the
<br>
&gt; above code. I am getting &quot;No such relationship roles on User&quot;
error <br>
&gt; but I have this in my User.pm: <br>
&gt; <br>
&gt; __PACKAGE__-&gt;many_to_many(&quot;roles&quot;, &quot;user_roles&quot;,
&quot;role&quot;); <br>
&gt; <br>
&gt; I do not understand why it refuses to acknowledge it. <br>
&gt; <br>
&gt; Regards </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Kenneth McLane </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; &nbsp;700 Locust St </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Systems Compliance Services </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; &nbsp;Dubuque, 52001-6838 </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; I1OB </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; &nbsp;USA </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; [image removed] </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; GTS Services Delivery </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; &nbsp; </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Phone: </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; +1-563-845-4674 </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; &nbsp; </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Tie-Line: </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; 946-4674 </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; &nbsp; </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Mobile: </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; +1-563-940-7147 </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; &nbsp; </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; e-mail: </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; ksmclane@us.ibm.com </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; &nbsp; </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; &quot;Ideas come from everything&quot; -- Alfred Hitchcock </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; &nbsp; </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; &nbsp;</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; <br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; List: Catalyst@lists.scsys.co.uk<br>
&gt; Listinfo: </font></tt><a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst"><tt><font size=2>http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</font></tt></a><tt><font size=2><br>
&gt; Searchable archive: </font></tt><a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/"><tt><font size=2>http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</font></tt></a><tt><font size=2><br>
&gt; Dev site: </font></tt><a href=http://dev.catalyst.perl.org/><tt><font size=2>http://dev.catalyst.perl.org/</font></tt></a><tt><font size=2><br>
</font></tt>
<br><tt><font size=2>&gt; _______________________________________________<br>
&gt; List: Catalyst@lists.scsys.co.uk<br>
&gt; Listinfo: </font></tt><a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst"><tt><font size=2>http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</font></tt></a><tt><font size=2><br>
&gt; Searchable archive: </font></tt><a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/"><tt><font size=2>http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</font></tt></a><tt><font size=2><br>
&gt; Dev site: </font></tt><a href=http://dev.catalyst.perl.org/><tt><font size=2>http://dev.catalyst.perl.org/</font></tt></a><tt><font size=2><br>
</font></tt>