[Catalyst] Empty strings and FormValidator

Michael Reece mreece at sacbee.com
Tue Apr 19 18:55:33 CEST 2005


Using Catalyst::Plugin::FormValidator and Class::DBI::FromForm, I noticed
that 'cleared' values (empty string) are not saved.

This is because Data::FormValidator->check deletes empty values from the
'valid' hash:

(in Data/FormValidator/Results.pm, sub _process)

    delete $valid{$field} unless (defined $valid{$field} and length
$valid{$field});

so these cleared fields are never updated by update_from_form.

Has anyone dealt with this problem or have suggestions?





More information about the Catalyst mailing list