X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fpart_event.html;h=467d69ac3776f03da3f7dfc6c9a44c0b7f70f0be;hb=bf951595745feebeebc8acf91a5cf846c22c6533;hp=bac69241c847eeb64e610442a3ba9c3042624809;hpb=8dd41f364aaba88969dfd0908feb22709025e7f6;p=freeside.git

diff --git a/httemplate/edit/process/part_event.html b/httemplate/edit/process/part_event.html
index bac69241c..467d69ac3 100644
--- a/httemplate/edit/process/part_event.html
+++ b/httemplate/edit/process/part_event.html
@@ -39,8 +39,9 @@
                                                  split(/\0/, $value)
                                            };
                                 } elsif ( $info->{'type'} eq 'freq' ) {
-                                  $value = '0' if !length($value);
-                                  $value .= $params->{$cgi_field.'_units'};
+                                  $value = '0' if !length($value) and !$info->{'allow_blank'};
+                                  $value = '0' if $value =~ /[^\d]/;
+                                  $value .= $params->{$cgi_field.'_units'} if length($value);
                                 }
 
                                 #warn "value of $cgi_field is $value\n";
@@ -75,13 +76,13 @@
             }
             ( $option => $value );
           }
-          @{ $object->option_fields_listref };
+          @{ $object->option_fields_listref || [] };
 
     },
     'precheck_callback' => sub {
       my $cgi = shift;
       my $action = $cgi->param('action') or return;
-      my %actionfields = map { $_ =~ /^$action\.(.*)/; $1 => $cgi->param($_) }
+      my %actionfields = map { $_ =~ /^$action\.(.*)/; $1 => scalar($cgi->param($_)) }
                          grep { /^$action\./ } $cgi->param;
       if ( exists($actionfields{'reasonnum'}) and 
            length($actionfields{'reasonnum'}) == 0 ) {
@@ -99,8 +100,10 @@
 	next unless $cgi->param($1) eq 'balance_age';
 
 	my $errstr = FS::part_event::Condition::balance_age->
-	  check_options( { age       => $cgi->param($param),
-			   age_units => $cgi->param("${param}_units") } );
+	  check_options( { age       => scalar($cgi->param($param)),
+			   age_units => scalar($cgi->param("${param}_units")),
+                         }
+                       );
 
 	return $errstr if $errstr;
       }