Skip Menu |

This queue is for tickets about the Dancer-Plugin-DataFu CPAN distribution.

Report information
The Basics
Id: 69303
Status: open
Priority: 0/
Queue: Dancer-Plugin-DataFu

People
Owner: Nobody in particular
Requestors: jwieland [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Validation not writing error to field error element
Date: Tue, 5 Jul 2011 21:43:58 -0700
To: bug-Dancer-Plugin-DataFu [...] rt.cpan.org
From: Jason Wieland <jwieland [...] gmail.com>
DataFu validate returns correctly when checking the validation on field. However it does not fill in the form->fields->errors array. If I do a Dumper in the validation sub it looks like it sets it correctly.. EG. [18032] debug @0.015249> [hit #1]bless( { Show quoted text
> errors => [ > "Check Email" > ], > fields => { > "contact.comment" => { > element => { > type => "textarea" > }, > errors => [], > filters => [], > label => "Comment", > required => 1, > validation => sub { > package Oogly; > use warnings; > use strict 'refs'; > 0; > } > }, > "contact.email" => { > element => { > type => "input_text" > }, > error => "Check Email", > errors => [ > "Check Email" > ], > filters => [], > label => "Email", > name => "contact.email", > required => 1, > validation => sub { > package Dancer::Plugin::DataFu::Form; > use warnings; > use strict 'refs'; > my($self, $field, $params) = @_; > unless ('Email::Valid'->address($$field{'value'})) { > debug('******* Bad Email **************'); > $self->error($field, $$field{'error'}); > debug(Dumper($self)); > return $self; > } > }, > value => "d" > }, > "contact.name" => { > element => { > type => "input_text" > }, > errors => [], > filters => [], > label => "Name", > required => 1, > validation => $VAR1->{fields}{"contact.comment"}{validation} > } > }, > mixins => {}, > params => { > "contact.comment" => "", > "contact.email" => "d", > "contact.name" => "ddsa", > splat => [ > "138292989520660" > ] > } > }, 'Oogly::Instance::7REGG' ) in (eval 1022) l. 28
However if I dump the form after it returns to my Dancer routine the errors array is magically absent 'data' => bless( { Show quoted text
> 'params' => { > 'contact.name' => > 'ddsa', > 'splat' => [ > > '138292989520660' > ], > 'contact.email' => 'd', > 'contact.comment' => '' > }, > 'errors' => [], > 'mixins' => {}, > 'fields' => { > 'contact.name' => { > > 'errors' => [], > > 'required' => 1, > > 'filters' => [], > > 'validation' => sub { "DUMMY" }, > > 'label' => 'Name', > > 'element' => { > > 'type' => 'input_text' > > } > }, > 'contact.email' => { > > 'errors' => [], > > 'required' => 1, > > 'error' => 'Check Email', > > 'filters' => [], > > 'validation' => sub { "DUMMY" }, > > 'label' => 'Email', > > 'element' => { > > 'type' => 'input_text' > > } > }, > 'contact.comment' => { > > 'errors' => [], > > 'required' => 1, > > 'filters' => [], > > 'validation' => $form->{'data'}{'fields'}{'contact.name'}{'validation'}, > > 'label' => 'Comment', > > 'element' => { > > 'type' => 'textarea' > > } > } > } > }, 'Oogly::Instance::1HQCM' ), > 'settings' => { > 'grid' => { > 'profiles' => 'profiles/table' > }, > 'form' => { > 'profiles' => 'profiles', > 'templates' => 'views/datafu' > } > }, > 'templates' => { > 'table' => 'table.tt', > 'input_checkbox' => 'input_checkbox.tt', > 'form' => 'form.tt', > 'directory' => > '/home/jason/Workspace/12engines/12engines-service/views/datafu', > 'thead' => 'thead.tt', > 'trow' => 'trow.tt', > 'input_password' => 'input_password.tt', > 'input_radio' => 'input_radio.tt', > 'input_text' => 'input_text.tt', > 'theader' => 'theader.tt', > 'select_multiple' => 'select_multiple.tt > ', > 'select' => 'select.tt', > 'input_hidden' => 'input_hidden.tt', > 'tnavigation' => 'tnavigation.tt', > 'input_file' => 'input_file.tt', > 'tdata' => 'tdata.tt', > 'textarea' => 'textarea.tt' > }, > 'profiles' => [ > > '/home/jason/Workspace/12engines/12engines-service/profiles/contact.pl' > ] > }, 'Dancer::Plugin::DataFu::Form' ); in > /home/jason/Workspace/12engines/12engines-service/lib/service.pm l. 159
Any assistance is appreciated.

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #69303] Validation not writing error to field error element
Date: Thu, 7 Jul 2011 10:48:11 -0400
To: bug-Dancer-Plugin-DataFu [...] rt.cpan.org
From: Al Newkirk <awnstudio [...] gmail.com>
thank you for your discovery, I will look into it and get back to you asap. Do you have an IM? On Jul 6, 2011 12:44 AM, "Jason Wieland via RT" < bug-Dancer-Plugin-DataFu@rt.cpan.org> wrote: Show quoted text
> Wed Jul 06 00:44:10 2011: Request 69303 was acted upon. > Transaction: Ticket created by jwieland@gmail.com > Queue: Dancer-Plugin-DataFu > Subject: Validation not writing error to field error element > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: jwieland@gmail.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=69303 > > > > DataFu validate returns correctly when checking the validation on field. > However it does not fill in the form->fields->errors array. > > If I do a Dumper in the validation sub it looks like it sets it
correctly.. Show quoted text
> EG. > > [18032] debug @0.015249> [hit #1]bless( {
>> errors => [ >> "Check Email" >> ], >> fields => { >> "contact.comment" => { >> element => { >> type => "textarea" >> }, >> errors => [], >> filters => [], >> label => "Comment", >> required => 1, >> validation => sub { >> package Oogly; >> use warnings; >> use strict 'refs'; >> 0; >> } >> }, >> "contact.email" => { >> element => { >> type => "input_text" >> }, >> error => "Check Email", >> errors => [ >> "Check Email" >> ], >> filters => [], >> label => "Email", >> name => "contact.email", >> required => 1, >> validation => sub { >> package Dancer::Plugin::DataFu::Form; >> use warnings; >> use strict 'refs'; >> my($self, $field, $params) = @_; >> unless ('Email::Valid'->address($$field{'value'})) { >> debug('******* Bad Email **************'); >> $self->error($field, $$field{'error'}); >> debug(Dumper($self)); >> return $self; >> } >> }, >> value => "d" >> }, >> "contact.name" => { >> element => { >> type => "input_text" >> }, >> errors => [], >> filters => [], >> label => "Name", >> required => 1, >> validation => $VAR1->{fields}{"contact.comment"}{validation} >> } >> }, >> mixins => {}, >> params => { >> "contact.comment" => "", >> "contact.email" => "d", >> "contact.name" => "ddsa", >> splat => [ >> "138292989520660" >> ] >> } >> }, 'Oogly::Instance::7REGG' ) in (eval 1022) l. 28
> > > > However if I dump the form after it returns to my Dancer routine the
errors Show quoted text
> array is magically absent > > 'data' => bless( {
>> 'params' => { >> 'contact.name' => >> 'ddsa', >> 'splat' => [ >> >> '138292989520660' >> ], >> 'contact.email' => 'd', >> 'contact.comment' => '' >> }, >> 'errors' => [], >> 'mixins' => {}, >> 'fields' => { >> 'contact.name' => { >> >> 'errors' => [], >> >> 'required' => 1, >> >> 'filters' => [], >> >> 'validation' => sub { "DUMMY" }, >> >> 'label' => 'Name', >> >> 'element' => { >> >> 'type' => 'input_text' >> >> } >> }, >> 'contact.email' => { >> >> 'errors' => [], >> >> 'required' => 1, >> >> 'error' => 'Check Email', >> >> 'filters' => [], >> >> 'validation' => sub { "DUMMY" }, >> >> 'label' => 'Email', >> >> 'element' => { >> >> 'type' => 'input_text' >> >> } >> }, >> 'contact.comment' => { >> >> 'errors' => [], >> >> 'required' => 1, >> >> 'filters' => [], >> >> 'validation' => $form->{'data'}{'fields'}{'contact.name'}{'validation'}, >> >> 'label' => 'Comment', >> >> 'element' => { >> >> 'type' => 'textarea' >> >> } >> } >> } >> }, 'Oogly::Instance::1HQCM' ), >> 'settings' => { >> 'grid' => { >> 'profiles' => 'profiles/table' >> }, >> 'form' => { >> 'profiles' => 'profiles', >> 'templates' => 'views/datafu' >> } >> }, >> 'templates' => { >> 'table' => 'table.tt', >> 'input_checkbox' => 'input_checkbox.tt', >> 'form' => 'form.tt', >> 'directory' => >> '/home/jason/Workspace/12engines/12engines-service/views/datafu', >> 'thead' => 'thead.tt', >> 'trow' => 'trow.tt', >> 'input_password' => 'input_password.tt', >> 'input_radio' => 'input_radio.tt', >> 'input_text' => 'input_text.tt', >> 'theader' => 'theader.tt', >> 'select_multiple' => 'select_multiple.tt >> ', >> 'select' => 'select.tt', >> 'input_hidden' => 'input_hidden.tt', >> 'tnavigation' => 'tnavigation.tt', >> 'input_file' => 'input_file.tt', >> 'tdata' => 'tdata.tt', >> 'textarea' => 'textarea.tt' >> }, >> 'profiles' => [ >> >> '/home/jason/Workspace/12engines/12engines-service/profiles/contact.pl' >> ] >> }, 'Dancer::Plugin::DataFu::Form' ); in >> /home/jason/Workspace/12engines/12engines-service/lib/service.pm l. 159
> > > > Any assistance is appreciated. >
Subject: Re: [rt.cpan.org #69303] Validation not writing error to field error element
Date: Thu, 7 Jul 2011 08:02:58 -0700
To: bug-Dancer-Plugin-DataFu [...] rt.cpan.org
From: Jason Wieland <jwieland [...] gmail.com>
Thanks for looking into this. Available for chat at jwieland@gmail.com(xmpp/jabber) Jason On Thu, Jul 7, 2011 at 7:48 AM, Al Newkirk via RT < bug-Dancer-Plugin-DataFu@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=69303 > > > thank you for your discovery, I will look into it and get back to you asap. > Do you have an IM? > On Jul 6, 2011 12:44 AM, "Jason Wieland via RT" < > bug-Dancer-Plugin-DataFu@rt.cpan.org> wrote:
> > Wed Jul 06 00:44:10 2011: Request 69303 was acted upon. > > Transaction: Ticket created by jwieland@gmail.com > > Queue: Dancer-Plugin-DataFu > > Subject: Validation not writing error to field error element > > Broken in: (no value) > > Severity: (no value) > > Owner: Nobody > > Requestors: jwieland@gmail.com > > Status: new > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=69303 > > > > > > > DataFu validate returns correctly when checking the validation on field. > > However it does not fill in the form->fields->errors array. > > > > If I do a Dumper in the validation sub it looks like it sets it
> correctly..
> > EG. > > > > [18032] debug @0.015249> [hit #1]bless( {
> >> errors => [ > >> "Check Email" > >> ], > >> fields => { > >> "contact.comment" => { > >> element => { > >> type => "textarea" > >> }, > >> errors => [], > >> filters => [], > >> label => "Comment", > >> required => 1, > >> validation => sub { > >> package Oogly; > >> use warnings; > >> use strict 'refs'; > >> 0; > >> } > >> }, > >> "contact.email" => { > >> element => { > >> type => "input_text" > >> }, > >> error => "Check Email", > >> errors => [ > >> "Check Email" > >> ], > >> filters => [], > >> label => "Email", > >> name => "contact.email", > >> required => 1, > >> validation => sub { > >> package Dancer::Plugin::DataFu::Form; > >> use warnings; > >> use strict 'refs'; > >> my($self, $field, $params) = @_; > >> unless ('Email::Valid'->address($$field{'value'})) { > >> debug('******* Bad Email **************'); > >> $self->error($field, $$field{'error'}); > >> debug(Dumper($self)); > >> return $self; > >> } > >> }, > >> value => "d" > >> }, > >> "contact.name" => { > >> element => { > >> type => "input_text" > >> }, > >> errors => [], > >> filters => [], > >> label => "Name", > >> required => 1, > >> validation => $VAR1->{fields}{"contact.comment"}{validation} > >> } > >> }, > >> mixins => {}, > >> params => { > >> "contact.comment" => "", > >> "contact.email" => "d", > >> "contact.name" => "ddsa", > >> splat => [ > >> "138292989520660" > >> ] > >> } > >> }, 'Oogly::Instance::7REGG' ) in (eval 1022) l. 28
> > > > > > > > However if I dump the form after it returns to my Dancer routine the
> errors
> > array is magically absent > > > > 'data' => bless( {
> >> 'params' => { > >> 'contact.name' => > >> 'ddsa', > >> 'splat' => [ > >> > >> '138292989520660' > >> ], > >> 'contact.email' => 'd', > >> 'contact.comment' => '' > >> }, > >> 'errors' => [], > >> 'mixins' => {}, > >> 'fields' => { > >> 'contact.name' => { > >> > >> 'errors' => [], > >> > >> 'required' => 1, > >> > >> 'filters' => [], > >> > >> 'validation' => sub { "DUMMY" }, > >> > >> 'label' => 'Name', > >> > >> 'element' => { > >> > >> 'type' => 'input_text' > >> > >> } > >> }, > >> 'contact.email' => { > >> > >> 'errors' => [], > >> > >> 'required' => 1, > >> > >> 'error' => 'Check Email', > >> > >> 'filters' => [], > >> > >> 'validation' => sub { "DUMMY" }, > >> > >> 'label' => 'Email', > >> > >> 'element' => { > >> > >> 'type' => 'input_text' > >> > >> } > >> }, > >> 'contact.comment' => { > >> > >> 'errors' => [], > >> > >> 'required' => 1, > >> > >> 'filters' => [], > >> > >> 'validation' => $form->{'data'}{'fields'}{'contact.name
> '}{'validation'},
> >> > >> 'label' => 'Comment', > >> > >> 'element' => { > >> > >> 'type' => 'textarea' > >> > >> } > >> } > >> } > >> }, 'Oogly::Instance::1HQCM' ), > >> 'settings' => { > >> 'grid' => { > >> 'profiles' => 'profiles/table' > >> }, > >> 'form' => { > >> 'profiles' => 'profiles', > >> 'templates' => 'views/datafu' > >> } > >> }, > >> 'templates' => { > >> 'table' => 'table.tt', > >> 'input_checkbox' => 'input_checkbox.tt', > >> 'form' => 'form.tt', > >> 'directory' => > >> '/home/jason/Workspace/12engines/12engines-service/views/datafu', > >> 'thead' => 'thead.tt', > >> 'trow' => 'trow.tt', > >> 'input_password' => 'input_password.tt', > >> 'input_radio' => 'input_radio.tt', > >> 'input_text' => 'input_text.tt', > >> 'theader' => 'theader.tt', > >> 'select_multiple' => 'select_multiple.tt > >> ', > >> 'select' => 'select.tt', > >> 'input_hidden' => 'input_hidden.tt', > >> 'tnavigation' => 'tnavigation.tt', > >> 'input_file' => 'input_file.tt', > >> 'tdata' => 'tdata.tt', > >> 'textarea' => 'textarea.tt' > >> }, > >> 'profiles' => [ > >> > >> '/home/jason/Workspace/12engines/12engines-service/profiles/contact.pl' > >> ] > >> }, 'Dancer::Plugin::DataFu::Form' ); in > >> /home/jason/Workspace/12engines/12engines-service/lib/service.pm l. 159
> > > > > > > > Any assistance is appreciated. > >
> >
Subject: Re: [rt.cpan.org #69303] Validation not writing error to field error element
Date: Sun, 17 Jul 2011 00:09:56 -0700
To: bug-Dancer-Plugin-DataFu [...] rt.cpan.org, DataFu [...] rt.cpan.org
From: Jason Wieland <jwieland [...] gmail.com>
How this coming along? Were you able to reproduce the error? jason On Thu, Jul 7, 2011 at 8:02 AM, Jason Wieland <jwieland@gmail.com> wrote: Show quoted text
> Thanks for looking into this. Available for chat at jwieland@gmail.com(xmpp/jabber) > > Jason > > > On Thu, Jul 7, 2011 at 7:48 AM, Al Newkirk via RT < > bug-Dancer-Plugin-DataFu@rt.cpan.org> wrote: >
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=69303 > >> >> thank you for your discovery, I will look into it and get back to you >> asap. >> Do you have an IM? >> On Jul 6, 2011 12:44 AM, "Jason Wieland via RT" < >> bug-Dancer-Plugin-DataFu@rt.cpan.org> wrote:
>> > Wed Jul 06 00:44:10 2011: Request 69303 was acted upon. >> > Transaction: Ticket created by jwieland@gmail.com >> > Queue: Dancer-Plugin-DataFu >> > Subject: Validation not writing error to field error element >> > Broken in: (no value) >> > Severity: (no value) >> > Owner: Nobody >> > Requestors: jwieland@gmail.com >> > Status: new >> > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=69303 > >> > >> > >> > DataFu validate returns correctly when checking the validation on field. >> > However it does not fill in the form->fields->errors array. >> > >> > If I do a Dumper in the validation sub it looks like it sets it
>> correctly..
>> > EG. >> > >> > [18032] debug @0.015249> [hit #1]bless( {
>> >> errors => [ >> >> "Check Email" >> >> ], >> >> fields => { >> >> "contact.comment" => { >> >> element => { >> >> type => "textarea" >> >> }, >> >> errors => [], >> >> filters => [], >> >> label => "Comment", >> >> required => 1, >> >> validation => sub { >> >> package Oogly; >> >> use warnings; >> >> use strict 'refs'; >> >> 0; >> >> } >> >> }, >> >> "contact.email" => { >> >> element => { >> >> type => "input_text" >> >> }, >> >> error => "Check Email", >> >> errors => [ >> >> "Check Email" >> >> ], >> >> filters => [], >> >> label => "Email", >> >> name => "contact.email", >> >> required => 1, >> >> validation => sub { >> >> package Dancer::Plugin::DataFu::Form; >> >> use warnings; >> >> use strict 'refs'; >> >> my($self, $field, $params) = @_; >> >> unless ('Email::Valid'->address($$field{'value'})) { >> >> debug('******* Bad Email **************'); >> >> $self->error($field, $$field{'error'}); >> >> debug(Dumper($self)); >> >> return $self; >> >> } >> >> }, >> >> value => "d" >> >> }, >> >> "contact.name" => { >> >> element => { >> >> type => "input_text" >> >> }, >> >> errors => [], >> >> filters => [], >> >> label => "Name", >> >> required => 1, >> >> validation => $VAR1->{fields}{"contact.comment"}{validation} >> >> } >> >> }, >> >> mixins => {}, >> >> params => { >> >> "contact.comment" => "", >> >> "contact.email" => "d", >> >> "contact.name" => "ddsa", >> >> splat => [ >> >> "138292989520660" >> >> ] >> >> } >> >> }, 'Oogly::Instance::7REGG' ) in (eval 1022) l. 28
>> > >> > >> > >> > However if I dump the form after it returns to my Dancer routine the
>> errors
>> > array is magically absent >> > >> > 'data' => bless( {
>> >> 'params' => { >> >> 'contact.name' => >> >> 'ddsa', >> >> 'splat' => [ >> >> >> >> '138292989520660' >> >> ], >> >> 'contact.email' => 'd', >> >> 'contact.comment' => '' >> >> }, >> >> 'errors' => [], >> >> 'mixins' => {}, >> >> 'fields' => { >> >> 'contact.name' => { >> >> >> >> 'errors' => [], >> >> >> >> 'required' => 1, >> >> >> >> 'filters' => [], >> >> >> >> 'validation' => sub { "DUMMY" }, >> >> >> >> 'label' => 'Name', >> >> >> >> 'element' => { >> >> >> >> 'type' => 'input_text' >> >> >> >> } >> >> }, >> >> 'contact.email' => { >> >> >> >> 'errors' => [], >> >> >> >> 'required' => 1, >> >> >> >> 'error' => 'Check Email', >> >> >> >> 'filters' => [], >> >> >> >> 'validation' => sub { "DUMMY" }, >> >> >> >> 'label' => 'Email', >> >> >> >> 'element' => { >> >> >> >> 'type' => 'input_text' >> >> >> >> } >> >> }, >> >> 'contact.comment' => { >> >> >> >> 'errors' => [], >> >> >> >> 'required' => 1, >> >> >> >> 'filters' => [], >> >> >> >> 'validation' => $form->{'data'}{'fields'}{'contact.name
>> '}{'validation'},
>> >> >> >> 'label' => 'Comment', >> >> >> >> 'element' => { >> >> >> >> 'type' => 'textarea' >> >> >> >> } >> >> } >> >> } >> >> }, 'Oogly::Instance::1HQCM' ), >> >> 'settings' => { >> >> 'grid' => { >> >> 'profiles' => 'profiles/table' >> >> }, >> >> 'form' => { >> >> 'profiles' => 'profiles', >> >> 'templates' => 'views/datafu' >> >> } >> >> }, >> >> 'templates' => { >> >> 'table' => 'table.tt', >> >> 'input_checkbox' => 'input_checkbox.tt', >> >> 'form' => 'form.tt', >> >> 'directory' => >> >> '/home/jason/Workspace/12engines/12engines-service/views/datafu', >> >> 'thead' => 'thead.tt', >> >> 'trow' => 'trow.tt', >> >> 'input_password' => 'input_password.tt', >> >> 'input_radio' => 'input_radio.tt', >> >> 'input_text' => 'input_text.tt', >> >> 'theader' => 'theader.tt', >> >> 'select_multiple' => 'select_multiple.tt >> >> ', >> >> 'select' => 'select.tt', >> >> 'input_hidden' => 'input_hidden.tt', >> >> 'tnavigation' => 'tnavigation.tt', >> >> 'input_file' => 'input_file.tt', >> >> 'tdata' => 'tdata.tt', >> >> 'textarea' => 'textarea.tt' >> >> }, >> >> 'profiles' => [ >> >> >> >> '/home/jason/Workspace/12engines/12engines-service/profiles/contact.pl
>> '
>> >> ] >> >> }, 'Dancer::Plugin::DataFu::Form' ); in >> >> /home/jason/Workspace/12engines/12engines-service/lib/service.pm l.
>> 159
>> > >> > >> > >> > Any assistance is appreciated. >> >
>> >>
>
Subject: Re: [rt.cpan.org #69303] Validation not writing error to field error element
Date: Fri, 22 Jul 2011 21:36:43 -0400
To: bug-Dancer-Plugin-DataFu [...] rt.cpan.org
From: "Al Newkirk & Associates" <we [...] ana.im>
Thanks for your interested and kind words. I am currently looking for someone to take over the project if you're interested? On Sun, Jul 17, 2011 at 3:10 AM, Jason Wieland via RT < bug-Dancer-Plugin-DataFu@rt.cpan.org> wrote: Show quoted text
> Queue: Dancer-Plugin-DataFu > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=69303 > > > How this coming along? Were you able to reproduce the error? > > jason > > On Thu, Jul 7, 2011 at 8:02 AM, Jason Wieland <jwieland@gmail.com> wrote: >
> > Thanks for looking into this. Available for chat at jwieland@gmail.com
> (xmpp/jabber)
> > > > Jason > > > > > > On Thu, Jul 7, 2011 at 7:48 AM, Al Newkirk via RT < > > bug-Dancer-Plugin-DataFu@rt.cpan.org> wrote: > >
> >> <URL: https://rt.cpan.org/Ticket/Display.html?id=69303 > > >> > >> thank you for your discovery, I will look into it and get back to you > >> asap. > >> Do you have an IM? > >> On Jul 6, 2011 12:44 AM, "Jason Wieland via RT" < > >> bug-Dancer-Plugin-DataFu@rt.cpan.org> wrote:
> >> > Wed Jul 06 00:44:10 2011: Request 69303 was acted upon. > >> > Transaction: Ticket created by jwieland@gmail.com > >> > Queue: Dancer-Plugin-DataFu > >> > Subject: Validation not writing error to field error element > >> > Broken in: (no value) > >> > Severity: (no value) > >> > Owner: Nobody > >> > Requestors: jwieland@gmail.com > >> > Status: new > >> > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=69303 > > >> > > >> > > >> > DataFu validate returns correctly when checking the validation on
> field.
> >> > However it does not fill in the form->fields->errors array. > >> > > >> > If I do a Dumper in the validation sub it looks like it sets it
> >> correctly..
> >> > EG. > >> > > >> > [18032] debug @0.015249> [hit #1]bless( {
> >> >> errors => [ > >> >> "Check Email" > >> >> ], > >> >> fields => { > >> >> "contact.comment" => { > >> >> element => { > >> >> type => "textarea" > >> >> }, > >> >> errors => [], > >> >> filters => [], > >> >> label => "Comment", > >> >> required => 1, > >> >> validation => sub { > >> >> package Oogly; > >> >> use warnings; > >> >> use strict 'refs'; > >> >> 0; > >> >> } > >> >> }, > >> >> "contact.email" => { > >> >> element => { > >> >> type => "input_text" > >> >> }, > >> >> error => "Check Email", > >> >> errors => [ > >> >> "Check Email" > >> >> ], > >> >> filters => [], > >> >> label => "Email", > >> >> name => "contact.email", > >> >> required => 1, > >> >> validation => sub { > >> >> package Dancer::Plugin::DataFu::Form; > >> >> use warnings; > >> >> use strict 'refs'; > >> >> my($self, $field, $params) = @_; > >> >> unless ('Email::Valid'->address($$field{'value'})) { > >> >> debug('******* Bad Email **************'); > >> >> $self->error($field, $$field{'error'}); > >> >> debug(Dumper($self)); > >> >> return $self; > >> >> } > >> >> }, > >> >> value => "d" > >> >> }, > >> >> "contact.name" => { > >> >> element => { > >> >> type => "input_text" > >> >> }, > >> >> errors => [], > >> >> filters => [], > >> >> label => "Name", > >> >> required => 1, > >> >> validation => $VAR1->{fields}{"contact.comment"}{validation} > >> >> } > >> >> }, > >> >> mixins => {}, > >> >> params => { > >> >> "contact.comment" => "", > >> >> "contact.email" => "d", > >> >> "contact.name" => "ddsa", > >> >> splat => [ > >> >> "138292989520660" > >> >> ] > >> >> } > >> >> }, 'Oogly::Instance::7REGG' ) in (eval 1022) l. 28
> >> > > >> > > >> > > >> > However if I dump the form after it returns to my Dancer routine the
> >> errors
> >> > array is magically absent > >> > > >> > 'data' => bless( {
> >> >> 'params' => { > >> >> 'contact.name' => > >> >> 'ddsa', > >> >> 'splat' => [ > >> >> > >> >> '138292989520660' > >> >> ], > >> >> 'contact.email' => 'd', > >> >> 'contact.comment' => '' > >> >> }, > >> >> 'errors' => [], > >> >> 'mixins' => {}, > >> >> 'fields' => { > >> >> 'contact.name' => { > >> >> > >> >> 'errors' => [], > >> >> > >> >> 'required' => 1, > >> >> > >> >> 'filters' => [], > >> >> > >> >> 'validation' => sub { "DUMMY" }, > >> >> > >> >> 'label' => 'Name', > >> >> > >> >> 'element' => { > >> >> > >> >> 'type' => 'input_text' > >> >> > >> >> } > >> >> }, > >> >> 'contact.email' => { > >> >> > >> >> 'errors' => [], > >> >> > >> >> 'required' => 1, > >> >> > >> >> 'error' => 'Check Email', > >> >> > >> >> 'filters' => [], > >> >> > >> >> 'validation' => sub { "DUMMY" }, > >> >> > >> >> 'label' => 'Email', > >> >> > >> >> 'element' => { > >> >> > >> >> 'type' => 'input_text' > >> >> > >> >> } > >> >> }, > >> >> 'contact.comment' => { > >> >> > >> >> 'errors' => [], > >> >> > >> >> 'required' => 1, > >> >> > >> >> 'filters' => [], > >> >> > >> >> 'validation' => $form->{'data'}{'fields'}{'contact.name
> >> '}{'validation'},
> >> >> > >> >> 'label' => 'Comment', > >> >> > >> >> 'element' => { > >> >> > >> >> 'type' => 'textarea' > >> >> > >> >> } > >> >> } > >> >> } > >> >> }, 'Oogly::Instance::1HQCM' ), > >> >> 'settings' => { > >> >> 'grid' => { > >> >> 'profiles' => 'profiles/table' > >> >> }, > >> >> 'form' => { > >> >> 'profiles' => 'profiles', > >> >> 'templates' => 'views/datafu' > >> >> } > >> >> }, > >> >> 'templates' => { > >> >> 'table' => 'table.tt', > >> >> 'input_checkbox' => 'input_checkbox.tt', > >> >> 'form' => 'form.tt', > >> >> 'directory' => > >> >> '/home/jason/Workspace/12engines/12engines-service/views/datafu', > >> >> 'thead' => 'thead.tt', > >> >> 'trow' => 'trow.tt', > >> >> 'input_password' => 'input_password.tt', > >> >> 'input_radio' => 'input_radio.tt', > >> >> 'input_text' => 'input_text.tt', > >> >> 'theader' => 'theader.tt', > >> >> 'select_multiple' => 'select_multiple.tt > >> >> ', > >> >> 'select' => 'select.tt', > >> >> 'input_hidden' => 'input_hidden.tt', > >> >> 'tnavigation' => 'tnavigation.tt', > >> >> 'input_file' => 'input_file.tt', > >> >> 'tdata' => 'tdata.tt', > >> >> 'textarea' => 'textarea.tt' > >> >> }, > >> >> 'profiles' => [ > >> >> > >> >> '/home/jason/Workspace/12engines/12engines-service/profiles/
> contact.pl
> >> '
> >> >> ] > >> >> }, 'Dancer::Plugin::DataFu::Form' ); in > >> >> /home/jason/Workspace/12engines/12engines-service/lib/service.pm l.
> >> 159
> >> > > >> > > >> > > >> > Any assistance is appreciated. > >> >
> >> > >>
> >
> >
-- Al Newkirk & Associates Internet Business Consultants http://ana.im we@ana.im 215 469 1262

Message body is not shown because it is too large.