package Maypole::Model::CDBI::AsForm;
-
-use Class::C3;
use strict;
use warnings;
unless (defined $selected);
my $a = HTML::Element->new("select", name => $col);
- if ($args->{column_nullable} || $args->{value} eq '') {
+ if ($args->{column_nullable} || !defined $args->{value} ) {
my $null = HTML::Element->new("option");
- $null->attr('selected', 'selected') if $args->{value} eq '';
+ $null->attr('selected', 'selected') if (!defined $args->{value});
$a->push_content( $null );
}
for my $object (@$items) {
my $stringify = $args->{stringify};
if ($object->can('stringify_column') ) {
- $stringify ||= $object->stringify_column if ($object->can($object->stringify_column));
+ $stringify ||= $object->stringify_column if ($object->stringify_column && $object->can($object->stringify_column));
}
my $id = $object->id;
my $opt = HTML::Element->new("option", value => $id);