FAQ
I can't find where my error is while doing the tutorial.

I make it all the way to end of 06 Authorization and suddenly I get
errors starting with:

Couldn't render template "books/list.tt2: undef error - search_related:
result source 'UserRole' has no such relationship role_id at
/usr/lib/perl5/site_perl/5.8.8/DBIx/Class/Schema.pm line 1071

The only difference is I didn't use the code for encrypted passwords and
did not encrypt them in the database.

This is on a CentOS 5 Linux-vserver guest and as you can see I haven't
put in a newer (more recent) version of Perl.

I have looked to to see if I missed some code and have checked in the
database to make sure test01/mypass is in there.

Here are the results of a recursive grep starting at MyApp looking for
role_id.

lib/MyApp/Schema/Result/User.pm:110:__PACKAGE__->many_to_many(roles =>
'user_roles', 'role_id');
lib/MyApp/Schema/Result/UserRole.pm:32:=head2 role_id
lib/MyApp/Schema/Result/UserRole.pm:43: "role_id",
lib/MyApp/Schema/Result/UserRole.pm:46:__PACKAGE__->set_primary_key("user_id",
"role_id");
lib/MyApp/Schema/Result/UserRole.pm:61: { id => "role_id" },
lib/MyApp/Schema/Result/Role.pm:60: { "foreign.role_id" => "self.id" },
myapp02.sql:21: role_id INTEGER REFERENCES role(id) ON DELETE CASCADE ON
UPDATE CASCADE,
myapp02.sql:22: PRIMARY KEY (user_id, role_id)
Binary file myapp.db matches

Does anything catch your collective eye?

TIA,
Rod
--

