html-formhandler
html-formhandler copied to clipboard
options method on Select fields receives inconsistent, undocumented arguments
I just discovered a significant behaviour difference between options methods on Select fields, depending on how they are declared:
has_field foo => (
type => 'Select',
options_method => sub { ... }, # receives one argument: ($field)
);
has_field bar => (
type => 'Select',
);
sub options_bar { ... } # receives two arguments: ($form, $field)
This causes interesting failures when moving a sub from one style to the other.
It doesn't look like the documentation describes what is passed in either case.