Skip to content

Commit

Permalink
import HTML-FormFu 0.02001 from CPAN
Browse files Browse the repository at this point in the history
git-cpan-module:   HTML-FormFu
git-cpan-version:  0.02001
git-cpan-authorid: CFRANKS
git-cpan-file:     authors/id/C/CF/CFRANKS/HTML-FormFu-0.02001.tar.gz
  • Loading branch information
Carl Franks authored and schwern committed Dec 12, 2009
1 parent 41bf6df commit 1a3425f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.02000 2007-12-12

- Bugfix for save_to_model() in HTML::FormFu::Model::DBIC

0.02000 2007-12-12

- New HTML::FormFu::Model::DBIC module to replace DBIx::Class::HTML::FormFu
Expand Down
2 changes: 1 addition & 1 deletion META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ requires:
YAML::Syck: 0
perl: 5.8.1
tests: t/*.t t/*/*.t
version: 0.02000
version: 0.02001
2 changes: 1 addition & 1 deletion lib/HTML/FormFu.pm
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ __PACKAGE__->mk_inherited_merging_accessors(qw/ tt_args config_callback /);
*output_processors = \&output_processor;
*loc = \&localize;

our $VERSION = '0.02000';
our $VERSION = '0.02001';
$VERSION = eval $VERSION;

Class::C3::initialize();
Expand Down
17 changes: 9 additions & 8 deletions lib/HTML/FormFu/Model/DBIC.pm
Original file line number Diff line number Diff line change
Expand Up @@ -455,13 +455,8 @@ sub _save_columns {

my @valid = $form->valid;

my @pk = $dbic->result_source->primary_columns;

for my $col (@$cols) {

# don't edit primary key columns
next if grep { $col eq $_ } @pk;

my $col_info = $dbic->column_info($col);
my $is_nullable = $col_info->{is_nullable} || 0;
my $data_type = $col_info->{data_type} || '';
Expand All @@ -482,9 +477,15 @@ sub _save_columns {
my $nested_name = defined $field ? $field->nested_name : undef;

my $value
= defined $field ? $form->param( $field->nested_name )
: ( grep { $col eq $_ } @valid ) ? $form->param($col)
: undef;
= defined $field
? $form->param( $field->nested_name )
: ( grep { defined $attrs->{nested_base}
? defined $nested_name
? $nested_name eq $_
: 0
: $col eq $_ } @valid )
? $form->param($col)
: undef;

if ( defined $field
&& $field->db->{delete_if_empty}
Expand Down
1 change: 0 additions & 1 deletion t/save_to_model/has_one_create.t
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ my $rs = $schema->resultset('Master');
$form->process({
"id" => 3,
"text_col" => 'a',
"user.id" => '',
"user.name" => 'bar',
});

Expand Down
1 change: 0 additions & 1 deletion t/save_to_model/might_have_create.t
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ my $note_rs = $schema->resultset('Note');
$form->process({
"id" => 3,
"text_col" => 'a',
"note.id" => '',
"note.note" => 'abc',
});

Expand Down

0 comments on commit 1a3425f

Please sign in to comment.