Search Discussions

  • John Napiorkowski at Aug 11, 2011 at 2:20 am
    From: Roderick A. Anderson <raanders@cyber-office.net>
    To: The elegant MVC web framework <catalyst@lists.scsys.co.uk>
    Sent: Wednesday, August 10, 2011 7:06 PM
    Subject: [Catalyst] Tutorial woes.

    I can't find where my error is while doing the tutorial.

    I make it all the way to end of 06 Authorization and suddenly I get errors starting with:

    Couldn't render template "books/list.tt2: undef error - search_related: result source 'UserRole' has no such relationship role_id at /usr/lib/perl5/site_perl/5.8.8/DBIx/Class/Schema.pm line 1071

    The only difference is I didn't use the code for encrypted passwords and did not encrypt them in the database.

    This is on a CentOS 5 Linux-vserver guest and as you can see I haven't put in a newer (more recent) version of Perl.

    I have looked to to see if I missed some code and have checked in the database to make sure test01/mypass is in there.

    Here are the results of a recursive grep starting at MyApp looking for role_id.

    lib/MyApp/Schema/Result/User.pm:110:__PACKAGE__->many_to_many(roles => 'user_roles', 'role_id');
    lib/MyApp/Schema/Result/UserRole.pm:32:=head2 role_id
    lib/MyApp/Schema/Result/UserRole.pm:43:? "role_id",
    lib/MyApp/Schema/Result/UserRole.pm:46:__PACKAGE__->set_primary_key("user_id", "role_id");
    lib/MyApp/Schema/Result/UserRole.pm:61:? { id => "role_id" },
    lib/MyApp/Schema/Result/Role.pm:60:? { "foreign.role_id" => "self.id" },
    myapp02.sql:21: role_id INTEGER REFERENCES role(id) ON DELETE CASCADE ON UPDATE CASCADE,
    myapp02.sql:22:? ? ? ? ? ? ? ???PRIMARY KEY (user_id, role_id)
    Binary file myapp.db matches

    Does anything catch your collective eye?
    Can we see your?UserRole result class in its entirety? ?--John
    TIA,
    Rod
    --
    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/

  • Kieren Diment at Aug 11, 2011 at 2:28 am

    On 11/08/2011, at 12:20 PM, John Napiorkowski wrote:

    From: Roderick A. Anderson <raanders@cyber-office.net>
    To: The elegant MVC web framework <catalyst@lists.scsys.co.uk>
    Sent: Wednesday, August 10, 2011 7:06 PM
    Subject: [Catalyst] Tutorial woes.

    I can't find where my error is while doing the tutorial.

    I make it all the way to end of 06 Authorization and suddenly I get errors starting with:
    Did you check that to see if reference implementation for the tutorial works for the stage you're up to of if that's getting the same error? You can get it from:

    svn co http://dev.catalystframework.org/repos/Catalyst/trunk/examples/Tutorial/MyApp_Chapter6
  • Darius Jokilehto at Aug 11, 2011 at 9:01 am

    On 11/08/11 00:06, Roderick A. Anderson wrote:
    I can't find where my error is while doing the tutorial. [snip]
    Here are the results of a recursive grep starting at MyApp looking for
    role_id.

    lib/MyApp/Schema/Result/User.pm:110:__PACKAGE__->many_to_many(roles =>
    'user_roles', 'role_id');
    [snip]
    You probably want:

    __PACKAGE__->many_to_many(roles => 'user_roles', 'role');

    Assuming your belongs_to in Result::User is called 'role', you have to
    use that as your final argument - many-to-many requires its final
    argument to be a relationship, not a column name.

    Darius

    NET-A-PORTER.COM
    Irresistible fashion at your fingertips

    ______________________________________________________________________

    CONFIDENTIALITY NOTICE
    The information in this email is confidential and is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, you must not read, use or disseminate the information. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Net a Porter Ltd.

    Net A Porter Ltd is a company registered in England & Wales Number: 3820604 Registered Office: 1 The Village Offices, Westfield, Ariel Way, London, W12 7GF
    _____________________________________________________________________
  • Roderick A. Anderson at Aug 11, 2011 at 6:10 pm

    Darius Jokilehto wrote:
    On 11/08/11 00:06, Roderick A. Anderson wrote:
    I can't find where my error is while doing the tutorial. [snip]
    Here are the results of a recursive grep starting at MyApp looking for
    role_id.

    lib/MyApp/Schema/Result/User.pm:110:__PACKAGE__->many_to_many(roles =>
    'user_roles', 'role_id');
    [snip]
    You probably want:

    __PACKAGE__->many_to_many(roles => 'user_roles', 'role');
    Bingo! That was it. Looked to make sure I hadn't typed it in wrong and
    didn't. The Tutorial has role_id instead of role.

    There was another message (last year) that mentioned something similar
    but my Catalyst foo is very low so I didn't know how to apply it to my
    situation.


    Thanks,
    Rod
    --
    Assuming your belongs_to in Result::User is called 'role', you have to
    use that as your final argument - many-to-many requires its final
    argument to be a relationship, not a column name.

    Darius

    NET-A-PORTER.COM Irresistible fashion at your fingertips

    ______________________________________________________________________

    CONFIDENTIALITY NOTICE
    The information in this email is confidential and is intended solely for
    the addressee. Access to this email by anyone else is unauthorised. If
    you are not the intended recipient, you must not read, use or
    disseminate the information. Any views expressed in this message are
    those of the individual sender, except where the sender specifically
    states them to be the views of Net a Porter Ltd.
    Net A Porter Ltd is a company registered in England & Wales Number:
    3820604 Registered Office: 1 The Village Offices, Westfield, Ariel Way,
    London, W12 7GF
    _____________________________________________________________________

    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
  • Roderick A. Anderson at Aug 11, 2011 at 6:16 pm

    Darius Jokilehto wrote:
    On 11/08/11 00:06, Roderick A. Anderson wrote:
    I can't find where my error is while doing the tutorial. [snip]
    Here are the results of a recursive grep starting at MyApp looking for
    role_id.

    lib/MyApp/Schema/Result/User.pm:110:__PACKAGE__->many_to_many(roles =>
    'user_roles', 'role_id');
    [snip]
    You probably want:

    __PACKAGE__->many_to_many(roles => 'user_roles', 'role');
    And I now feel even sillier.

    I was looking for a way to report this and found it already has. I
    guess I should read the whole page. Even those parts beneath Tomas'
    smiling face. Finally noticed CPAN RT.


    Rod
    --
    Assuming your belongs_to in Result::User is called 'role', you have to
    use that as your final argument - many-to-many requires its final
    argument to be a relationship, not a column name.

    Darius

    NET-A-PORTER.COM Irresistible fashion at your fingertips

    ______________________________________________________________________

    CONFIDENTIALITY NOTICE
    The information in this email is confidential and is intended solely for
    the addressee. Access to this email by anyone else is unauthorised. If
    you are not the intended recipient, you must not read, use or
    disseminate the information. Any views expressed in this message are
    those of the individual sender, except where the sender specifically
    states them to be the views of Net a Porter Ltd.
    Net A Porter Ltd is a company registered in England & Wales Number:
    3820604 Registered Office: 1 The Village Offices, Westfield, Ariel Way,
    London, W12 7GF
    _____________________________________________________________________

    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedAug 10, '11 at 11:06p
activeAug 11, '11 at 6:16p
posts6
users4
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase