From 1f6513b996a1327e839df5d5583f724ce34a2b3e Mon Sep 17 00:00:00 2001 From: Aaron Trevena Date: Wed, 25 Oct 2006 11:16:06 +0000 Subject: [PATCH] AsForm select handling tested and works, debug warnings removed git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@537 48953598-375a-da11-a14b-00016c27c3ee --- Changes | 2 +- lib/Maypole/Model/CDBI/AsForm.pm | 22 +--------------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/Changes b/Changes index 9ac3c6e..cfc5d20 100644 --- a/Changes +++ b/Changes @@ -13,7 +13,7 @@ For information about current developments and future releases, see: Model inheritance re-organised New config method : additional, for stashing additional info, especially from additional_data method new warn method in maypole/request class/object, over-ridden by Apache::MVC, etc or own driver - AsForm fixes + AsForm fixes to stringification _to_select new build_form_elements attribute for Maypole request, set it to 0 to avoid building cgi form if you don't need it 2.11 Mon 31 July 2006 diff --git a/lib/Maypole/Model/CDBI/AsForm.pm b/lib/Maypole/Model/CDBI/AsForm.pm index e0499c6..48894f9 100644 --- a/lib/Maypole/Model/CDBI/AsForm.pm +++ b/lib/Maypole/Model/CDBI/AsForm.pm @@ -717,10 +717,6 @@ sub _to_textfield { sub _to_select { my ($self, $col, $args) = @_; - warn "\n---\n[_to_select] col : $col\n"; - warn "[_to_select] self : $self\n"; - warn "[_to_select] args : ",Dumper($args), "\n"; - warn "[_to_select] caller : ",caller(),"\n"; $args ||= {}; # Do we have items already ? Go no further. @@ -804,12 +800,7 @@ sub _to_select { $args->{items} = \@objs; } else { $args->{items} = $items; - } - - use Data::Dumper; - warn "Just got items. They are " . Dumper($args->{items}); - - warn "col : $col\n"; + } # Make select HTML element $a = $self->_select_guts($col, $args); @@ -1201,28 +1192,23 @@ sub _select_guts { } # Single Hash elsif ($type eq 'HASH') { - warn "making select of single hash"; $a->push_content($self->_options_from_hash($items, $args)); } # Single Array elsif ( $type eq 'ARRAY' and not ref $items->[0] ) { - warn "making select of single array"; $a->push_content($self->_options_from_array($items, $args)); } # Array of Objects elsif ( $type eq 'ARRAY' and $proto !~ /ARRAY|HASH/i ) { # make select of objects - warn "making select of objects\n"; $a->push_content($self->_options_from_objects($items, $args)); } # Array of Arrays elsif ( $type eq 'ARRAY' and $proto eq 'ARRAY' ) { - warn "making select of array of arrays\n"; $a->push_content($self->_options_from_arrays($items, $args)); } # Array of Hashes elsif ( $type eq 'ARRAY' and $proto eq 'HASH' ) { - warn "making select of array of \n"; $a->push_content($self->_options_from_hashes($items, $args)); } else { die "You passed a weird type of data structure to me. Here it is: " . @@ -1247,11 +1233,6 @@ sub _options_from_objects { my $selected = $args->{selected} || {}; my $stringify = $args->{stringify} || $self->stringify_column; - warn "self : $self\n"; - warn "stringify : $stringify\n"; - warn "stringify column : ", $self->stringify_column, "\n"; - warn "stringify in args : ", $args->{stringify}, "\n"; - my @res; for (@$items) { my $id = $_->id; @@ -1326,7 +1307,6 @@ sub _options_from_hash { sub _options_from_hashes { my ($self, $items, $args) = @_; - warn "_options_from_hashes called with $self,", Dumper($items), Dumper($args), "\n"; my $selected = $args->{selected} || {}; my $pk = eval {$args->{class}->primary_column} || 'id'; my $fclass = $args->{class} || ''; -- 2.39.5