X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_svc.pm;h=3ae79a6df3447c5b243afa5dacb1833d86808646;hb=552ab4d038b22d47d981dd19e8ab2d1fd421e494;hp=d3fe3b6ccad435da16f8e92a6065951d6ce19139;hpb=9324c64e784a866c4d615773c8ce5970cc0d6ed8;p=freeside.git diff --git a/FS/FS/part_svc.pm b/FS/FS/part_svc.pm index d3fe3b6cc..3ae79a6df 100644 --- a/FS/FS/part_svc.pm +++ b/FS/FS/part_svc.pm @@ -12,7 +12,7 @@ use FS::cust_svc; @ISA = qw(FS::Record); -$DEBUG = 1; +$DEBUG = 0; =head1 NAME @@ -875,13 +875,21 @@ sub _upgrade_data { #class method next if $col->columnvalue =~ /^[\d,]+$/ || !$col->columnvalue; my @groupnames = split(',',$col->columnvalue); my @groupnums; + my $error = ''; foreach my $groupname ( @groupnames ) { - my $g = qsearchs('radius_group', { 'groupname' => $groupname } ) - || die "invalid group ".$groupname; + my $g = qsearchs('radius_group', { 'groupname' => $groupname } ); + unless ( $g ) { + $g = new FS::radius_group { + 'groupname' => $groupname, + 'description' => $groupname, + }; + $error = $g->insert; + die $error if $error; + } push @groupnums, $g->groupnum; } $col->columnvalue(join(',',@groupnums)); - my $error = $col->replace; + $error = $col->replace; die $error if $error; }