hunk ./Build.PL 8 - dist_author => 'Mark Stosberg ', + dist_author => [ 'Michael Graham ', 'Mark Stosberg ' ], hunk ./Build.PL 13 - 'Test::More' => 0, - 'HTML::FillInForm' => 1.05, + 'Test::More' => 0, + 'HTML::FillInForm' => 1.00, + 'CGI::Application' => 0, + }, + recommends => { + 'HTML::FillInForm' => 1.04, hunk ./Changes 3 - - typo fix in the POD (Mark Fuller) +1.14 09/13/05 + - added Michael Graham to dist_author in Build.PL + - lowered prereq of HTML::FillInForm to 1.00 + - indicated that HTML::FillInForm version of 1.04 is recommended + - changed fill_form() to accept $html being a reference to a + scalarref. This is useful for use with templating plugins which + return a reference to a string (CAP::AnyTemplate and CAP::TT both + do this): hunk ./Changes 12 -1.00_3 07/31/05 + my $html = $self->template->process; + + $self->fill_form(\$html, ...); # it does not matter if $html + # was already a reference + + + +1.13 09/01/05 + - fixed a test failure when using an older version of HTML::FillInForm + - added dist/prove_prereqs.pl for testing with older versions of + prerequisite modules. See the source of that script file for info. + +1.12 08/30/05 + - added Michael Graham to list of maintainers in docs to reduce + confusion over which is the official version + +1.12_01 08/23/05 + - To conserve memory, fill_form now returns a reference to the HTML + output instead of a copy of it (Cees Hek). + +1.11 08/15/05 + - added CGI::Application to the prerequisites + - now mode_param (e.g. 'rm') is always ignored by default + (i.e. not just when the query is used as the source) + +1.10 07/31/05 + - clarified the docs about multiple data sources + - upped the version number so this package cleanly supercedes all + previous versions. + +1.00_3 07/31/05 (unreleased) hunk ./MANIFEST.SKIP 1 -# This is a list of regular expressions of files to skip when rebuilding +# This is a list of regular expressions of files to skip when rebuilding hunk ./MANIFEST.SKIP 27 +t/prereq_scenarios hunk ./lib/CGI/Application/Plugin/FillInForm.pm 6 -$VERSION = 1.00_3; +$VERSION = '1.14'; hunk ./lib/CGI/Application/Plugin/FillInForm.pm 31 - # fill an HTML form with data in a hashref or from an object with a param() method + # fill an HTML form with data in a hashref or from an object with with a param() method hunk ./lib/CGI/Application/Plugin/FillInForm.pm 35 + # (each item in the list can be either a hashref or an object) hunk ./lib/CGI/Application/Plugin/FillInForm.pm 47 -If the query is used as the data source, we will ignore the mode param (usually -'rm') from the query object. This prevents accidently clobbering a run mode for -the next field, which may be stored in a hidden field. +By default, the mode param (usually 'rm') of every data source will be +ignored. This prevents accidently clobbering your run mode for the next +page, which may be stored in a hidden field. hunk ./lib/CGI/Application/Plugin/FillInForm.pm 51 -B<$html> must be a scalarref. +B<$html> must be a scalarref, or a reference to a scalarref. +B<$filled_html> will be a reference to a string. hunk ./lib/CGI/Application/Plugin/FillInForm.pm 67 + if (ref $html eq 'REF' and ref $$html eq 'SCALAR') { + $html = $$html; + } hunk ./lib/CGI/Application/Plugin/FillInForm.pm 72 - my %params; + my %params = ( + ignore_fields => [ $self->mode_param()], + ); hunk ./lib/CGI/Application/Plugin/FillInForm.pm 128 - %params = ( - fobject => $self->query, - ignore_fields => [ $self->mode_param()], - ); + $params{'fobject'} = $self->query; hunk ./lib/CGI/Application/Plugin/FillInForm.pm 133 - return $fif->fill(scalarref => $html, %params, %extra_params); + my $output = $fif->fill(scalarref => $html, %params, %extra_params); + return \$output; hunk ./lib/CGI/Application/Plugin/FillInForm.pm 140 - Mark Stosberg, C<< >> polished it for release. + Mark Stosberg, C<< >> polished it for release. + Michael Graham, C<< >> added tests and some new features. + The module is now co-maintained by Mark and Michael. hunk ./t/01-fif-args.t 79 + $self->mode_param('rm_bar') ; + $self->query->param('rm_bar' => 'bubba'); hunk ./t/01-fif-args.t 95 - my $fdat = delete $fif_params{'fdat'}; + my $fdat = delete $fif_params{'fdat'}; + my $ignore_fields = delete $fif_params{'ignore_fields'}; hunk ./t/01-fif-args.t 99 + ok(eq_array($ignore_fields, ['rm_bar']), '[obj] ignore_fields '); hunk ./t/01-fif-args.t 105 + + # Same, but use a reference to the reference of the input $html + %data = ( + 'data_var1' => 'value1', + 'data_var2' => 'value2', + ); + %options = ( + 'dopt1' => 'doptvalue1', + 'dopt2' => 'doptvalue2', + ); + + my $html_ref = \$html; + $self->fill_form(\$html_ref, \%data, %options); + %fif_params = @$FiF_Fill_Args; + + $fdat = delete $fif_params{'fdat'}; + $ignore_fields = delete $fif_params{'ignore_fields'}; + + ok(eq_hash($fdat, \%data), '[data (html ref)] fdat'); + ok(eq_array($ignore_fields, ['rm_bar']), '[obj (html ref)] ignore_fields '); + is(delete $fif_params{'scalarref'}, \$html, '[data (html ref)] scalarref'); + is(delete $fif_params{'dopt1'}, 'doptvalue1', '[data (html ref)] dopt1'); + is(delete $fif_params{'dopt2'}, 'doptvalue2', '[data (html ref)] dopt2'); + ok(!keys %fif_params, '[data (html ref)] no params unaccounted for'); + + + hunk ./t/01-fif-args.t 143 + hunk ./t/01-fif-args.t 147 - my $fobject = delete $fif_params{'fobject'}; - - $fobject = $fobject->[0] if ref $fobject eq 'ARRAY'; + my $fobject = delete $fif_params{'fobject'}; + $ignore_fields = delete $fif_params{'ignore_fields'}; + $fobject = $fobject->[0] if ref $fobject eq 'ARRAY'; hunk ./t/01-fif-args.t 153 + ok(eq_array($ignore_fields, ['rm_bar']), '[obj] ignore_fields '); hunk ./t/01-fif-args.t 194 - $fobject = delete $fif_params{'fobject'}; - $fdat = delete $fif_params{'fdat'}; + $fobject = delete $fif_params{'fobject'}; + $fdat = delete $fif_params{'fdat'}; + $ignore_fields = delete $fif_params{'ignore_fields'}; hunk ./t/01-fif-args.t 200 + ok(eq_array($ignore_fields, ['rm_bar']), '[obj] ignore_fields '); hunk ./t/01-fif-args.t 217 - my $ignore_fields = delete $fif_params{'ignore_fields'}; + $ignore_fields = delete $fif_params{'ignore_fields'}; hunk ./t/01-fif-args.t 220 - ok(eq_array($ignore_fields, ['rm_foo']), '[none] fobject is query'); + ok(eq_array($ignore_fields, ['rm_foo']), '[none] ignore_fields'); hunk ./t/02-fif.t 48 + $self->mode_param('rm_foo') ; + $self->query->param('rm_foo' => 'bubba'); + hunk ./t/02-fif.t 114 - form_data_ok(\$output, %form_data, '[data] form data ok'); + form_data_ok($output, %form_data, '[data] form data ok'); hunk ./t/02-fif.t 121 + 'rm_foo' => 'bubbles', hunk ./t/02-fif.t 132 + rm_foo => 'original_rm', hunk ./t/02-fif.t 134 - form_data_ok(\$output, %form_data, '[obj] form data ok'); + form_data_ok($output, %form_data, '[obj] form data ok'); hunk ./t/02-fif.t 142 + 'rm_foo' => 'bubbles', hunk ./t/02-fif.t 149 + 'rm_foo' => 'bubbles2', hunk ./t/02-fif.t 155 + 'rm_foo' => 'bubbles3', hunk ./t/02-fif.t 161 + 'rm_foo' => 'bubbles4', hunk ./t/02-fif.t 166 + 'rm_foo' => 'bubbles5', hunk ./t/02-fif.t 189 + rm_foo => 'original_rm', hunk ./t/02-fif.t 191 - form_data_ok(\$output, %form_data, '[list] form data ok'); - + SKIP: + { + skip "Installed HTML::FillInForm does not support ignore fields with fdat - upgrade to version 1.04", 1 if $HTML::FillInForm::VERSION < 1.04; + form_data_ok($output, %form_data, '[list] form data ok'); + } hunk ./t/02-fif.t 211 - form_data_ok(\$output, %form_data, '[none] form data ok'); + form_data_ok($output, %form_data, '[none] form data ok'); hunk ./lib/CGI/Application/Plugin/FillInForm.pm 81 - foreach my $source (@$data) { + for my $source (@$data) { hunk ./lib/CGI/Application/Plugin/FillInForm.pm 106 - foreach my $hash (@fdat) { - foreach my $key (keys %$hash) { + for my $hash (@fdat) { + for my $key (keys %$hash) { hunk ./Changes 3 +1.15 06/22/09 + (No code changes) + - Fix "fill_password" typo (Fred Steinberg) + hunk ./lib/CGI/Application/Plugin/FillInForm.pm 42 - my $filled_html = $self->fill_form($html, undef, fill_passwords => 0 ); + my $filled_html = $self->fill_form($html, undef, fill_password => 0 ); hunk ./lib/CGI/Application/Plugin/FillInForm.pm 2 +use base 'Exporter'; hunk ./lib/CGI/Application/Plugin/FillInForm.pm 4 -require Exporter; -use vars (qw/@ISA @EXPORT_OK $VERSION/); +use warnings; hunk ./lib/CGI/Application/Plugin/FillInForm.pm 6 -$VERSION = '1.14'; -@ISA = qw(Exporter); -@EXPORT_OK = qw(fill_form); +our $VERSION = '1.14'; +our @EXPORT_OK = qw(fill_form); hunk ./lib/CGI/Application/Plugin/FillInForm.pm 6 -our $VERSION = '1.14'; +our $VERSION = '1.15';