if ($obj) {
# We have something to edit
$obj->update_from_cgi($h);
- warn "Updating an object ($obj) with ".Dumper($h); use Data::Dumper;
} else {
$obj = $self->create_from_cgi($h);
}
if (my %errors = $obj->cgi_update_errors) {
# Set it up as it was:
- warn "There were errors: ".Dumper(\%errors)."\n";
$r->{template_args}{cgi_params} = $r->{params};
$r->{template_args}{errors} = \%errors;
$r->{template} = "edit";
my ($self, $r) = @_;
my %fields = map {$_ => 1 } $self->columns;
my $oper = "like"; # For now
- use Carp; Carp::confess("Urgh") unless ref $r;
my %params = %{$r->{params}};
my %values = map { $_ => {$oper, $params{$_} } }
grep { $params{$_} and $fields{$_} } keys %params;