Skip Menu |

This queue is for tickets about the HTML-TurboForm CPAN distribution.

Report information
The Basics
Id: 84858
Status: resolved
Worked: 2 min
Priority: 0/
Queue: HTML-TurboForm

People
Owner: CAMELCASE [...] cpan.org
Requestors: WESAL [...] cpan.org
Cc:
AdminCc:

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



Subject: new with no args
Hi, I do some pre-processing of the request args and I had a workflow of $form->new(); $form->add_element(); .. ; $form->populate($processed_args); But this is broken when no hashref is passed into new. A workaround is to pass in the empty hash. The documentation for ->new says a $request is necessary but i would expect a warning, an undef, or to default to an empty hash {}. #--- test-new.t --- #!/usr/bin/env perl use strict; use warnings; use Test::More; use_ok 'HTML::TurboForm'; { # new() - fails as a hashref is required my $form = HTML::TurboForm->new(); $form->add_element({ type => "Text", name => 'query' }); $form->populate({ query => 'Question' }); is $form->get_value('query'), 'Question', " .. new(), .. get_value('query')"; } { # new( {} ) - ok my $form = HTML::TurboForm->new({}); # a hashref is required $form->add_element({ type => "Text", name => 'query' }); $form->populate({ query => 'Question' }); is $form->get_value('query'), 'Question', " .. new({}), .. get_value('query')"; } done_testing;
resolved in Version 0.74, thanks for the hint