[html-formfu] nested params merged

Carl Franks fireartist at gmail.com
Wed Oct 31 14:55:39 GMT 2007


On 30/10/2007, Jonas Alves <jonas.alves at gmail.com> wrote:
>
> Hi Carl,
> Great work. :)
> May I know if you pretend to implement the validation without the dot
> parameters as I suggested? If not, is it because you don't like it? If
> is because you don't want to wast time on it, will you accept a patch?

Well, I have to admit I don't like the approach DBIC::Validation::FormFu takes.
I feel that it's a bit of an abuse to pass $dbic->create() a complex
data structure that it wouldn't normally handle, particularly when
DBIC is trying to subvert it by stripping keys containing "."

Your argument that we should support deep hash-refs from JSON, etc, is
more persuasive though ;)
So I've added support for this, but with caveats.
If you pass $form->query() or $form->process() an unblessed hash-ref,
it passes it off to HTML::FormFu::FakeQuery to handle.
This means that it won't support file uploads - but that was the case already.

The only tests are in "t/nested/pre_expanded.t" - and it's not
documented either - but hopefully it'll be enough for you to
experiment with.

Carl



More information about the HTML-FormFu mailing list