[html-formfu] Getting "need a schema or context" loading config file

Carl Franks fireartist at gmail.com
Sun Apr 12 08:01:57 GMT 2009


2009/4/11 Dennis Daupert <ddaupert at gmail.com>:
> On Sat, Apr 11, 2009 at 3:35 AM, Carl Franks <fireartist at gmail.com> wrote:
>>
>> If, for example, your schema class is "MyApp::MySchema", then you'd call
>>    $c->model("MySchema")
>> to retrieve it.
>>
>> Use that name in your app config, to tell
>> Catalyst-Controller-HTML-FormFu to put it in your form stash.
>> ....
>>
>> If it's Config::General format, I think it would be:
>> <Controller::HTML::FormFu>
>>  <model_stash>
>>    schema MySchema
>>  </model_stash>
>> </Controller::HTML::FormFu>
>>
>> That'll save the model at $form->stash->{schema}
>> so it's available to Model-DBIC
>
> Hi Carl,
>
> Thanks much for the info. After my post, I googled and found a newsgroup
> post that gave the configuration you kindly supplied. But so far, I am
> unable to get that to work. Let me cut and paste a couple items here to make
> sure I've got this straight. The app is a copy of the Catalyst tutorial
> authz code.
>
> The schema file is located here:
> /home/me/MyApp/lib/MyApp/Schema.pm
>
> The app config file is here:
> /home/me/MyApp/myapp.conf
>
> myapp.conf has these lines:
> <Controller::HTML::FormFu>
>     <model_stash>
>         <schema>
>             schema Schema
>         </schema>
>     </model_stash>
> </Controller::HTML::FormFu>
>
> I have tried various incarnations of 'schema Schema,' stopping/starting the
> app in between:
> 'schema Schema'
> 'schema: Schema'
> 'schema MyApp::Schema'
> 'schema: MyApp::Schema'
>
> but I still get the "need a schema or context" error when I try to access
> the form page when the Select is configured. If I take the Select stuff out,
> I get the remainder of the form OK, and I am able otherwise able to talk to
> the database using DBIC machinery.

Is your controller class inheriting from Catalyst::Controller::HTML::FormFu ?
If it were, then options_from_model() should at least be finding the context.

Carl



More information about the HTML-FormFu mailing list