X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fdeploy_zone.pm;h=723b491c852ef47e7f75ec3e4a1cc368cf80684c;hb=b0888dc8399fc4e8d75c874c00d01366eacf5596;hp=efa36610ccf376049c8c648384ddc78c9e46d3f9;hpb=35d76834f3fce8c1e7a450c8f260c9cf54035749;p=freeside.git diff --git a/FS/FS/deploy_zone.pm b/FS/FS/deploy_zone.pm index efa36610c..723b491c8 100644 --- a/FS/FS/deploy_zone.pm +++ b/FS/FS/deploy_zone.pm @@ -187,8 +187,15 @@ returns the error, otherwise returns false. =cut -# the replace method can be inherited from FS::Record +sub replace { + my $self = shift; + my $old = shift || $self->replace_old; + + $self->expire_date(time) + if $self->disabled eq 'Y' && ! $old->disabled && ! $self->expire_date; + $self->SUPER::replace($old, @_); +} =item check Checks all fields to make sure this is a valid zone record. If there is @@ -418,6 +425,7 @@ sub process_block_lookup { die $response->status_line unless $response->is_success; $data = decode_json($response->content); die $data->{error}{message} if $data->{error}; + last unless scalar @{$data->{features}}; #Nothing to insert foreach my $feature (@{ $data->{features} }) { my $geoid = $feature->{attributes}{GEOID}; # the prize