[html-formfu] nested params branch

Jonas Alves jonas.alves at gmail.com
Sun Oct 28 13:07:09 GMT 2007


On 28/10/2007, Mario Minati <mario.minati at googlemail.com> wrote:
>
> On Sunday 28 October 2007 02:55:00 Jonas Alves wrote:
> > On 26/10/2007, Carl Franks <fireartist at gmail.com> wrote:
> > > You don't need to use Catalyst::Plugin::NestedParams - it shouldn't
> > > interfere - but it's unnecessary.
> > > - If you're not using Catalyst, don't use CGI::Expand, as this deletes
> > > the original "foo.bar" param names, which will break HTML::FormFu.
> >
> > Hi Carl,
> > If the dotted parameters are required then it wont work with
> > DBIC::Validation or with data coming from a JSON request. It is possible
> to
> > make it work without them? If it is much work maybe Hash::Flatten may
> help.
>
> Hi Jonas,
>
> what are the specific problems?
> Maybe there are intuitive solutions.
>
> Like in the DBIC::Validation case we might find a way to just use the part
> after the last dot to find the according field.
>
> Greets,
> Mario
>


Hi Mario,
The problem in the DBIC::Validation case is that DBIC is deleting all the
dot parameters before FormFu can even see them. Here is the DBIC code from
DBIx::Class::ResultSet:

sub new_result {
  my ($self, $values) =3D @_;
  ...
  my %new =3D (
    %{ $self->_remove_alias($values, $alias) },
    ...
  );

  return $self->result_class->new(\%new);
}

That _remove_alias method is deleting all the dot parameters so my redefined
"new" method in DBIC::Validation::FormFu never gets them.

I can resolve it in my side using Hash::Flatten to recreate the dot
parameters to pass to FormFu, but I thing that that should be handled by
FormFu. That way you can get a CGI::Expand, JSON or YAML structure and pas
it directly to FormFu to be validated.

What do you guys think?

Cheers,
-- =

Jonas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/html-formfu/attachments/20071028/15=
3c2fd9/attachment.htm


More information about the HTML-FormFu mailing list