X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_acct.pm;h=b201f23531ef0a1f9df6afbf91a1e609d62fad82;hb=97316d268e5751a1d08a0a37e5a0456f2ce4815c;hp=2606c1453a918ce262a0b2c9b843144543c581eb;hpb=86102d2ff550b869f09dcfaa30bbdc98e5580d56;p=freeside.git diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index 2606c1453..b201f2353 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -192,11 +192,11 @@ sub _fieldhandlers { { #false laziness with edit/svc_acct.cgi 'usergroup' => sub { - my $usergroup = shift; - if ( ref($usergroup) eq 'ARRAY' ) { - $usergroup; - } elsif ( length($usergroup) ) { - [ split(/\s*,\s*/, $usergroup) ]; + my( $self, $groups ) = @_; + if ( ref($groups) eq 'ARRAY' ) { + $groups; + } elsif ( length($groups) ) { + [ split(/\s*,\s*/, $groups) ]; } else { []; } @@ -484,6 +484,11 @@ sub replace { my $error; warn "$me replacing $old with $new\n" if $DEBUG; + # We absolutely have to have an old vs. new record to make this work. + if (!defined($old)) { + $old = qsearchs( 'svc_acct', { 'svcnum' => $new->svcnum } ); + } + return "can't modify system account" if $old->_check_system; { @@ -703,7 +708,7 @@ sub check { my($recref) = $self->hashref; - my $x = $self->setfixed; + my $x = $self->setfixed( $self->_fieldhandlers ); return $x unless ref($x); my $part_svc = $x;