Skip Menu |

This queue is for tickets about the Catalyst-Manual CPAN distribution.

Report information
The Basics
Id: 57989
Status: resolved
Priority: 0/
Queue: Catalyst-Manual

People
Owner: HKCLARK [...] cpan.org
Requestors: foudil.newbie [...] bigfoot.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 5.8004
Fixed in: (no value)



Subject: wrong many-to-many definition for user -> role
in Catalyst/Manual/Tutorial/05_Authentication.pod#Add_User_and_Role_Information_to_DBIC_Schema: __PACKAGE__->many_to_many(roles => 'user_roles', 'role'); should be: __PACKAGE__->many_to_many(roles => 'user_roles', 'role_id'); with: Catalyst 5.80022 Catalyst::Helper::Model::DBIC::Schema 0.41
From: bitcard93445 [...] rainslide.net
I believe you are incorrect. With __PACKAGE__->many_to_many( roles => 'user_roles', 'role_id' ); I receive this error: 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.12.3/DBIx/Class/ Schema.pm line 1071 With __PACKAGE__->many_to_many( roles => 'user_roles', 'role' ); I receive no error. See the other many_to_many relationships: lib/MyApp/Schema/Result/Book.pm 89:__PACKAGE__->many_to_many( 'authors', 'book_authors', 'author' ); lib/MyApp/Schema/Result/UserRole.pm 84:__PACKAGE__->many_to_many( users => 'user_roles', 'user' ); lib/MyApp/Schema/Result/BookAuthor.pm 84:__PACKAGE__->many_to_many( 'books', 'book_authors', 'book' ); None of them refer to any *_id. Catalyst 5.80032 Catalyst::Helper::Model::DBIC::Schema 0.50
Fixed in pending release (5.9001). Thanks.