html-formhandler icon indicating copy to clipboard operation
html-formhandler copied to clipboard

HTML::FormHandler::TraitFor::Captcha issues

Open ghenry opened this issue 9 years ago • 4 comments

"Setting both default and builder is not allowed. at /usr/local/lib/perl/5.14.2/Moose/Exporter.pm line 419 Moose::has('+wrapper_class', 'default', 'captcha') called at /usr/local/share/perl/5.14.2/HTML/FormHandler/Field/Captcha.pm line 15

My code:

package SureVoIP::Portal::Form::Auth::Reset;

use strict;
use warnings;

use HTML::FormHandler::Moose;
extends 'HTML::FormHandler';
with 'HTML::FormHandler::TraitFor::Captcha';
with 'HTML::FormHandler::Render::Simple';

has_field 'email' => (
    type     => 'Email',
    label    => 'Email',
    required => 1,
);

has_field '+captcha' => (
    id => 'captcha',
    height => '24',
    width  => '70'
);

no HTML::FormHandler::Moose;
1;

Thanks.

ghenry avatar Dec 08 '15 15:12 ghenry

I also encountered.

% cat /usr/ports/www/p5-HTML-FormHandler/files/patch-lib_HTML_FormHandler_Field_Captcha.pm
--- lib/HTML/FormHandler/Field/Captcha.pm.orig  2015-09-17 14:56:43 UTC
+++ lib/HTML/FormHandler/Field/Captcha.pm
@@ -12,7 +12,8 @@ has 'scramble' => ( isa => 'Int', is =>
 has 'lines'    => ( isa => 'Int', is => 'rw', default => '2' );
 has 'gd_font'  => ( isa => 'Str', is => 'rw', default => 'Large' );
 has 'image'    => ( is  => 'rw' );
-has '+wrapper_class' => ( default => 'captcha' );
+# Setting both default and builder is not allowed. at /usr/local/lib/perl5/site_perl/mach/5.20/Moose/Exporter.pm line 419
+#has '+wrapper_class' => ( default => 'captcha' );
 has '+widget' => ( default => 'Captcha' );

 has '+noupdate' => ( default => 1 );

bokutin avatar Dec 08 '15 22:12 bokutin

On 8 Dec 2015 22:34, "Tomohiro Hosaka" [email protected] wrote:

I also encountered.

% cat /usr/ports/www/p5-HTML-FormHandler/files/patch-lib_HTML_FormHandler_Field_Captcha.pm --- lib/HTML/FormHandler/Field/Captcha.pm.orig 2015-09-17 14:56:43 UTC +++ lib/HTML/FormHandler/Field/Captcha.pm @@ -12,7 +12,8 @@ has 'scramble' => ( isa => 'Int', is => has 'lines' => ( isa => 'Int', is => 'rw', default => '2' ); has 'gd_font' => ( isa => 'Str', is => 'rw', default => 'Large' ); has 'image' => ( is => 'rw' ); -has '+wrapper_class' => ( default => 'captcha' ); +# Setting both default and builder is not allowed. at /usr/local/lib/perl5/site_perl/mach/5.20/Moose/Exporter.pm line 419 +#has '+wrapper_class' => ( default => 'captcha' ); has '+widget' => ( default => 'Captcha' );

has '+noupdate' => ( default => 1 );

Thanks for letting me know!

ghenry avatar Dec 08 '15 23:12 ghenry

Is this now in the latest version?

ghenry avatar Dec 14 '15 13:12 ghenry

Yes.

# pwd
/usr/ports/www/p5-HTML-FormHandler
# cat distinfo
SHA256 (HTML-FormHandler-0.40064.tar.gz) = ae70070ecfd3be1fbcd5198b7b5e76944facc2f151d7980ee8f7f6b33b4378ee
SIZE (HTML-FormHandler-0.40064.tar.gz) = 310478

But, it is private ports tree for myself.

bokutin avatar Dec 14 '15 16:12 bokutin