Subject: | Date fields broken when creating DBIC form with new result |
Hello,
I believe I have discovered a bug in HTML::FormHandler::Field::Date.pm
To reproduce:
* create a HTML::FormHandler::Model::DBIC form with a Date field.
* create a new database row with $row = $resultset->new_result( {} );
* process the form as: $form->process( item => $row );
Dies with: Can't call method "value" on an undefined value at
html-formhandler/lib/HTML/FormHandler/Field.pm line 740
Same code worked in 0.34000 and before.
Works if a DateTime field is used instead of a Date field.
The problem was introduced in this revision:
https://github.com/gshank/html-formhandler/commit/e95858fb97031c7747e3a92f8c109939b4b113e2
Although I think that change merely exposed an existing problem.
I will attach some test code and a possible fix shortly.
Version information:
HTML-FormHandler-0.34001
This is perl 5, version 12, subversion 2 (v5.12.2) built for
x86_64-linux-thread-multi
Debian 5 2.6.32-4-pve #1 SMP Mon May 9 12:59:57 CEST 2011 x86_64 GNU/Linux