have the UI use full country names, and state names outside the US...
[freeside.git] / FS / FS / svc_Common.pm
index 6e8a5c3..962e36a 100644 (file)
@@ -2,6 +2,7 @@ package FS::svc_Common;
 
 use strict;
 use vars qw( @ISA $noexport_hack $DEBUG );
+use Carp;
 use FS::Record qw( qsearch qsearchs fields dbh );
 use FS::cust_main_Mixin;
 use FS::cust_svc;
@@ -50,8 +51,8 @@ sub new {
   $self->{'Hash'} = { map { $_ => $newhash->{$_} } qw(svcnum svcpart) };
   $self->setdefault;
   $self->{'Hash'}{$_} = $newhash->{$_}
-    foreach #grep length($newhash->{$_}),
-            keys %$newhash;
+    foreach grep { defined($newhash->{$_}) && length($newhash->{$_}) }
+                 keys %$newhash;
 
   foreach my $field ( grep !defined($self->{'Hash'}{$_}), $self->fields ) { 
     $self->{'Hash'}{$field}='';