Thread Catalyst + Model::DBIC - Verzweiflung (10 answers)
Opened by Strat at 2006-05-06 01:46

Strat
 2006-05-06 01:58
#28512 #28512
User since
2003-08-04
5246 Artikel
ModeratorIn
[Homepage] [default_avatar]
ich will jetzt also die Datenbank hinzufuegen:
Code: (dl )
script\mypboard_create.pl model PBDB DBIC dbi:mysql:dbname=pboard username password

sieht auch gut aus, und es laeuft noch alles, wenn ich es z.B. mit
Code: (dl )
script\mypboard_server.pl

starte.

Jetzt wuerde ich aber in der sub list gerne die User holen, also in User.pm in der sub hinzugefuegt:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
sub list : Path('/user/list') {
my ($self, $c) = @_;

my $data = $c->model('PBDB')->table('PbUser')
->search( {'order_by' => 'id ASC'} );

my %data = ( template => 'user/list.tmpl',
title => 'Benutzerliste',

navigationfile => 'sub_naviagtion_user.tmpl',
username => 'XXXXXX',
show_images => 1,
userlist => $data,
);

while (my ($k, $v) = each %data) { $c->stash->{$k} = $v }

} # list

da kommt immer
Code: (dl )
Caught exception in MyPBoard::Controller::User->list "Can't call method "search" on an undefined value at E:/web/PBoard_Catalyst/MyPBoard/script/../lib/MyPBoard/Controller/User.pm line 14."

Im Parley-Board wird das so aehnlich gemacht; ich habe gross/kleinschreibung der Tabellen ausprobiert (die Tabelle heisst pb_user), mit Data::Dumper rumgespielt, Catalyst+DBIx-Doku gelesen, aber ich komme nicht dahinter wieso.

Wo mache ich den Bloedsinn?

hier noch der output
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Fri May  5 23:56:14 2006] [catalyst] [info] MyPBoard powered by Catalyst 5.68
ou can connect to your server at http://dahoam:3000
Fri May 5 23:56:16 2006] [catalyst] [debug] **********************************

Fri May 5 23:56:16 2006] [catalyst] [debug] * Request 1 (0.333/s) [748]
Fri May 5 23:56:16 2006] [catalyst] [debug] **********************************

Fri May 5 23:56:16 2006] [catalyst] [debug] "GET" request for "user/list" from
"127.0.0.1"
Fri May 5 23:56:16 2006] [catalyst] [debug] Path is "user/list"
Fri May 5 23:56:16 2006] [catalyst] [debug] Rendering template "user/list"
Fri May 5 23:56:16 2006] [catalyst] [error] Caught exception in MyPBoard::Cont
oller::User->list "Can't call method "search" on an undefined value at E:/web/P
oard_Catalyst/MyPBoard/script/../lib/MyPBoard/Controller/User.pm line 14."
Fri May 5 23:56:16 2006] [catalyst] [error] Caught exception in MyPBoard::View
:HTC->process "'user/list' not found at D:/wamp/Perl815/site/lib/Catalyst/View/
TML/Template/Compiled.pm line 112"
Fri May 5 23:56:16 2006] [catalyst] [info] Request took 0.039157s (25.538/s)
\n\n

<!--EDIT|Strat|1146866764-->
perl -le "s::*erlco'unaty.'.dk':e,y;*kn:ai;penmic;;print"
http://www.fabiani.net/

View full thread Catalyst + Model::DBIC - Verzweiflung