[html-formfu] Getting knotted with FormFu :-)
Nigel Metheringham
nigel at dotdot.it
Thu Mar 17 16:02:44 GMT 2011
On 17 Mar 2011, at 15:28, Carl Franks wrote:
> On 16 March 2011 20:49, Nigel Metheringham <nigel at dotdot.it> wrote:
>> Problem 1:
>> Populating the options into a set of Selects (would have been done
>> in a DBIC model_config if it was a straight DBIC/FormFu combination).
>> There just isn't a straight analogue of this using the HashRef model.
>>
>> However, I do have for other purposes, a FormFu plugin that populates
>> Selection options from the form stash. That works fine normally...
>> but in this configuration would not work, unless I removed the FormConfig
>> attribute from the catalyst controller and manually got the form object,
>> loaded the config file etc, then ensured the form stash was loaded, then
>> did $form->process. Just adding additional $form->process state to the
>> normal controller did not have that effect
>
> What do you mean "ensured the form stash was loaded"?
> Was is failing under FormConfig because your plugin was expecting data
> in the form stash that wasn't there yet?
Its a side effect really of the Catalyst formfu controller - if you
use its features it tends to have done a process before you get the
form... So there hasn't been a chance to pre-load the form stash.
Maybe there is a different way of looking at this...
You are using custom Plugins - care to share an example?
> If you let us know what state is being maintained, I can probably fix it.
> However, I generally write FormFu plugins where necessary, as
> process() can sometimes be quite expensive, so I'd rather never call
> it twice.
> I would also not rule out there being bugs in Model::HashRef, as there
> doesn't appear to be a great number of tests for it.
I spent a while this morning trying to produce a test set to
reproduce the problem - and you can guess that I can't reproduce
this bug in a smallish test case. I'm wondering if the catalyst
machinery around the code I am using is affecting this. I'll go
back and keep poking at it.
HashRef does look like a good way of bridging the gap when your
db table relations within a form are rather convoluted...
So it will be worth getting it better supported - so will look
at seeing if I can add tests to it.
>>
>> The test warnings are:-
>>
>> t/01use.t ...................................................... 1/3 Couldn't require HTML::FormFu::Element::_Field : "get_error" is not exported by the HTML::FormFu::ObjectUtil module
>
> Ah, this is being caused by an older installation of HTML-FormFu being
> picked up by HTML::FormFu::Preload.
> I've updated Makefile.PL to handle this better - suggesting the user
> deletes the older dist files before continuing.
Ugh - you need to throw away your old (hopefully working) environment
before you can test and upgrade.
Nigel.
--
[ Nigel Metheringham ------------------------------ nigel at dotdot.it ]
[ Ellipsis Intangible Technologies ]
More information about the HTML-FormFu
mailing list