X-Git-Url: https://git.decadent.org.uk/gitweb/?p=maypole.git;a=blobdiff_plain;f=lib%2FMaypole%2FModel%2FCDBI%2FDFV.pm;h=ca3609c193578760322f983fc1eb0840426332ca;hp=7848759d610a72bc97711b175af01bd196d41704;hb=c8353a63e48638b2f9cbf8bbc24c53825cc3212f;hpb=2af3091e4954c080708cb08eb3c72d52416f9ca1 diff --git a/lib/Maypole/Model/CDBI/DFV.pm b/lib/Maypole/Model/CDBI/DFV.pm index 7848759..ca3609c 100644 --- a/lib/Maypole/Model/CDBI/DFV.pm +++ b/lib/Maypole/Model/CDBI/DFV.pm @@ -181,8 +181,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;