=cut
-use Class::C3;
use Data::FormValidator;
use Data::Dumper;
if (ref $errors) {
# pass errors to template
$r->template_args->{errors} = $errors;
- foreach my $error (keys %$errors) {
- $r->template_args->{errors}{ucfirst($error)} = $errors->{$error}
- }
-
# Set it up as it was:
$r->template_args->{cgi_params} = $r->params;
$r->template("edit");
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;