X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FModel%2FCDBI%2FDFV.pm;h=5aa0e9ab85cc37aa592800a620449a3c0ff73c16;hb=ee812d68b34c0e43d89551e39ebf5b7d247ac5b6;hp=7848759d610a72bc97711b175af01bd196d41704;hpb=bd6da5dd49b9a50d49098f97278e4b440cb17bd9;p=maypole.git diff --git a/lib/Maypole/Model/CDBI/DFV.pm b/lib/Maypole/Model/CDBI/DFV.pm index 7848759..5aa0e9a 100644 --- a/lib/Maypole/Model/CDBI/DFV.pm +++ b/lib/Maypole/Model/CDBI/DFV.pm @@ -35,7 +35,6 @@ of CGI::Untaint. For teh win!! =cut -use Class::C3; use Data::FormValidator; use Data::Dumper; @@ -181,8 +180,16 @@ sub _do_update { my $this_class_params = {}; + + + # NG changes start here. + # Code below fails to handle multi col PKs + my @pks = $class->columns('Primary'); + foreach my $param ( $class->columns ) { - next if ($param eq $class->columns('Primary')); + # next if ($param eq $class->columns('Primary')); + next if grep {/^${param}$/} @pks; + my $value = $r->params->{$param}; next unless (defined $value); $this_class_params->{$param} = ( $value eq '' ) ? undef : $value;