[Catalyst] Error loading data from schema
Francisco Obispo
fobispo at isc.org
Wed Apr 4 14:44:16 GMT 2012
The error is because $c->model('dbms::ACCOUNT_VIEW') is not defined.
Did you create the view after creating the model? if so, try re-running the create script so it can pick up the changes.
Also, to avoid fatal errors, you should attempt to load the model first, and then send to the template a data structure only if it loads properly.
On Apr 4, 2012, at 7:28 AM, Kenneth S Mclane wrote:
> I am getting the following error: Caught exception in dbms::Controller::AccountView->list "Can't call method "all" on an undefined value at /tmp/catalyst/dbms/script/../lib/dbms/Controller/AccountView.pm line 7."
>
> this is the referenced sub:
>
> sub list : Local {
> my ($self, $c) = @_;
> $c->stash(accounts => $c->model('dbms::ACCOUNT_VIEW')->all);
> $c->stash(template => 'accountview/list.tt2');
> }
>
> I have seen quite a few posts about this error but no real explanations of what is causing the issue. I created a view in the DB containing the data I need to display on the page. The error is occurring at this line: $c->stash(accounts => $c->model('dbms::ACCOUNT_VIEW')->all); which I have tried several different things. If I remove the ->all I get no error and my header row appears. I cannot find anything that tells me specifically what this should be composed of. Any pointers to help figure this out are appreciated.
>
> Regards
>
> _______________________________________________
> List: Catalyst at 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/
Francisco Obispo
email: fobispo at isc.org
Phone: +1 650 423 1374 || INOC-DBA *3557* NOC
PGP KeyID = B38DB1BE
More information about the Catalyst
mailing list