From c8353a63e48638b2f9cbf8bbc24c53825cc3212f Mon Sep 17 00:00:00 2001 From: Aaron Trevena Date: Fri, 23 Mar 2007 17:57:25 +0000 Subject: [PATCH] applied patch from nicg : Modified DFV.pm to allow for multiple column primary keys git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@556 48953598-375a-da11-a14b-00016c27c3ee --- lib/Maypole/Model/CDBI/DFV.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; -- 2.39.5