summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/contact.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/FS/FS/contact.pm b/FS/FS/contact.pm
index 7e474f186..e004cf8eb 100644
--- a/FS/FS/contact.pm
+++ b/FS/FS/contact.pm
@@ -283,8 +283,11 @@ sub replace {
);
my $contact_phone = qsearchs('contact_phone', \%cp);
- # if new value is empty, delete old entry
- if (!$self->get($pf)) {
+ my $pv = $self->get($pf);
+ $pv =~ s/\s//g;
+
+ #if new value is empty, delete old entry
+ if (!$pv) {
if ($contact_phone) {
$error = $contact_phone->delete;
if ( $error ) {
@@ -297,7 +300,7 @@ sub replace {
$contact_phone ||= new FS::contact_phone \%cp;
- my %cpd = _parse_phonestring( $self->get($pf) );
+ my %cpd = _parse_phonestring( $pv );
$contact_phone->set( $_ => $cpd{$_} ) foreach keys %cpd;
my $method = $contact_phone->contactphonenum ? 'replace' : 'insert';