]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/Model/CDBI/AsForm.pm
AsForm select handling tested and works, debug warnings removed
[maypole.git] / lib / Maypole / Model / CDBI / AsForm.pm
index e0499c6ae50fb574c007e76882b37cebeab35d08..48894f9534b7a8b726da80a21bde9b813624cd7b 100644 (file)
@@ -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} || '';